Compare commits
133 Commits
1.4.1
...
neofetch-7.3.4
| Author | SHA1 | Date | |
|---|---|---|---|
| 673d995618 | |||
| 1097435501 | |||
| 78f4f061f4 | |||
| f909b3c3b8 | |||
| b4944599c5 | |||
| 21cffcc4f4 | |||
| 8d9d4407a3 | |||
| 0e93f5484f | |||
| f9c7c570a1 | |||
| 6f443a23a6 | |||
| ed3bb65824 | |||
| 3770e58e66 | |||
| e0d7c4885a | |||
| e5a7eb2d24 | |||
| ece7cb1f8f | |||
| 43aecc70fe | |||
| f93315a7ad | |||
| cde4914c19 | |||
| e8c7266671 | |||
| bce73f6836 | |||
| 5012c996f2 | |||
| c00568d413 | |||
| d56f083dbc | |||
| b7f6e4f306 | |||
| 619c9d2224 | |||
| d57463b0d3 | |||
| ca13eb22e7 | |||
| a52c49380d | |||
| ba2001cc64 | |||
| e07895c614 | |||
| 3d6427b936 | |||
| 943c3025e5 | |||
| 67cf02c964 | |||
| 8616ff0504 | |||
| dde9443ec7 | |||
| b6f0a80bb1 | |||
| a758b4ba04 | |||
| 700f651378 | |||
| 77614b635f | |||
| fdd3ef970d | |||
| e49ed7d080 | |||
| a1149ab68b | |||
| 6390ed10c4 | |||
| 810b380e47 | |||
| 1274e977c3 | |||
| 38fb44cb8e | |||
| 90c94044f4 | |||
| 5bf7fbf2b4 | |||
| 23a1b10467 | |||
| 0dae7ca3f9 | |||
| e23eb980d3 | |||
| 7171494e95 | |||
| c00848fd79 | |||
| 717ff369c0 | |||
| ff44ea6185 | |||
| 969a7c668c | |||
| bd5d76167e | |||
| f57ad70a20 | |||
| a3da5b6c59 | |||
| 3cbb20c899 | |||
| 0a9ac6a351 | |||
| 75ed187e72 | |||
| cd4849f0b8 | |||
| 0960024e71 | |||
| 7411ec87e7 | |||
| d8f49a2ea2 | |||
| 101d798c0a | |||
| 330de73df3 | |||
| 4e11d21401 | |||
| cb5635908f | |||
| fbbe3b1c93 | |||
| 774598fcb3 | |||
| 8abfb0c876 | |||
| 7a6628d387 | |||
| 09185e5a41 | |||
| 6efd890526 | |||
| 05cf31fc14 | |||
| 220b528c72 | |||
| 038d976b39 | |||
| 60609dfb7e | |||
| 610e06fcd9 | |||
| 49003c859f | |||
| 10bf2fce08 | |||
| 8a091f4d01 | |||
| 10b331052d | |||
| 8751faab2e | |||
| 0a1e97cd92 | |||
| 7e59c362be | |||
| 3e8c103479 | |||
| 5be5aa1b51 | |||
| 08f75415eb | |||
| 02b6e9d72d | |||
| 59b9dc6e1a | |||
| 0f302eea60 | |||
| 7c7cba2346 | |||
| f989ec0d20 | |||
| e72fe4d934 | |||
| 7f48e4cd43 | |||
| bc89c50427 | |||
| 7c93a0df1c | |||
| 8b67e539b5 | |||
| 7c16e15cea | |||
| 79e0a8360b | |||
| d2347cefb1 | |||
| cda96dda4e | |||
| 3dde4bcdef | |||
| 0811acab58 | |||
| f14324ffce | |||
| 1ba7b339c9 | |||
| 8987b0b15f | |||
| 4f12d97e40 | |||
| c3beb21966 | |||
| 078af21630 | |||
| 4e7724ecf8 | |||
| 624bd97045 | |||
| 45ea478414 | |||
| 9e001c530f | |||
| d850e4c91e | |||
| 376268f79e | |||
| b955a61ac5 | |||
| c099c9e5f7 | |||
| 7b62c80881 | |||
| d6b33ae3e9 | |||
| 9da32dab4b | |||
| cf0202fd7c | |||
| 8a01ce491b | |||
| fd2248daec | |||
| ab23dc3c2b | |||
| 58a82c2b5e | |||
| d0fda1ef0d | |||
| 82c37a28d3 | |||
| 042ec7a33c | |||
| 3253d4cbcc |
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
neofetch with pride flags <3
|
neofetch with pride flags <3
|
||||||
|
|
||||||
<img src="https://user-images.githubusercontent.com/22280294/162614541-af2b4660-f1f7-4287-b978-1aa2266ac70f.png" width="60%">
|
<img alt="screenshot" src="https://user-images.githubusercontent.com/22280294/197708447-ddee6db2-1017-48f2-b507-8ddf85acef0d.png">
|
||||||
|
|
||||||
### Running Updated Original Neofetch
|
### Running Updated Original Neofetch
|
||||||
|
|
||||||
@@ -10,7 +10,9 @@ This repo also serves as an updated version of the original `neofetch` since the
|
|||||||
|
|
||||||
* Method 1: `pip install hyfetch` then run `neowofetch`
|
* Method 1: `pip install hyfetch` then run `neowofetch`
|
||||||
* Method 2: `npx neowofetch`
|
* Method 2: `npx neowofetch`
|
||||||
* Method 3: `bash <(curl -sL neowofetch.hydev.org)`
|
* Method 3: `P="$HOME/.local/bin/neowofetch" curl -L nf.hydev.org -o $P && chmod +x $P`
|
||||||
|
* Method 4: Run without install `bash <(curl -sL nf.hydev.org)`
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
@@ -26,9 +28,20 @@ pip install hyfetch
|
|||||||
|
|
||||||
Currently, these distributions have existing packages for HyFetch:
|
Currently, these distributions have existing packages for HyFetch:
|
||||||
|
|
||||||
* ArchLinux: `yay -S hyfetch` (Thanks to @ Aleksana)
|
* Arch Linux: `paru -S hyfetch` or `yay -S hyfetch` (Thanks to [@Aleksana](https://github.com/Aleksanaa))
|
||||||
* Nix: `nix-env -i hyfetch` (Thanks to @ YisuiDenghua)
|
* Nix: `nix-env -i hyfetch` (Thanks to [@YisuiDenghua](https://github.com/YisuiDenghua))
|
||||||
* Guix: `guix install hyfetch` (Thanks to @ WammKD)
|
* Guix: `guix install hyfetch` (Thanks to [@WammKD](https://github.com/WammKD))
|
||||||
|
|
||||||
|
### Method 3: Install the latest developmental version using git
|
||||||
|
|
||||||
|
Install Python >= 3.7 first. Then run the following commands:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/hykilpikonna/hyfetch.git
|
||||||
|
cd hyfetch
|
||||||
|
pip install .
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -36,6 +49,9 @@ When you run `hyfetch` for the first time, it will prompt you to choose a color
|
|||||||
|
|
||||||
If you want to use the updated `neofetch` without LGBTQ flags, check out [this section](https://github.com/hykilpikonna/hyfetch#running-updated-original-neofetch)
|
If you want to use the updated `neofetch` without LGBTQ flags, check out [this section](https://github.com/hykilpikonna/hyfetch#running-updated-original-neofetch)
|
||||||
|
|
||||||
|
|
||||||
|
## Questions and answers
|
||||||
|
|
||||||
#### Q: How do I change my config?
|
#### Q: How do I change my config?
|
||||||
|
|
||||||
A: Use `hyfetch -c`
|
A: Use `hyfetch -c`
|
||||||
@@ -48,6 +64,18 @@ Feel free to experiment with it!
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
To make changes to our codebase, you first need to create a fork by clicking the "Fork" button on the top right. Then, you can clone your fork of the source code using `git clone https://github.com/{your username}/hyfetch.git`.
|
||||||
|
|
||||||
|
After making changes to the source code, you can run `python -m hyfetch` in the root directory of your repo to test out your changes.
|
||||||
|
|
||||||
|
If they work correctly, you can commit and push these changes using git command or Github Desktop. Then, you can create a pull request on Github so that it can go into our next release!
|
||||||
|
|
||||||
|
You can also install your version locally by running `pip install .` in the repo root.
|
||||||
|
|
||||||
|
|
||||||
## Change Log
|
## Change Log
|
||||||
|
|
||||||
### About Notation
|
### About Notation
|
||||||
@@ -57,11 +85,56 @@ Updates to `neowofetch` begins with the emoji 🖼️
|
|||||||
|
|
||||||
### TODO
|
### TODO
|
||||||
|
|
||||||
* [ ] Allow left-right arrow keys for pagination
|
* [ ] (Important!) Refactor flag storage & coloring to support non-stride patterns
|
||||||
* [ ] Implement light/dark background detection based on https://github.com/muesli/termenv
|
* [ ] Config menu: Allow left-right arrow keys for pagination
|
||||||
|
|
||||||
<!-- CHANGELOG STARTS HERE --->
|
<!-- CHANGELOG STARTS HERE --->
|
||||||
|
|
||||||
|
### 1.4.4
|
||||||
|
|
||||||
|
Note: You can install the latest nightly version by using:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pip install git+https://github.com/hykilpikonna/hyfetch.git@master
|
||||||
|
```
|
||||||
|
|
||||||
|
* 🌈 Fix Python 3.11 compatibility (#35)
|
||||||
|
* 🌈 Fix many overflow problems when screen is too small
|
||||||
|
* 🖼️ Distro - Add Enso ([dylanaraps#2233](https://github.com/dylanaraps/neofetch/pull/2233))
|
||||||
|
* 🖼️ Memory - Optimize and fix memory unit conversion ([dylanaraps#2225](https://github.com/dylanaraps/neofetch/pull/2225))
|
||||||
|
* 🖼️ DE - Add dwl window manager ([dylanaraps#2234](https://github.com/dylanaraps/neofetch/pull/2234))
|
||||||
|
* 🖼️ DE - Fix XDG session detection for X11 ([dylanaraps#2232](https://github.com/dylanaraps/neofetch/pull/2232))
|
||||||
|
* 🖼️ CPU - Fix model detection for loongson (#34)
|
||||||
|
|
||||||
|
### 1.4.3
|
||||||
|
|
||||||
|
* 🌈 **Auto detect terminal background color & rgb support**
|
||||||
|
* 🌈 **Optimize experience on light-themed terminals**
|
||||||
|
* 🌈 Fix bugs with lightness and light-mode config not applying
|
||||||
|
* 🌈 Fix color alignment for distros with first color ≠ `${c1}` (e.g. Ubuntu Budgie)
|
||||||
|
* 🌈 Add unlabeled flags (#25)
|
||||||
|
* 🌈 Add gender nonconforming & femboy & tomboy flags (#32)
|
||||||
|
* 🌈 Fix jailbreak iOS shell `killed: 9` issue caused by ld signature check.
|
||||||
|
* 🖼️ Distro - Add garuda_small ([dylanaraps#2215](https://github.com/dylanaraps/neofetch/pull/2215))
|
||||||
|
* 🖼️ Distro - Add Cobalt Linux ([dylanaraps#2213](https://github.com/dylanaraps/neofetch/pull/2213))
|
||||||
|
* 🖼️ Distro - Add VanillaOS ([dylanaraps#2222](https://github.com/dylanaraps/neofetch/pull/2222))
|
||||||
|
* 🖼️ Distro - Surround macOS build number in parentheses (#28)
|
||||||
|
* 🖼️ Misc - Auto select stdout mode based on tty detection (#31)
|
||||||
|
* 🖼️ Bug Fix - Fix cols coloring reset for bash 3.2 (#24)
|
||||||
|
|
||||||
|
### 1.4.2
|
||||||
|
|
||||||
|
* 🌈 Detailed runnning/contributing instructions in README.md (#21)
|
||||||
|
* 🖼️ Distro - Add Stock Linux (#23)
|
||||||
|
* 🖼️ Distro - Add DietPi ([dylanaraps#1706](https://github.com/dylanaraps/neofetch/pull/1706))
|
||||||
|
* 🖼️ Distro - Add OmniOS illumos ([dylanaraps#2196](https://github.com/dylanaraps/neofetch/pull/2196))
|
||||||
|
* 🖼️ Distro - Add Droidian ([dylanaraps#2201](https://github.com/dylanaraps/neofetch/pull/2201))
|
||||||
|
* 🖼️ Distro - Add HamoniKR ([dylanaraps#2210](https://github.com/dylanaraps/neofetch/pull/2210))
|
||||||
|
* 🖼️ Song - Add support for TIDAL HiFi (#22)
|
||||||
|
* 🖼️ CPU - Detect multiple CPU models for ARM
|
||||||
|
* 🖼️ Misc - Better defaults: Show RAM in GiB, RAM percentage, CPU speed rounding, refresh rate
|
||||||
|
* 🖼️ Bug Fix - Fix bash 5.2 column cut off issue (#24)
|
||||||
|
|
||||||
### 1.4.1
|
### 1.4.1
|
||||||
|
|
||||||
* 🌈 Paginate flags (#14)
|
* 🌈 Paginate flags (#14)
|
||||||
@@ -72,7 +145,7 @@ Updates to `neowofetch` begins with the emoji 🖼️
|
|||||||
* 🌈 Add experimental Windows support (very unstable at the moment)
|
* 🌈 Add experimental Windows support (very unstable at the moment)
|
||||||
* 🖼️ Distro - Add ravynOS ([dylanaraps#2182](https://github.com/dylanaraps/neofetch/pull/2182))
|
* 🖼️ Distro - Add ravynOS ([dylanaraps#2182](https://github.com/dylanaraps/neofetch/pull/2182))
|
||||||
* 🖼️ Distro - Add ChonkySealOS ([dylanaraps#2180](https://github.com/dylanaraps/neofetch/pull/2180))
|
* 🖼️ Distro - Add ChonkySealOS ([dylanaraps#2180](https://github.com/dylanaraps/neofetch/pull/2180))
|
||||||
* 🖼️ Distro - Add GhostBSD ([dylanaraps#2180](https://github.com/dylanaraps/neofetch/pull/2180))
|
* 🖼️ Distro - Add GhostBSD ([TheSudoer#18](https://github.com/hykilpikonna/hyfetch/pull/18))
|
||||||
* 🖼️ Distro - Add NekOS ([dylanaraps#2186](https://github.com/dylanaraps/neofetch/pull/2186))
|
* 🖼️ Distro - Add NekOS ([dylanaraps#2186](https://github.com/dylanaraps/neofetch/pull/2186))
|
||||||
* 🖼️ Distro - Add astOS ([dylanaraps#2185](https://github.com/dylanaraps/neofetch/pull/2185))
|
* 🖼️ Distro - Add astOS ([dylanaraps#2185](https://github.com/dylanaraps/neofetch/pull/2185))
|
||||||
* 🖼️ Distro - Fix ChromeOS identification ([dylanaraps#1949](https://github.com/dylanaraps/neofetch/pull/1949))
|
* 🖼️ Distro - Fix ChromeOS identification ([dylanaraps#1949](https://github.com/dylanaraps/neofetch/pull/1949))
|
||||||
|
|||||||
+32
-11
@@ -1,8 +1,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import colorsys
|
import colorsys
|
||||||
from typing import NamedTuple, Callable, Optional
|
from dataclasses import dataclass, astuple
|
||||||
|
|
||||||
from typing_extensions import Literal
|
from typing_extensions import Literal
|
||||||
|
|
||||||
from .constants import GLOBAL_CFG
|
from .constants import GLOBAL_CFG
|
||||||
@@ -84,11 +83,28 @@ def redistribute_rgb(r: int, g: int, b: int) -> tuple[int, int, int]:
|
|||||||
return int(gray + x * r), int(gray + x * g), int(gray + x * b)
|
return int(gray + x * r), int(gray + x * g), int(gray + x * b)
|
||||||
|
|
||||||
|
|
||||||
class RGB(NamedTuple):
|
@dataclass(unsafe_hash=True)
|
||||||
|
class HSL:
|
||||||
|
h: float
|
||||||
|
s: float
|
||||||
|
l: float
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
return iter(astuple(self))
|
||||||
|
|
||||||
|
def rgb(self) -> RGB:
|
||||||
|
return RGB(*[round(v * 255.0) for v in colorsys.hls_to_rgb(self.h, self.l, self.s)])
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass(unsafe_hash=True)
|
||||||
|
class RGB:
|
||||||
r: int
|
r: int
|
||||||
g: int
|
g: int
|
||||||
b: int
|
b: int
|
||||||
|
|
||||||
|
def __iter__(self):
|
||||||
|
return iter(astuple(self))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_hex(cls, hex: str) -> "RGB":
|
def from_hex(cls, hex: str) -> "RGB":
|
||||||
"""
|
"""
|
||||||
@@ -100,9 +116,7 @@ class RGB(NamedTuple):
|
|||||||
:param hex: Hex color code
|
:param hex: Hex color code
|
||||||
:return: RGB object
|
:return: RGB object
|
||||||
"""
|
"""
|
||||||
while hex.startswith('#'):
|
hex = hex.lstrip("#")
|
||||||
hex = hex[1:]
|
|
||||||
|
|
||||||
r = int(hex[0:2], 16)
|
r = int(hex[0:2], 16)
|
||||||
g = int(hex[2:4], 16)
|
g = int(hex[2:4], 16)
|
||||||
b = int(hex[4:6], 16)
|
b = int(hex[4:6], 16)
|
||||||
@@ -177,6 +191,10 @@ class RGB(NamedTuple):
|
|||||||
"""
|
"""
|
||||||
return RGB(*redistribute_rgb(*[v * multiplier for v in self]))
|
return RGB(*redistribute_rgb(*[v * multiplier for v in self]))
|
||||||
|
|
||||||
|
def hsl(self) -> HSL:
|
||||||
|
h, l, s = colorsys.rgb_to_hls(*[v / 255.0 for v in self])
|
||||||
|
return HSL(h, s, l)
|
||||||
|
|
||||||
def set_light(self, light: float, at_least: bool | None = None, at_most: bool | None = None) -> 'RGB':
|
def set_light(self, light: float, at_least: bool | None = None, at_most: bool | None = None) -> 'RGB':
|
||||||
"""
|
"""
|
||||||
Set HSL lightness value
|
Set HSL lightness value
|
||||||
@@ -187,16 +205,19 @@ class RGB(NamedTuple):
|
|||||||
:return: New color (original isn't modified)
|
:return: New color (original isn't modified)
|
||||||
"""
|
"""
|
||||||
# Convert to HSL
|
# Convert to HSL
|
||||||
h, l, s = colorsys.rgb_to_hls(*[v / 255.0 for v in self])
|
hsl = self.hsl()
|
||||||
|
|
||||||
# Modify light value
|
# Modify light value
|
||||||
if at_least is None and at_most is None:
|
if at_least is None and at_most is None:
|
||||||
l = light
|
hsl.l = light
|
||||||
else:
|
else:
|
||||||
if at_most:
|
if at_most:
|
||||||
l = min(l, light)
|
hsl.l = min(hsl.l, light)
|
||||||
if at_least:
|
if at_least:
|
||||||
l = max(l, light)
|
hsl.l = max(hsl.l, light)
|
||||||
|
|
||||||
# Convert back to RGB
|
# Convert back to RGB
|
||||||
return RGB(*[round(v * 255.0) for v in colorsys.hls_to_rgb(h, l, s)])
|
return hsl.rgb()
|
||||||
|
|
||||||
|
def is_light(self):
|
||||||
|
return self.hsl().l > 0.5
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from pathlib import Path
|
|||||||
from typing_extensions import Literal
|
from typing_extensions import Literal
|
||||||
|
|
||||||
CONFIG_PATH = Path.home() / '.config/hyfetch.json'
|
CONFIG_PATH = Path.home() / '.config/hyfetch.json'
|
||||||
VERSION = '1.4.1'
|
VERSION = '1.4.4'
|
||||||
|
|
||||||
|
|
||||||
TEST_ASCII = r"""
|
TEST_ASCII = r"""
|
||||||
|
|||||||
+94
-72
@@ -4,13 +4,14 @@ from __future__ import annotations
|
|||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
import random
|
import random
|
||||||
import re
|
|
||||||
from itertools import permutations
|
|
||||||
import traceback
|
import traceback
|
||||||
from typing import Iterable
|
from itertools import permutations
|
||||||
from math import ceil
|
from math import ceil
|
||||||
|
from typing import Iterable
|
||||||
|
|
||||||
from .color_util import printc, color, clear_screen
|
from . import termenv
|
||||||
|
from .color_scale import Scale
|
||||||
|
from .color_util import printc, color, clear_screen, AnsiMode
|
||||||
from .constants import *
|
from .constants import *
|
||||||
from .models import Config
|
from .models import Config
|
||||||
from .neofetch_util import *
|
from .neofetch_util import *
|
||||||
@@ -85,11 +86,28 @@ def create_config() -> Config:
|
|||||||
|
|
||||||
:return: Config object (automatically stored)
|
:return: Config object (automatically stored)
|
||||||
"""
|
"""
|
||||||
|
# Detect terminal environment
|
||||||
|
det_bg = termenv.get_background_color()
|
||||||
|
det_ansi = termenv.detect_ansi_mode()
|
||||||
|
|
||||||
asc = get_distro_ascii()
|
asc = get_distro_ascii()
|
||||||
asc_width, asc_lines = ascii_size(asc)
|
asc_width, asc_lines = ascii_size(asc)
|
||||||
title = 'Welcome to &b&lhy&f&lfetch&r! Let\'s set up some colors first.'
|
logo = color("&b&lhyfetch&r" if det_bg is None or det_bg.is_light() else "&b&lhy&f&lfetch&r")
|
||||||
|
title = f'Welcome to {logo} Let\'s set up some colors first.'
|
||||||
clear_screen(title)
|
clear_screen(title)
|
||||||
|
|
||||||
|
option_counter = 1
|
||||||
|
|
||||||
|
def update_title(k: str, v: str):
|
||||||
|
nonlocal title, option_counter
|
||||||
|
if not k.endswith(":"):
|
||||||
|
k += ':'
|
||||||
|
title += f"\n&e{option_counter}. {k.ljust(30)} &r{v}"
|
||||||
|
option_counter += 1
|
||||||
|
|
||||||
|
def print_title_prompt(prompt: str):
|
||||||
|
printc(f'&a{option_counter}. {prompt}')
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
# 0. Check term size
|
# 0. Check term size
|
||||||
try:
|
try:
|
||||||
@@ -104,11 +122,12 @@ def create_config() -> Config:
|
|||||||
|
|
||||||
##############################
|
##############################
|
||||||
# 1. Select color system
|
# 1. Select color system
|
||||||
clear_screen(title)
|
def select_color_system():
|
||||||
term_len, term_lines = term_size()
|
if det_ansi == 'rgb':
|
||||||
try:
|
return 'rgb', 'Detected color mode'
|
||||||
# Demonstrate RGB with a gradient. This requires numpy
|
|
||||||
from .color_scale import Scale
|
clear_screen(title)
|
||||||
|
term_len, term_lines = term_size()
|
||||||
|
|
||||||
scale2 = Scale(['#12c2e9', '#c471ed', '#f7797d'])
|
scale2 = Scale(['#12c2e9', '#c471ed', '#f7797d'])
|
||||||
_8bit = [scale2(i / term_len).to_ansi_8bit(False) for i in range(term_len)]
|
_8bit = [scale2(i / term_len).to_ansi_8bit(False) for i in range(term_len)]
|
||||||
@@ -118,28 +137,32 @@ def create_config() -> Config:
|
|||||||
printc('&f' + ''.join(c + t for c, t in zip(_rgb, 'RGB Color Testing'.center(term_len))))
|
printc('&f' + ''.join(c + t for c, t in zip(_rgb, 'RGB Color Testing'.center(term_len))))
|
||||||
|
|
||||||
print()
|
print()
|
||||||
printc(f'&a1. Which &bcolor system &ado you want to use?')
|
print_title_prompt('Which &bcolor system &ado you want to use?')
|
||||||
printc(f'(If you can\'t see colors under "RGB Color Testing", please choose 8bit)')
|
printc(f'(If you can\'t see colors under "RGB Color Testing", please choose 8bit)')
|
||||||
print()
|
print()
|
||||||
color_system = literal_input('Your choice?', ['8bit', 'rgb'], 'rgb')
|
|
||||||
|
|
||||||
except ModuleNotFoundError:
|
return literal_input('Your choice?', ['8bit', 'rgb'], 'rgb'), 'Selected color mode'
|
||||||
# Numpy not found, skip gradient test, use fallback
|
|
||||||
color_system = literal_input('Which &acolor &bsystem &rdo you want to use?',
|
|
||||||
['8bit', 'rgb'], 'rgb')
|
|
||||||
|
|
||||||
# Override global color mode
|
# Override global color mode
|
||||||
|
color_system, ttl = select_color_system()
|
||||||
GLOBAL_CFG.color_mode = color_system
|
GLOBAL_CFG.color_mode = color_system
|
||||||
title += f'\n&e1. Selected color mode: &r{color_system}'
|
update_title(ttl, color_system)
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
# 2. Select light/dark mode
|
# 2. Select light/dark mode
|
||||||
clear_screen(title)
|
def select_light_dark():
|
||||||
light_dark = literal_input(f'2. Is your terminal in &gf(#85e7e9)light mode&r or &gf(#c471ed)dark mode&r?',
|
if det_bg is not None:
|
||||||
['light', 'dark'], 'dark')
|
return det_bg.is_light(), 'Detected background color'
|
||||||
is_light = light_dark == 'light'
|
|
||||||
|
clear_screen(title)
|
||||||
|
inp = literal_input(f'2. Is your terminal in &blight mode&r or &4dark mode&r?',
|
||||||
|
['light', 'dark'], 'dark')
|
||||||
|
return inp == 'light', 'Selected background color'
|
||||||
|
|
||||||
|
is_light, ttl = select_light_dark()
|
||||||
|
light_dark = 'light' if is_light else 'dark'
|
||||||
GLOBAL_CFG.is_light = is_light
|
GLOBAL_CFG.is_light = is_light
|
||||||
title += f'\n&e2. Light/Dark: &r{light_dark}'
|
update_title(ttl, light_dark)
|
||||||
|
|
||||||
##############################
|
##############################
|
||||||
# 3. Choose preset
|
# 3. Choose preset
|
||||||
@@ -168,7 +191,7 @@ def create_config() -> Config:
|
|||||||
|
|
||||||
def print_flag_page(page: list[list[list[str]]], page_num: int):
|
def print_flag_page(page: list[list[list[str]]], page_num: int):
|
||||||
clear_screen(title)
|
clear_screen(title)
|
||||||
printc('&a3. Let\'s choose a flag!')
|
print_title_prompt("Let's choose a flag!")
|
||||||
printc('Available flag presets:')
|
printc('Available flag presets:')
|
||||||
print(f'Page: {page_num + 1} of {num_pages}')
|
print(f'Page: {page_num + 1} of {num_pages}')
|
||||||
print()
|
print()
|
||||||
@@ -198,45 +221,48 @@ def create_config() -> Config:
|
|||||||
page -= 1
|
page -= 1
|
||||||
else:
|
else:
|
||||||
_prs = PRESETS[preset]
|
_prs = PRESETS[preset]
|
||||||
title += f'\n&e3. Selected flag: &r{_prs.color_text(preset)}'
|
update_title('Selected flag', _prs.set_light_dl_def(light_dark).color_text(preset))
|
||||||
break
|
break
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
# 4. Dim/lighten colors
|
# 4. Dim/lighten colors
|
||||||
clear_screen(title)
|
def select_lightness():
|
||||||
printc(f'&a4. Let\'s adjust the color brightness!')
|
clear_screen(title)
|
||||||
printc(f'The colors might be a little bit too {"bright" if is_light else "dark"} for {light_dark} mode.')
|
print_title_prompt("Let's adjust the color brightness!")
|
||||||
print()
|
printc(f'The colors might be a little bit too {"bright" if is_light else "dark"} for {light_dark} mode.')
|
||||||
|
|
||||||
# Print cats
|
|
||||||
num_cols = term_size()[0] // (TEST_ASCII_WIDTH + 2)
|
|
||||||
ratios = [col / (num_cols - 1) for col in range(num_cols)]
|
|
||||||
ratios = [(r * 0.4 + 0.1) if is_light else (r * 0.4 + 0.5) for r in ratios]
|
|
||||||
lines = [ColorAlignment('horizontal').recolor_ascii(TEST_ASCII.replace(
|
|
||||||
'{txt}', f'{r * 100:.0f}%'.center(5)), _prs.set_light_dl(r, light_dark)).split('\n') for r in ratios]
|
|
||||||
[printc(' '.join(line)) for line in zip(*lines)]
|
|
||||||
|
|
||||||
while True:
|
|
||||||
print()
|
print()
|
||||||
printc(f'Which brightness level look the best? (Default: left blank = {GLOBAL_CFG.default_lightness(light_dark):.2f} for {light_dark} mode)')
|
|
||||||
lightness = input('> ').strip().lower() or None
|
|
||||||
|
|
||||||
# Parse lightness
|
# Print cats
|
||||||
if not lightness or lightness in ['unset', 'none']:
|
num_cols = (term_size()[0] // (TEST_ASCII_WIDTH + 2)) or 1
|
||||||
lightness = None
|
mn, mx = 0.15, 0.85
|
||||||
break
|
ratios = [col / num_cols for col in range(num_cols)]
|
||||||
|
ratios = [(r * (mx - mn) / 2 + mn) if is_light else ((r * (mx - mn) + (mx + mn)) / 2) for r in ratios]
|
||||||
|
lines = [ColorAlignment('horizontal').recolor_ascii(TEST_ASCII.replace(
|
||||||
|
'{txt}', f'{r * 100:.0f}%'.center(5)), _prs.set_light_dl(r, light_dark)).split('\n') for r in ratios]
|
||||||
|
[printc(' '.join(line)) for line in zip(*lines)]
|
||||||
|
|
||||||
try:
|
def_lightness = GLOBAL_CFG.default_lightness(light_dark)
|
||||||
lightness = int(lightness[:-1]) / 100 if lightness.endswith('%') else float(lightness)
|
|
||||||
assert 0 <= lightness <= 1
|
|
||||||
break
|
|
||||||
|
|
||||||
except Exception:
|
while True:
|
||||||
printc('&cUnable to parse lightness value, please input it as a decimal or percentage (e.g. 0.5 or 50%)')
|
print()
|
||||||
|
printc(f'Which brightness level looks the best? (Default: {def_lightness * 100:.0f}% for {light_dark} mode)')
|
||||||
|
lightness = input('> ').strip().lower() or None
|
||||||
|
|
||||||
if lightness:
|
# Parse lightness
|
||||||
_prs = _prs.set_light_dl(lightness, light_dark)
|
if not lightness or lightness in ['unset', 'none']:
|
||||||
title += f'\n&e4. Brightness: &r{f"{lightness:.2f}" if lightness else "unset"}'
|
return def_lightness
|
||||||
|
|
||||||
|
try:
|
||||||
|
lightness = int(lightness[:-1]) / 100 if lightness.endswith('%') else float(lightness)
|
||||||
|
assert 0 <= lightness <= 1
|
||||||
|
return lightness
|
||||||
|
|
||||||
|
except Exception:
|
||||||
|
printc('&cUnable to parse lightness value, please input it as a decimal or percentage (e.g. 0.5 or 50%)')
|
||||||
|
|
||||||
|
lightness = select_lightness()
|
||||||
|
_prs = _prs.set_light_dl(lightness, light_dark)
|
||||||
|
update_title('Selected Brightness', f"{lightness:.2f}")
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
# 5. Color arrangement
|
# 5. Color arrangement
|
||||||
@@ -244,7 +270,7 @@ def create_config() -> Config:
|
|||||||
fore_back = get_fore_back()
|
fore_back = get_fore_back()
|
||||||
|
|
||||||
# Calculate amount of row/column that can be displayed on screen
|
# Calculate amount of row/column that can be displayed on screen
|
||||||
ascii_per_row = term_size()[0] // (asc_width + 2)
|
ascii_per_row = max(1, term_size()[0] // (asc_width + 2))
|
||||||
ascii_rows = max(1, (term_size()[1] - 8) // asc_lines)
|
ascii_rows = max(1, (term_size()[1] - 8) // asc_lines)
|
||||||
|
|
||||||
# Displays horizontal and vertical arrangements in the first iteration, but hide them in
|
# Displays horizontal and vertical arrangements in the first iteration, but hide them in
|
||||||
@@ -261,16 +287,16 @@ def create_config() -> Config:
|
|||||||
|
|
||||||
# Random color schemes
|
# Random color schemes
|
||||||
pis = list(range(len(_prs.unique_colors().colors)))
|
pis = list(range(len(_prs.unique_colors().colors)))
|
||||||
slots = len(set(re.findall('(?<=\\${c)[0-9](?=})', asc)))
|
slots = list(set(re.findall('(?<=\\${c)[0-9](?=})', asc)))
|
||||||
while len(pis) < slots:
|
while len(pis) < len(slots):
|
||||||
pis += pis
|
pis += pis
|
||||||
perm = {p[:slots] for p in permutations(pis)}
|
perm = {p[:len(slots)] for p in permutations(pis)}
|
||||||
random_count = ascii_per_row * ascii_rows - len(arrangements)
|
random_count = max(0, ascii_per_row * ascii_rows - len(arrangements))
|
||||||
if random_count > len(perm):
|
if random_count > len(perm):
|
||||||
choices = perm
|
choices = perm
|
||||||
else:
|
else:
|
||||||
choices = random.sample(perm, random_count)
|
choices = random.sample(sorted(perm), random_count)
|
||||||
choices = [{i + 1: n for i, n in enumerate(c)} for c in choices]
|
choices = [{slots[i]: n for i, n in enumerate(c)} for c in choices]
|
||||||
arrangements += [(f'random{i}', ColorAlignment('custom', r)) for i, r in enumerate(choices)]
|
arrangements += [(f'random{i}', ColorAlignment('custom', r)) for i, r in enumerate(choices)]
|
||||||
asciis = [[*ca.recolor_ascii(asc, _prs).split('\n'), k.center(asc_width)] for k, ca in arrangements]
|
asciis = [[*ca.recolor_ascii(asc, _prs).split('\n'), k.center(asc_width)] for k, ca in arrangements]
|
||||||
|
|
||||||
@@ -282,7 +308,7 @@ def create_config() -> Config:
|
|||||||
[printc(' '.join(line)) for line in zip(*current)]
|
[printc(' '.join(line)) for line in zip(*current)]
|
||||||
print()
|
print()
|
||||||
|
|
||||||
printc(f'&a5. Let\'s choose a color arrangement!')
|
print_title_prompt("Let's choose a color arrangement!")
|
||||||
printc(f'You can choose standard horizontal or vertical alignment, or use one of the random color schemes.')
|
printc(f'You can choose standard horizontal or vertical alignment, or use one of the random color schemes.')
|
||||||
print('You can type "roll" to randomize again.')
|
print('You can type "roll" to randomize again.')
|
||||||
print()
|
print()
|
||||||
@@ -302,7 +328,7 @@ def create_config() -> Config:
|
|||||||
|
|
||||||
break
|
break
|
||||||
|
|
||||||
title += f'\n&e5. Color Alignment: &r{color_alignment}'
|
update_title('Color alignment', color_alignment)
|
||||||
|
|
||||||
# Create config
|
# Create config
|
||||||
clear_screen(title)
|
clear_screen(title)
|
||||||
@@ -361,12 +387,8 @@ def run():
|
|||||||
print(get_distro_ascii())
|
print(get_distro_ascii())
|
||||||
return
|
return
|
||||||
|
|
||||||
# Load config
|
# Load config or create config
|
||||||
config = check_config()
|
config = create_config() if args.config else check_config()
|
||||||
|
|
||||||
# Reset config
|
|
||||||
if args.config:
|
|
||||||
config = create_config()
|
|
||||||
|
|
||||||
# Param overwrite config
|
# Param overwrite config
|
||||||
if args.preset:
|
if args.preset:
|
||||||
@@ -381,13 +403,13 @@ def run():
|
|||||||
# Get preset
|
# Get preset
|
||||||
preset = PRESETS.get(config.preset)
|
preset = PRESETS.get(config.preset)
|
||||||
|
|
||||||
# Lighten
|
# Lighten (args > config)
|
||||||
if args.scale:
|
if args.scale:
|
||||||
preset = preset.lighten(args.scale)
|
preset = preset.lighten(args.scale)
|
||||||
if args.light:
|
elif args.light:
|
||||||
preset = preset.set_light_raw(args.light)
|
preset = preset.set_light_raw(args.light)
|
||||||
if config.lightness:
|
else:
|
||||||
preset = preset.set_light_dl(config.lightness)
|
preset = preset.set_light_dl(config.lightness or GLOBAL_CFG.default_lightness())
|
||||||
|
|
||||||
# Run
|
# Run
|
||||||
try:
|
try:
|
||||||
|
|||||||
+2
-4
@@ -1,8 +1,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass, field
|
||||||
|
|
||||||
from typing_extensions import Literal
|
|
||||||
|
|
||||||
from .color_util import AnsiMode, LightDark
|
from .color_util import AnsiMode, LightDark
|
||||||
from .constants import CONFIG_PATH
|
from .constants import CONFIG_PATH
|
||||||
@@ -16,7 +14,7 @@ class Config:
|
|||||||
mode: AnsiMode
|
mode: AnsiMode
|
||||||
light_dark: LightDark = 'dark'
|
light_dark: LightDark = 'dark'
|
||||||
lightness: float | None = None
|
lightness: float | None = None
|
||||||
color_align: ColorAlignment = ColorAlignment('horizontal')
|
color_align: ColorAlignment = field(default_factory=lambda: ColorAlignment('horizontal'))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_dict(cls, d: dict):
|
def from_dict(cls, d: dict):
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ def run_command(args: str, pipe: bool = False) -> str | None:
|
|||||||
Run neofetch command
|
Run neofetch command
|
||||||
"""
|
"""
|
||||||
if platform.system() != 'Windows':
|
if platform.system() != 'Windows':
|
||||||
full_cmd = shlex.split(f'{get_command_path()} {args}')
|
full_cmd = shlex.split(f'/usr/bin/env bash {get_command_path()} {args}')
|
||||||
|
|
||||||
else:
|
else:
|
||||||
cmd = get_command_path().replace("\\", "/").replace("C:/", "/c/")
|
cmd = get_command_path().replace("\\", "/").replace("C:/", "/c/")
|
||||||
@@ -288,8 +288,9 @@ def get_fore_back(distro: str | None = None) -> tuple[int, int] | None:
|
|||||||
distro = GLOBAL_CFG.override_distro
|
distro = GLOBAL_CFG.override_distro
|
||||||
if not distro:
|
if not distro:
|
||||||
distro = get_distro_name().lower()
|
distro = get_distro_name().lower()
|
||||||
|
distro = distro.lower().replace(' ', '-')
|
||||||
for k, v in fore_back.items():
|
for k, v in fore_back.items():
|
||||||
if distro.startswith(k.lower()):
|
if distro == k.lower():
|
||||||
return v
|
return v
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@@ -298,5 +299,13 @@ def get_fore_back(distro: str | None = None) -> tuple[int, int] | None:
|
|||||||
fore_back = {
|
fore_back = {
|
||||||
'fedora': (2, 1),
|
'fedora': (2, 1),
|
||||||
'ubuntu': (2, 1),
|
'ubuntu': (2, 1),
|
||||||
|
'kubuntu': (2, 1),
|
||||||
|
'lubuntu': (2, 1),
|
||||||
|
'xubuntu': (2, 1),
|
||||||
|
'ubuntu-cinnamon': (2, 1),
|
||||||
|
'ubuntu-kylin': (2, 1),
|
||||||
|
'ubuntu-mate': (2, 1),
|
||||||
|
'ubuntu-studio': (2, 1),
|
||||||
|
'ubuntu-sway': (2, 1),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+62
-1
@@ -112,7 +112,7 @@ class ColorProfile:
|
|||||||
"""
|
"""
|
||||||
return ColorProfile([c.set_light(light, at_least, at_most) for c in self.colors])
|
return ColorProfile([c.set_light(light, at_least, at_most) for c in self.colors])
|
||||||
|
|
||||||
def set_light_dl(self, light: float, term: LightDark = GLOBAL_CFG.light_dark()):
|
def set_light_dl(self, light: float, term: LightDark | None = None):
|
||||||
"""
|
"""
|
||||||
Set HSL lightness value with respect to dark/light terminals
|
Set HSL lightness value with respect to dark/light terminals
|
||||||
|
|
||||||
@@ -120,6 +120,7 @@ class ColorProfile:
|
|||||||
:param term: Terminal color (can be "dark" or "light")
|
:param term: Terminal color (can be "dark" or "light")
|
||||||
:return: New color profile (original isn't modified)
|
:return: New color profile (original isn't modified)
|
||||||
"""
|
"""
|
||||||
|
term = term or GLOBAL_CFG.light_dark()
|
||||||
assert term.lower() in ['light', 'dark']
|
assert term.lower() in ['light', 'dark']
|
||||||
at_least, at_most = (True, None) if term.lower() == 'dark' else (None, True)
|
at_least, at_most = (True, None) if term.lower() == 'dark' else (None, True)
|
||||||
return self.set_light_raw(light, at_least, at_most)
|
return self.set_light_raw(light, at_least, at_most)
|
||||||
@@ -532,4 +533,64 @@ PRESETS: dict[str, ColorProfile] = {
|
|||||||
"#F39FCE",
|
"#F39FCE",
|
||||||
"#EA7BB3",
|
"#EA7BB3",
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
'unlabeled1': ColorProfile([
|
||||||
|
'#EAF8E4',
|
||||||
|
'#FDFDFB',
|
||||||
|
'#E1EFF7',
|
||||||
|
'#F4E2C4'
|
||||||
|
]),
|
||||||
|
|
||||||
|
'unlabeled2': ColorProfile([
|
||||||
|
'#250548',
|
||||||
|
'#FFFFFF',
|
||||||
|
'#F7DCDA',
|
||||||
|
'#EC9BEE',
|
||||||
|
'#9541FA',
|
||||||
|
'#7D2557'
|
||||||
|
]),
|
||||||
|
|
||||||
|
'gendernonconforming1': ColorProfile(
|
||||||
|
ColorProfile([
|
||||||
|
'#50284d',
|
||||||
|
'#96467b',
|
||||||
|
'#5c96f7',
|
||||||
|
'#ffe6f7',
|
||||||
|
'#5c96f7',
|
||||||
|
'#96467b',
|
||||||
|
'#50284d'
|
||||||
|
]).with_weights([
|
||||||
|
4,1,1,1,1,1,4
|
||||||
|
])
|
||||||
|
),
|
||||||
|
|
||||||
|
'gendernonconforming2': ColorProfile([
|
||||||
|
'#50284d',
|
||||||
|
'#96467b',
|
||||||
|
'#5c96f7',
|
||||||
|
'#ffe6f7',
|
||||||
|
'#5c96f7',
|
||||||
|
'#96467b',
|
||||||
|
'#50284d'
|
||||||
|
]),
|
||||||
|
|
||||||
|
'femboy': ColorProfile([
|
||||||
|
"#d260a5",
|
||||||
|
"#e4afcd",
|
||||||
|
"#fefefe",
|
||||||
|
"#57cef8",
|
||||||
|
"#fefefe",
|
||||||
|
"#e4afcd",
|
||||||
|
"#d260a5"
|
||||||
|
]),
|
||||||
|
|
||||||
|
'tomboy': ColorProfile([
|
||||||
|
"#2f3fb9",
|
||||||
|
"#613a03",
|
||||||
|
"#fefefe",
|
||||||
|
"#f1a9b7",
|
||||||
|
"#fefefe",
|
||||||
|
"#613a03",
|
||||||
|
"#2f3fb9"
|
||||||
|
]),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,162 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import os
|
||||||
|
import platform
|
||||||
|
import signal
|
||||||
|
import sys
|
||||||
|
import termios
|
||||||
|
import tty
|
||||||
|
from select import select
|
||||||
|
|
||||||
|
from .color_util import RGB, AnsiMode
|
||||||
|
|
||||||
|
|
||||||
|
class OSCException(Exception):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def unix_detect_ansi_mode() -> AnsiMode | None:
|
||||||
|
"""
|
||||||
|
Translated from Termenv's ColorProfile():
|
||||||
|
https://github.com/muesli/termenv/blob/42ca574de3e99a262e1724d2fb8daa1aea68a5b9/termenv_unix.go#L23
|
||||||
|
|
||||||
|
:return: Ansi mode
|
||||||
|
"""
|
||||||
|
if not sys.stdout.isatty():
|
||||||
|
return 'ansi'
|
||||||
|
|
||||||
|
term = os.environ.get('TERM')
|
||||||
|
color_term = os.environ.get('COLORTERM')
|
||||||
|
|
||||||
|
if color_term == 'truecolor' or color_term == '24bit':
|
||||||
|
if term.startswith('screen') and os.environ.get('TERM_PROGRAM') != 'tmux':
|
||||||
|
return '8bit'
|
||||||
|
return 'rgb'
|
||||||
|
|
||||||
|
elif color_term == 'true' or color_term == 'yes':
|
||||||
|
return '8bit'
|
||||||
|
|
||||||
|
if term == 'xterm-kitty':
|
||||||
|
return 'rgb'
|
||||||
|
elif term == 'linux':
|
||||||
|
return 'ansi'
|
||||||
|
|
||||||
|
if '256color' in term:
|
||||||
|
return 'rgb'
|
||||||
|
if 'color' in term:
|
||||||
|
return '8bit'
|
||||||
|
if 'ansi' in term:
|
||||||
|
return 'ansi'
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def windows_detect_ansi_mode() -> AnsiMode | None:
|
||||||
|
"""
|
||||||
|
Translated from Termenv's ColorProfile():
|
||||||
|
https://github.com/muesli/termenv/blob/42ca574de3e99a262e1724d2fb8daa1aea68a5b9/termenv_windows.go#L13
|
||||||
|
|
||||||
|
:return: Ansi mode
|
||||||
|
"""
|
||||||
|
if not sys.stdout.isatty():
|
||||||
|
return 'ansi'
|
||||||
|
|
||||||
|
if os.environ.get("ConEmuANSI") == "ON":
|
||||||
|
return 'rgb'
|
||||||
|
|
||||||
|
release, _, build = map(int, platform.version().split('.'))
|
||||||
|
if build < 10586 or release < 10:
|
||||||
|
# No ANSI support before Windows 10 build 10586.
|
||||||
|
if os.environ.get('ANSICON'):
|
||||||
|
conv = os.environ.get('ANSICON_VER')
|
||||||
|
if int(conv) < 181:
|
||||||
|
return 'ansi'
|
||||||
|
return '8bit'
|
||||||
|
return 'ansi'
|
||||||
|
|
||||||
|
if build < 14931:
|
||||||
|
# No true color support before build 14931.
|
||||||
|
return '8bit'
|
||||||
|
|
||||||
|
return 'rgb'
|
||||||
|
|
||||||
|
|
||||||
|
def detect_ansi_mode() -> AnsiMode | None:
|
||||||
|
system = platform.system().lower()
|
||||||
|
if system.startswith("linux") or system.startswith("darwin"):
|
||||||
|
return unix_detect_ansi_mode()
|
||||||
|
if system.startswith("windows"):
|
||||||
|
return windows_detect_ansi_mode()
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def unix_read_osc(seq: int) -> str:
|
||||||
|
# screen/tmux can't support OSC, because they can be connected to multiple
|
||||||
|
# terminals concurrently.
|
||||||
|
term = os.environ.get('TERM')
|
||||||
|
if term.startswith("screen") or term.startswith("tmux"):
|
||||||
|
raise OSCException("Screen/tmux not supported")
|
||||||
|
|
||||||
|
t = sys.stdout
|
||||||
|
if not t.isatty():
|
||||||
|
raise OSCException("Not a tty")
|
||||||
|
|
||||||
|
fd = sys.stdin.fileno()
|
||||||
|
|
||||||
|
# Set raw mode
|
||||||
|
settings = termios.tcgetattr(fd)
|
||||||
|
tty.setraw(sys.stdin.fileno())
|
||||||
|
|
||||||
|
# first, send OSC query, which is ignored by terminal which do not support it
|
||||||
|
t.write(f"\x1b]{seq};?\x1b\\")
|
||||||
|
t.flush()
|
||||||
|
|
||||||
|
# stdin response timeout should be higher for ssh sessions
|
||||||
|
timeout = 0.05 if (os.environ.get('SSH_TTY') or os.environ.get('SSH_SESSION')) is None else 0.5
|
||||||
|
|
||||||
|
# Wait for input to appear
|
||||||
|
if not select([sys.stdin], [], [], timeout)[0]:
|
||||||
|
raise OSCException("No response received")
|
||||||
|
|
||||||
|
# Read until termination, or if it doesn't terminate, read until 1 second passes
|
||||||
|
def handler(signum, frame):
|
||||||
|
raise IOError()
|
||||||
|
signal.signal(signal.SIGALRM, handler)
|
||||||
|
signal.setitimer(signal.ITIMER_REAL, timeout, 1)
|
||||||
|
code = ""
|
||||||
|
try:
|
||||||
|
for _ in range(28):
|
||||||
|
code += sys.stdin.read(1)
|
||||||
|
|
||||||
|
# Terminate with sequence terminator [\ or bell ^G
|
||||||
|
if code.endswith('\x1b\\') or code.endswith('\a'):
|
||||||
|
break
|
||||||
|
signal.alarm(0)
|
||||||
|
except IOError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# Reset terminal back to normal mode (previously set to raw mode)
|
||||||
|
termios.tcsetattr(fd, termios.TCSADRAIN, settings)
|
||||||
|
|
||||||
|
# Validate output
|
||||||
|
if not code:
|
||||||
|
raise OSCException("No response received")
|
||||||
|
|
||||||
|
start = f"\x1b]{seq};"
|
||||||
|
if not code.startswith(start):
|
||||||
|
raise OSCException("Received response is not an OSC response")
|
||||||
|
|
||||||
|
# Strip starting code and termination code
|
||||||
|
code = code.lstrip(start).rstrip("\x1b\\").rstrip('\a')
|
||||||
|
|
||||||
|
return code
|
||||||
|
|
||||||
|
|
||||||
|
def get_background_color() -> RGB | None:
|
||||||
|
try:
|
||||||
|
osc = unix_read_osc(11).lstrip("rgb:")
|
||||||
|
return RGB.from_hex(''.join([v[:2] for v in osc.split('/')]))
|
||||||
|
except Exception:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
version=7.3.1
|
version=7.3.4
|
||||||
|
|
||||||
# Fallback to a value of '5' for shells which support bash
|
# Fallback to a value of '5' for shells which support bash
|
||||||
# but do not set the 'BASH_' shell variables (osh).
|
# but do not set the 'BASH_' shell variables (osh).
|
||||||
@@ -174,20 +174,26 @@ uptime_shorthand="on"
|
|||||||
# Example:
|
# Example:
|
||||||
# on: '1801MiB / 7881MiB (22%)'
|
# on: '1801MiB / 7881MiB (22%)'
|
||||||
# off: '1801MiB / 7881MiB'
|
# off: '1801MiB / 7881MiB'
|
||||||
memory_percent="off"
|
memory_percent="on"
|
||||||
|
|
||||||
# Change memory output unit.
|
# Change memory output unit.
|
||||||
#
|
#
|
||||||
# Default: 'mib'
|
# Default: 'mib'
|
||||||
# Values: 'kib', 'mib', 'gib'
|
# Values: 'kib', 'mib', 'gib', 'tib'
|
||||||
# Flag: --memory_unit
|
# Flag: --memory_unit
|
||||||
#
|
#
|
||||||
# Example:
|
# Example:
|
||||||
# kib '1020928KiB / 7117824KiB'
|
# kib '1020928KiB / 7117824KiB'
|
||||||
# mib '1042MiB / 6951MiB'
|
# mib '1042MiB / 6951MiB'
|
||||||
# gib: ' 0.98GiB / 6.79GiB'
|
# gib: ' 0.98GiB / 6.79GiB'
|
||||||
memory_unit="mib"
|
memory_unit="gib"
|
||||||
|
|
||||||
|
# Change memory output precision.
|
||||||
|
#
|
||||||
|
# Default: '2'
|
||||||
|
# Values: integer ≥ 0
|
||||||
|
# Flag: --memory_precision
|
||||||
|
mem_precision=2
|
||||||
|
|
||||||
# Packages
|
# Packages
|
||||||
|
|
||||||
@@ -253,7 +259,7 @@ speed_type="bios_limit"
|
|||||||
# Example:
|
# Example:
|
||||||
# on: 'i7-6500U (4) @ 3.1GHz'
|
# on: 'i7-6500U (4) @ 3.1GHz'
|
||||||
# off: 'i7-6500U (4) @ 3.100GHz'
|
# off: 'i7-6500U (4) @ 3.100GHz'
|
||||||
speed_shorthand="off"
|
speed_shorthand="on"
|
||||||
|
|
||||||
# Enable/Disable CPU brand in output.
|
# Enable/Disable CPU brand in output.
|
||||||
#
|
#
|
||||||
@@ -356,7 +362,7 @@ gpu_type="all"
|
|||||||
# Example:
|
# Example:
|
||||||
# on: '1920x1080 @ 60Hz'
|
# on: '1920x1080 @ 60Hz'
|
||||||
# off: '1920x1080'
|
# off: '1920x1080'
|
||||||
refresh_rate="off"
|
refresh_rate="on"
|
||||||
|
|
||||||
|
|
||||||
# Gtk Theme / Icons / Font
|
# Gtk Theme / Icons / Font
|
||||||
@@ -799,39 +805,40 @@ image_source="auto"
|
|||||||
# Flag: --ascii_distro
|
# Flag: --ascii_distro
|
||||||
#
|
#
|
||||||
# NOTE: AIX, AlmaLinux, Alpine, Alter, Amazon, AmogOS, Anarchy, Android, Antergos, antiX, AOSC OS,
|
# NOTE: AIX, AlmaLinux, Alpine, Alter, Amazon, AmogOS, Anarchy, Android, Antergos, antiX, AOSC OS,
|
||||||
# AOSC OS/Retro, Aperio GNU/Linux, Apricity, Arch, ArchBox, Archcraft, ARCHlabs, ArchMerge,
|
# AOSC OS/Retro, Aperio GNU/Linux, Apricity, Arch, ArchBox, Archcraft, ARCHlabs, ArchStrike,
|
||||||
# ArchStrike, ArcoLinux, Artix, Arya, Asahi, AsteroidOS, astOS, Bedrock, BigLinux, Bitrig,
|
# ArcoLinux, Artix, Arya, Asahi, AsteroidOS, astOS, Bedrock, BigLinux, Bitrig, BlackArch,
|
||||||
# BlackArch, blackPanther, BLAG, BlankOn, BlueLight, Bodhi, bonsai, BSD, BunsenLabs, Cachy OS,
|
# blackPanther, BLAG, BlankOn, BlueLight, Bodhi, bonsai, BSD, BunsenLabs, Cachy OS, Calculate,
|
||||||
# Calculate, CalinixOS, Carbs, CBL-Mariner, CelOS, Center, CentOS, Chakra, ChaletOS, Chapeau,
|
# CalinixOS, Carbs, CBL-Mariner, CelOS, Center, CentOS, Chakra, ChaletOS, Chapeau, ChonkySealOS,
|
||||||
# ChonkySealOS, Chrom, Cleanjaro, Clear Linux OS, ClearOS, Clover, Condres, Container Linux by
|
# Chrom, Cleanjaro, Clear Linux OS, ClearOS, Clover, Cobalt, Condres, Container Linux by CoreOS,
|
||||||
# CoreOS, CRUX, Crystal Linux, Cucumber, CutefishOS, CyberOS, dahlia, DarkOs, Darwin, Debian,
|
# CRUX, Crystal Linux, Cucumber, CutefishOS, CyberOS, dahlia, DarkOs, Darwin, Debian, Deepin,
|
||||||
# Deepin, DesaOS, Devuan, DracOS, DragonFly, Drauger, Elementary, Elive, EncryptOS, EndeavourOS,
|
# DesaOS, Devuan, DietPi, DracOS, DragonFly, Drauger, Droidian, Elementary, Elive, EncryptOS,
|
||||||
# Endless, EuroLinux, Exherbo, Exodia Predator OS, Fedora, Feren, Finnix, FreeBSD, FreeMiNT,
|
# EndeavourOS, Endless, Enso, EuroLinux, Exherbo, Exodia Predator OS, Fedora, Feren, Finnix,
|
||||||
# Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus, gNewSense, GNOME, GNU,
|
# FreeBSD, FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus, gNewSense,
|
||||||
# GoboLinux, GrapheneOS, Grombyang, Guix, Haiku, HarDClanZ, Hash, Huayra, HydroOS, Hyperbola,
|
# GNOME, GNU, GoboLinux, GrapheneOS, Grombyang, Guix, Haiku, HamoniKR, HarDClanZ, Hash, Huayra,
|
||||||
# iglunix, instantOS, IRIX, Itc, januslinux, Kaisen, Kali, KaOS, KDE, Kibojoe, Kogaion, Korora,
|
# HydroOS, Hyperbola, iglunix, instantOS, IRIX, Itc, januslinux, Kaisen, Kali, KaOS, KDE, Kibojoe,
|
||||||
# KrassOS, KSLinux, Kubuntu, LangitKetujuh, LaxerOS, LEDE, LibreELEC, Linspire, Linux, Linux Lite,
|
# Kogaion, Korora, KrassOS, KSLinux, Kubuntu, LangitKetujuh, LaxerOS, LEDE, LibreELEC, Linspire,
|
||||||
# Linux Mint, Linux Mint Old, Live Raizo, LMDE, Lubuntu, Lunar, mac, Mageia, MagpieOS, Mandriva,
|
# Linux, Linux Lite, Linux Mint, Linux Mint Old, Live Raizo, LMDE, Lubuntu, Lunar, mac, Mageia,
|
||||||
# Manjaro, MassOS, MatuusOS, Maui, Mer, Minix, MIRACLE LINUX, MX, Namib, Neptune, NetBSD, Netrunner,
|
# MagpieOS, Mandriva, Manjaro, MassOS, MatuusOS, Maui, Mer, Minix, MIRACLE LINUX, MX, Namib,
|
||||||
# Nitrux, NixOS, NomadBSD, Nurunner, NuTyX, Obarun, OBRevenge, Open Source Media Center, OpenBSD,
|
# Neptune, NetBSD, Netrunner, Nitrux, NixOS, NomadBSD, Nurunner, NuTyX, Obarun, OBRevenge, OmniOS,
|
||||||
# openEuler, OpenIndiana, openmamba, OpenMandriva, OpenStage, openSUSE, openSUSE Leap, openSUSE
|
# Open Source Media Center, OpenBSD, openEuler, OpenIndiana, openmamba, OpenMandriva, OpenStage,
|
||||||
# Tumbleweed, OpenWrt, OPNsense, Oracle, orchid, OS Elbrus, PacBSD, Parabola, parch, Pardus, Parrot,
|
# openSUSE, openSUSE Leap, openSUSE Tumbleweed, OpenWrt, OPNsense, Oracle, orchid, OS Elbrus,
|
||||||
# Parsix, PCBSD, PCLinuxOS, pearOS, Pengwin, Pentoo, Peppermint, Pisi, PNM Linux, Pop!_OS, Porteus,
|
# PacBSD, Parabola, parch, Pardus, Parrot, Parsix, PCBSD, PCLinuxOS, pearOS, Pengwin, Pentoo,
|
||||||
# PostMarketOS, Profelis SambaBOX, Proxmox, PuffOS, Puppy, PureOS, Q4OS, Qubes, Qubyt, Quibian,
|
# Peppermint, Pisi, PNM Linux, Pop!_OS, Porteus, PostMarketOS, Profelis SambaBOX, Proxmox, PuffOS,
|
||||||
# Radix, Raspbian, ravynOS, Reborn OS, Red Star, Redcore, Redhat, Refracted Devuan, Regata,
|
# Puppy, PureOS, Q4OS, Qubes, Qubyt, Quibian, Radix, Raspbian, ravynOS, Reborn OS, Red Star,
|
||||||
# Regolith, rocky, Rosa, Sabayon, sabotage, Sailfish, SalentOS, Scientific, semc, Septor, Serene,
|
# Redcore, Redhat, Refracted Devuan, Regata, Regolith, rocky, Rosa, Sabayon, sabotage, Sailfish,
|
||||||
# SharkLinux, ShastraOS, Siduction, SkiffOS, Slackware, SliTaz, SmartOS, Soda, Solus, Source Mage,
|
# SalentOS, Scientific, semc, Septor, Serene, SharkLinux, ShastraOS, Siduction, SkiffOS, Slackware,
|
||||||
# Sparky, Star, SteamOS, Sulin, SunOS, SwagArch, t2, Tails, TeArch, TorizonCore, Trisquel, Twister,
|
# SliTaz, SmartOS, Soda, Solus, Source Mage, Sparky, Star, SteamOS, Stock Linux, Sulin, SunOS,
|
||||||
# Ubuntu, Ubuntu Budgie, Ubuntu Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu Studio, Ubuntu Sway,
|
# SwagArch, t2, Tails, TeArch, TorizonCore, Trisquel, Twister, Ubuntu, Ubuntu Budgie, Ubuntu
|
||||||
# Ubuntu Touch, Ubuntu-GNOME, ubuntu_old02, Ultramarine Linux, Univalent, Univention, Uos, uwuntu,
|
# Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu Studio, Ubuntu Sway, Ubuntu Touch, Ubuntu-GNOME,
|
||||||
# Venom, VNux, Void, VzLinux, wii-linux-ngx, Windows, Windows 10, Windows 11, XFerience, Xubuntu,
|
# ubuntu_old02, Ultramarine Linux, Univalent, Univention, Uos, uwuntu, Vanilla, Venom, VNux, Void,
|
||||||
# yiffOS, Zorin have ascii logos.
|
# VzLinux, wii-linux-ngx, Windows, Windows 10, Windows 11, XFerience, Xubuntu, yiffOS, Zorin have
|
||||||
|
# ascii logos.
|
||||||
|
|
||||||
# NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu have 'old' logo variants, use
|
# NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu have 'old' logo variants, use
|
||||||
# {distro}_old to use them.
|
# {distro}_old to use them.
|
||||||
|
|
||||||
# NOTE: alpine, android, aoscosretro, arch, arcolinux, artix, CalinixOS, centos, cleanjaro, crux,
|
# NOTE: alpine, android, aoscosretro, arch, arcolinux, artix, CalinixOS, centos, cleanjaro, crux,
|
||||||
# debian, dragonfly, elementary, fedora, freebsd, gentoo, guix, haiku, hyperbola, linuxlite,
|
# debian, dragonfly, elementary, fedora, freebsd, garuda, gentoo, guix, haiku, hyperbola, linuxlite,
|
||||||
# linuxmint, mac, mageia, manjaro, mx, netbsd, nixos, openbsd, opensuse, orchid, parabola, popos,
|
# linuxmint, mac, mageia, manjaro, mx, netbsd, nixos, openbsd, opensuse, orchid, parabola, popos,
|
||||||
# postmarketos, pureos, Raspbian, rocky, slackware, sunos, ubuntu, void have 'small' logo variants,
|
# postmarketos, pureos, Raspbian, rocky, slackware, sunos, ubuntu, void have 'small' logo variants,
|
||||||
# use {distro}_small to use them.
|
# use {distro}_small to use them.
|
||||||
@@ -940,11 +947,11 @@ background_color=
|
|||||||
# Misc Options
|
# Misc Options
|
||||||
|
|
||||||
# Stdout mode
|
# Stdout mode
|
||||||
# Turn off all colors and disables image backend (ASCII/Image).
|
# If enabled, turn off all colors and disables image backend (ASCII/Image).
|
||||||
# Useful for piping into another command.
|
# Useful for piping into another command.
|
||||||
# Default: 'off'
|
# Default: 'auto'
|
||||||
# Values: 'on', 'off'
|
# Values: 'auto', 'on', 'off'
|
||||||
stdout="off"
|
stdout="auto"
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# DETECT INFORMATION
|
# DETECT INFORMATION
|
||||||
@@ -954,7 +961,10 @@ get_os() {
|
|||||||
# just the output of "uname -s".
|
# just the output of "uname -s".
|
||||||
case $kernel_name in
|
case $kernel_name in
|
||||||
Darwin) os=$darwin_name ;;
|
Darwin) os=$darwin_name ;;
|
||||||
SunOS) os=Solaris ;;
|
SunOS) case $(uname -o 2>/dev/null) in
|
||||||
|
illumos) os=illumos ;;
|
||||||
|
*) os=Solaris ;;
|
||||||
|
esac ;;
|
||||||
Haiku) os=Haiku ;;
|
Haiku) os=Haiku ;;
|
||||||
MINIX) os=MINIX ;;
|
MINIX) os=MINIX ;;
|
||||||
AIX) os=AIX ;;
|
AIX) os=AIX ;;
|
||||||
@@ -1178,6 +1188,7 @@ get_distro() {
|
|||||||
distro=${distro/DragonFly/DragonFlyBSD}
|
distro=${distro/DragonFly/DragonFlyBSD}
|
||||||
|
|
||||||
# Workarounds for some BSD based distros.
|
# Workarounds for some BSD based distros.
|
||||||
|
[[ -f /etc/os-release ]] && distro=Enso
|
||||||
[[ -f /etc/pcbsd-lang ]] && distro=PCBSD
|
[[ -f /etc/pcbsd-lang ]] && distro=PCBSD
|
||||||
[[ -f /etc/trueos-lang ]] && distro=TrueOS
|
[[ -f /etc/trueos-lang ]] && distro=TrueOS
|
||||||
[[ -f /etc/pacbsd-release ]] && distro=PacBSD
|
[[ -f /etc/pacbsd-release ]] && distro=PacBSD
|
||||||
@@ -1272,7 +1283,7 @@ get_distro() {
|
|||||||
*) codename=macOS ;;
|
*) codename=macOS ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
distro="$codename $osx_version $osx_build"
|
distro="$codename $osx_version ($osx_build)"
|
||||||
|
|
||||||
case $distro_shorthand in
|
case $distro_shorthand in
|
||||||
on) distro=${distro/ ${osx_build}} ;;
|
on) distro=${distro/ ${osx_build}} ;;
|
||||||
@@ -1301,7 +1312,7 @@ get_distro() {
|
|||||||
distro=${distro/Microsoft }
|
distro=${distro/Microsoft }
|
||||||
;;
|
;;
|
||||||
|
|
||||||
Solaris)
|
Solaris|illumos)
|
||||||
case $distro_shorthand in
|
case $distro_shorthand in
|
||||||
on|tiny) distro=$(awk 'NR==1 {print $1,$3}' /etc/release) ;;
|
on|tiny) distro=$(awk 'NR==1 {print $1,$3}' /etc/release) ;;
|
||||||
*) distro=$(awk 'NR==1 {print $1,$2,$3}' /etc/release) ;;
|
*) distro=$(awk 'NR==1 {print $1,$2,$3}' /etc/release) ;;
|
||||||
@@ -1332,7 +1343,7 @@ get_distro() {
|
|||||||
|
|
||||||
# Get OS architecture.
|
# Get OS architecture.
|
||||||
case $os in
|
case $os in
|
||||||
Solaris|AIX|Haiku|IRIX|FreeMiNT|BSD)
|
Solaris|illumos|AIX|Haiku|IRIX|FreeMiNT|BSD)
|
||||||
machine_arch=$(uname -p)
|
machine_arch=$(uname -p)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -1577,7 +1588,7 @@ get_model() {
|
|||||||
model=${model/Model}
|
model=${model/Model}
|
||||||
;;
|
;;
|
||||||
|
|
||||||
Solaris)
|
Solaris|illumos)
|
||||||
model=$(prtconf -b | awk -F':' '/banner-name/ {printf $2}')
|
model=$(prtconf -b | awk -F':' '/banner-name/ {printf $2}')
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@@ -1616,7 +1627,18 @@ get_title() {
|
|||||||
user=${USER:-$(id -un || printf %s "${HOME/*\/}")}
|
user=${USER:-$(id -un || printf %s "${HOME/*\/}")}
|
||||||
|
|
||||||
case $title_fqdn in
|
case $title_fqdn in
|
||||||
on) hostname=$(hostname -f) ;;
|
on)
|
||||||
|
case $os in
|
||||||
|
illumos|Solaris)
|
||||||
|
hostname=$(hostname)
|
||||||
|
domainname=$(domainname)
|
||||||
|
[[ -n "$domainname" ]] && hostname+=".$domainname"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
hostname=$(hostname -f)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
hostname=${HOSTNAME:-$(hostname)}
|
hostname=${HOSTNAME:-$(hostname)}
|
||||||
hostname=${hostname%.*}
|
hostname=${hostname%.*}
|
||||||
@@ -1681,9 +1703,11 @@ get_uptime() {
|
|||||||
s=$((now - boot))
|
s=$((now - boot))
|
||||||
;;
|
;;
|
||||||
|
|
||||||
Solaris)
|
Solaris|illumos)
|
||||||
s=$(kstat -p unix:0:system_misc:snaptime | awk '{print $2}')
|
boot=$(kstat -p unix:0:system_misc:boot_time | awk '{print $2}')
|
||||||
s=${s/.*}
|
now=$(date +%s)
|
||||||
|
|
||||||
|
s=$((now - boot))
|
||||||
;;
|
;;
|
||||||
|
|
||||||
AIX|IRIX)
|
AIX|IRIX)
|
||||||
@@ -1783,7 +1807,7 @@ get_packages() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
case $os in
|
case $os in
|
||||||
Linux|BSD|"iPhone OS"|Solaris)
|
Linux|BSD|"iPhone OS"|Solaris|illumos)
|
||||||
# Package Manager Programs.
|
# Package Manager Programs.
|
||||||
has kiss && tot kiss l
|
has kiss && tot kiss l
|
||||||
has cpt-list && tot cpt-list
|
has cpt-list && tot cpt-list
|
||||||
@@ -1807,6 +1831,7 @@ get_packages() {
|
|||||||
has pacstall && tot pacstall -L
|
has pacstall && tot pacstall -L
|
||||||
has bulge && tot bulge list
|
has bulge && tot bulge list
|
||||||
has pm && tot pm list packages
|
has pm && tot pm list packages
|
||||||
|
has squirrel && tot cat /var/squirrel/repos/local/INDEX
|
||||||
|
|
||||||
# Using the dnf package cache is much faster than rpm.
|
# Using the dnf package cache is much faster than rpm.
|
||||||
if has dnf && type -p sqlite3 >/dev/null && [[ -f /var/cache/dnf/packages.db ]]; then
|
if has dnf && type -p sqlite3 >/dev/null && [[ -f /var/cache/dnf/packages.db ]]; then
|
||||||
@@ -1875,6 +1900,10 @@ get_packages() {
|
|||||||
((packages == 0)) &&
|
((packages == 0)) &&
|
||||||
has pkg && tot pkg list
|
has pkg && tot pkg list
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
illumos-*)
|
||||||
|
has pkg && tot pkg list
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# List these last as they accompany regular package managers.
|
# List these last as they accompany regular package managers.
|
||||||
@@ -2164,8 +2193,8 @@ get_de() {
|
|||||||
# TODO:
|
# TODO:
|
||||||
# - New config option + flag: --de_display_server on/off ?
|
# - New config option + flag: --de_display_server on/off ?
|
||||||
# - Add display of X11, Arcan and anything else relevant.
|
# - Add display of X11, Arcan and anything else relevant.
|
||||||
[[ $de && $WAYLAND_DISPLAY ]] &&
|
[[ $de ]] &&
|
||||||
de+=" (Wayland)"
|
de+=" (${XDG_SESSION_TYPE})"
|
||||||
|
|
||||||
de_run=1
|
de_run=1
|
||||||
}
|
}
|
||||||
@@ -2192,6 +2221,7 @@ get_wm() {
|
|||||||
-e asc \
|
-e asc \
|
||||||
-e clayland \
|
-e clayland \
|
||||||
-e dwc \
|
-e dwc \
|
||||||
|
-e dwl \
|
||||||
-e fireplace \
|
-e fireplace \
|
||||||
-e gnome-shell \
|
-e gnome-shell \
|
||||||
-e greenfield \
|
-e greenfield \
|
||||||
@@ -2495,32 +2525,65 @@ get_cpu() {
|
|||||||
[[ -z "$cpu" ]] && cpu="$(awk -F':' '/family/ {printf $2; exit}' "$cpu_file")"
|
[[ -z "$cpu" ]] && cpu="$(awk -F':' '/family/ {printf $2; exit}' "$cpu_file")"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"loongarch64")
|
|
||||||
cpu="$(awk -F':' '/Model/ {print $2; exit}' "$cpu_file")"
|
|
||||||
;;
|
|
||||||
|
|
||||||
"arm"* | "aarch64")
|
"arm"* | "aarch64")
|
||||||
if [[ $(trim "$ascii_distro") == Android* ]]; then
|
if [[ $(trim "$distro") == Android* ]]; then
|
||||||
# Android roms have modified cpuinfo that shows CPU model as a string
|
# Android roms have modified cpuinfo that shows CPU model as a string
|
||||||
cpu="$(awk -F '\\s*: | @' \
|
cpu="$(awk -F':' '/Hardware/ {print $2; exit}' "$cpu_file")"
|
||||||
'/model name|Hardware|Processor|^cpu model|chip type|^cpu type/ {
|
|
||||||
cpu=$2; if ($1 == "Hardware") exit } END { print cpu }' "$cpu_file")"
|
|
||||||
else
|
else
|
||||||
# ARM linux displays binary model code in cpuinfo, which needs to be decoded with lscpu
|
# ARM linux displays binary model code in cpuinfo, which needs to be decoded with lscpu
|
||||||
cpu="$(lscpu | awk -F': ' '/Vendor ID/ {print $2; exit}') $(lscpu | awk -F': ' '/Model name/ {print $2; exit}')"
|
if ! [[ -x "$(command -v python)" ]]; then
|
||||||
fi
|
cpu="$(lscpu | awk -F': ' '/Vendor ID/ {print $2; exit}' ) $(lscpu | awk -F': ' '/Model name/ {print $2; exit}')"
|
||||||
;;
|
else
|
||||||
|
# Sometimes there are multiple CPU models (e.g. RK3399 has 4 A53 and 2 A72 cores)
|
||||||
|
# However, I don't know how to implement this in awk, so I'll use python for now
|
||||||
|
read -r -d '' py_script << END
|
||||||
|
from subprocess import check_output
|
||||||
|
|
||||||
"riscv"*)
|
|
||||||
# This will fail to detect cpu on qemu
|
def find(lines, label):
|
||||||
cpu="$(awk -F': ' '/uarch/ {print $2; exit}' "$cpu_file")"
|
for ln in lines:
|
||||||
|
if ln.strip().startswith(label):
|
||||||
|
return ln.split(label)[-1].strip()
|
||||||
|
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
lscpu = check_output('lscpu').decode()
|
||||||
|
|
||||||
|
vendor_id = find(lscpu.split('\n'), 'Vendor ID:') or None
|
||||||
|
|
||||||
|
cpus = []
|
||||||
|
|
||||||
|
for model_desc in lscpu.split('Model name:'):
|
||||||
|
lines = model_desc.split('\n')
|
||||||
|
model = lines[0].strip()
|
||||||
|
cores = int(find(lines, 'Core(s) per socket:') or "-1")
|
||||||
|
cores *= int(find(lines, 'Socket(s):') or "1")
|
||||||
|
if cores == -1:
|
||||||
|
continue
|
||||||
|
|
||||||
|
mhz = float(find(lines, 'CPU max MHz:') or find(lines, 'CPU min MHz:') or "0")
|
||||||
|
speed = f'@ {mhz / 1000:.2f} GHz' if mhz > 0 else ''
|
||||||
|
|
||||||
|
cpus.append(f'{vendor_id} {model} ({cores}) {speed}')
|
||||||
|
|
||||||
|
print('\n'.join(cpus))
|
||||||
|
END
|
||||||
|
tmp_cpus=$(python -c "$py_script")
|
||||||
|
while IFS= read -r line; do
|
||||||
|
prin "${subtitle:+${subtitle}}" "$line"
|
||||||
|
done <<< "$tmp_cpus"
|
||||||
|
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# If cpu is not detected on a platform-specific bases, fallback to cpuinfo method
|
# If cpu is not detected on a platform-specific bases, fallback to cpuinfo method
|
||||||
[[ -z "$cpu" ]] && cpu="$(awk -F '\\s*: | @' \
|
[[ -z "$cpu" ]] && cpu="$(awk -F '\\s*: | @' '/model name|Model|uarch|Hardware|Processor|^cpu model|chip type|^cpu type/ { print $2; exit}' "$cpu_file")"
|
||||||
'/model name|Hardware|Processor|^cpu model|chip type|^cpu type/ {
|
[[ -z "$cpu" ]] && cpu="$(awk -F '\\s*: | @' '/Hardware/ {print $2; exit}' "$cpu_file")"
|
||||||
cpu=$2; if ($1 == "Hardware") exit } END { print cpu }' "$cpu_file")"
|
|
||||||
|
|
||||||
speed_dir="/sys/devices/system/cpu/cpu0/cpufreq"
|
speed_dir="/sys/devices/system/cpu/cpu0/cpufreq"
|
||||||
|
|
||||||
@@ -2694,7 +2757,7 @@ get_cpu() {
|
|||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Solaris")
|
"Solaris" | "illumos")
|
||||||
# Get CPU name.
|
# Get CPU name.
|
||||||
cpu="$(psrinfo -pv)"
|
cpu="$(psrinfo -pv)"
|
||||||
cpu="${cpu//*$'\n'}"
|
cpu="${cpu//*$'\n'}"
|
||||||
@@ -3059,30 +3122,13 @@ get_memory() {
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
"Mac OS X" | "macOS" | "iPhone OS")
|
"Mac OS X" | "macOS" | "iPhone OS")
|
||||||
if [[ $osx_version == 10.[4-5]* ]]; then
|
hw_pagesize="$(sysctl -n hw.pagesize)"
|
||||||
mem_total="$(system_profiler SPHardwareDataType | grep Memory:)"
|
mem_total="$(($(sysctl -n hw.memsize) / 1024 / 1024))"
|
||||||
mem_total="${mem_total/Memory\: /}"
|
pages_app="$(($(sysctl -n vm.page_pageable_internal_count) - $(sysctl -n vm.page_purgeable_count)))"
|
||||||
mem_total="${mem_total/ MB/}"
|
pages_wired="$(vm_stat | awk '/ wired/ { print $4 }')"
|
||||||
|
pages_compressed="$(vm_stat | awk '/ occupied/ { printf $5 }')"
|
||||||
mem_used="$(vm_stat | grep Pages\ active:)"
|
pages_compressed="${pages_compressed:-0}"
|
||||||
mem_used="${mem_used/Pages active\: /}"
|
mem_used="$(((pages_app + ${pages_wired//.} + ${pages_compressed//.}) * hw_pagesize / 1024 / 1024))"
|
||||||
mem_used="${mem_used/\./}"
|
|
||||||
|
|
||||||
pages_inactive=$(vm_stat | grep "Pages inactive")
|
|
||||||
pages_inactive=${pages_inactive/Pages inactive\: /}
|
|
||||||
pages_inactive=${pages_inactive/\./}
|
|
||||||
|
|
||||||
mem_used=$((mem_used + pages_inactive))
|
|
||||||
mem_used=$((mem_used * 4096 / 1048576))
|
|
||||||
else
|
|
||||||
hw_pagesize="$(sysctl -n hw.pagesize)"
|
|
||||||
mem_total="$(($(sysctl -n hw.memsize) / 1024 / 1024))"
|
|
||||||
pages_app="$(($(sysctl -n vm.page_pageable_internal_count) - $(sysctl -n vm.page_purgeable_count)))"
|
|
||||||
pages_wired="$(vm_stat | awk '/ wired/ { print $4 }')"
|
|
||||||
pages_compressed="$(vm_stat | awk '/ occupied/ { printf $5 }')"
|
|
||||||
pages_compressed="${pages_compressed:-0}"
|
|
||||||
mem_used="$(((pages_app + ${pages_wired//.} + ${pages_compressed//.}) * hw_pagesize / 1024 / 1024))"
|
|
||||||
fi
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"BSD" | "MINIX" | "ravynOS")
|
"BSD" | "MINIX" | "ravynOS")
|
||||||
@@ -3126,10 +3172,10 @@ get_memory() {
|
|||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Solaris" | "AIX")
|
"Solaris" | "illumos" | "AIX")
|
||||||
hw_pagesize="$(pagesize)"
|
hw_pagesize="$(pagesize)"
|
||||||
case $os in
|
case $os in
|
||||||
"Solaris")
|
"Solaris" | "illumos")
|
||||||
pages_total="$(kstat -p unix:0:system_pages:pagestotal | awk '{print $2}')"
|
pages_total="$(kstat -p unix:0:system_pages:pagestotal | awk '{print $2}')"
|
||||||
pages_free="$(kstat -p unix:0:system_pages:pagesfree | awk '{print $2}')"
|
pages_free="$(kstat -p unix:0:system_pages:pagesfree | awk '{print $2}')"
|
||||||
;;
|
;;
|
||||||
@@ -3173,27 +3219,51 @@ get_memory() {
|
|||||||
|
|
||||||
[[ "$memory_percent" == "on" ]] && ((mem_perc=mem_used * 100 / mem_total))
|
[[ "$memory_percent" == "on" ]] && ((mem_perc=mem_used * 100 / mem_total))
|
||||||
|
|
||||||
|
# Creates temp variables: memory_unit_divider, memory_unit_multiplier
|
||||||
|
memory_unit_divider=1
|
||||||
|
memory_unit_multiplier=1
|
||||||
|
|
||||||
|
# Keep a copy of the original megabyte values because progress bar need them
|
||||||
|
mu_mb="$mem_used"
|
||||||
|
mt_mb="$mem_total"
|
||||||
|
|
||||||
case $memory_unit in
|
case $memory_unit in
|
||||||
|
tib)
|
||||||
|
mem_label=TiB
|
||||||
|
memory_unit_divider=$((1024 * 1024))
|
||||||
|
;;
|
||||||
|
|
||||||
gib)
|
gib)
|
||||||
mem_used=$(awk '{printf "%.2f", $1 / $2}' <<< "$mem_used 1024")
|
|
||||||
mem_total=$(awk '{printf "%.2f", $1 / $2}' <<< "$mem_total 1024")
|
|
||||||
mem_label=GiB
|
mem_label=GiB
|
||||||
|
memory_unit_divider=1024
|
||||||
;;
|
;;
|
||||||
|
|
||||||
kib)
|
kib)
|
||||||
mem_used=$((mem_used * 1024))
|
|
||||||
mem_total=$((mem_total * 1024))
|
|
||||||
mem_label=KiB
|
mem_label=KiB
|
||||||
|
memory_unit_multiplier=1024
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
memory="${mem_used}${mem_label:-MiB} / ${mem_total}${mem_label:-MiB} ${mem_perc:+(${mem_perc}%)}"
|
# Uses temp variables from above: memory_unit_divider, memory_unit_multiplier
|
||||||
|
if test "$memory_unit_divider" -ge 1; then
|
||||||
|
printf -v mem_used "%'.*f" \
|
||||||
|
"${mem_precision}" \
|
||||||
|
$((mem_used / memory_unit_divider)).$((mem_used % memory_unit_divider))
|
||||||
|
printf -v mem_total "%'.*f" \
|
||||||
|
"${mem_precision}" \
|
||||||
|
$((mem_total / memory_unit_divider)).$((mem_total % memory_unit_divider))
|
||||||
|
elif test "$memory_unit_multiplier" -ge 1; then
|
||||||
|
mem_used=$((mem_used * memory_unit_multiplier))
|
||||||
|
mem_total=$((mem_total * memory_unit_multiplier))
|
||||||
|
fi
|
||||||
|
|
||||||
|
memory="${mem_used} ${mem_label:-MiB} / ${mem_total} ${mem_label:-MiB} ${mem_perc:+(${mem_perc}%)}"
|
||||||
|
|
||||||
# Bars.
|
# Bars.
|
||||||
case $memory_display in
|
case $memory_display in
|
||||||
"bar") memory="$(bar "${mem_used}" "${mem_total}")" ;;
|
"bar") memory="$(bar "${mu_mb}" "${mt_mb}")" ;;
|
||||||
"infobar") memory="${memory} $(bar "${mem_used}" "${mem_total}")" ;;
|
"infobar") memory="${memory} $(bar "${mu_mb}" "${mt_mb}")" ;;
|
||||||
"barinfo") memory="$(bar "${mem_used}" "${mem_total}")${info_color} ${memory}" ;;
|
"barinfo") memory="$(bar "${mu_mb}" "${mt_mb}")${info_color} ${memory}" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3233,9 +3303,7 @@ get_network() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done < <(sort -rn <<<"$networks" | uniq -c)
|
done < <(sort -rn <<<"$networks" | uniq -c)
|
||||||
if [ -z "$network" ]; then
|
if [ -n "$network" ]; then
|
||||||
network="None"
|
|
||||||
else
|
|
||||||
network="${network%; }"
|
network="${network%; }"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -3283,6 +3351,7 @@ get_song() {
|
|||||||
"strawberry"
|
"strawberry"
|
||||||
"tauonmb"
|
"tauonmb"
|
||||||
"tomahawk"
|
"tomahawk"
|
||||||
|
"tidal-hifi"
|
||||||
"vlc"
|
"vlc"
|
||||||
"xmms2d"
|
"xmms2d"
|
||||||
"xnoise"
|
"xnoise"
|
||||||
@@ -3335,6 +3404,7 @@ get_song() {
|
|||||||
"gogglesmm"*) get_song_dbus "gogglesmm" ;;
|
"gogglesmm"*) get_song_dbus "gogglesmm" ;;
|
||||||
"xnoise"*) get_song_dbus "xnoise" ;;
|
"xnoise"*) get_song_dbus "xnoise" ;;
|
||||||
"tauonmb"*) get_song_dbus "tauon" ;;
|
"tauonmb"*) get_song_dbus "tauon" ;;
|
||||||
|
"tidal-hifi"*) get_song_dbus "tidal-hifi" ;;
|
||||||
"olivia"*) get_song_dbus "olivia" ;;
|
"olivia"*) get_song_dbus "olivia" ;;
|
||||||
"exaile"*) get_song_dbus "exaile" ;;
|
"exaile"*) get_song_dbus "exaile" ;;
|
||||||
"netease-cloud-music"*) get_song_dbus "netease-cloud-music" ;;
|
"netease-cloud-music"*) get_song_dbus "netease-cloud-music" ;;
|
||||||
@@ -4469,7 +4539,7 @@ get_battery() {
|
|||||||
|
|
||||||
get_local_ip() {
|
get_local_ip() {
|
||||||
case $os in
|
case $os in
|
||||||
"Linux" | "BSD" | "Solaris" | "AIX" | "IRIX")
|
"Linux" | "BSD" | "Solaris" | "illumos" | "AIX" | "IRIX")
|
||||||
if [[ "${local_ip_interface[0]}" == "auto" ]]; then
|
if [[ "${local_ip_interface[0]}" == "auto" ]]; then
|
||||||
local_ip="$(ip route get 1 | awk -F'src' '{print $2; exit}')"
|
local_ip="$(ip route get 1 | awk -F'src' '{print $2; exit}')"
|
||||||
local_ip="${local_ip/uid*}"
|
local_ip="${local_ip/uid*}"
|
||||||
@@ -4601,8 +4671,13 @@ get_cols() {
|
|||||||
printf -v block_spaces "%${block_height}s"
|
printf -v block_spaces "%${block_height}s"
|
||||||
|
|
||||||
# Convert the spaces into rows of blocks.
|
# Convert the spaces into rows of blocks.
|
||||||
[[ "$blocks" ]] && cols+="${block_spaces// /${blocks}[mnl}"
|
if [[ $BASH_VERSION == 3* ]]; then
|
||||||
[[ "$blocks2" ]] && cols+="${block_spaces// /${blocks2}[mnl}"
|
[[ "$blocks" ]] && cols+="${block_spaces// /${blocks}[mnl}"
|
||||||
|
[[ "$blocks2" ]] && cols+="${block_spaces// /${blocks2}[mnl}"
|
||||||
|
else
|
||||||
|
[[ "$blocks" ]] && cols+="${block_spaces// /${blocks}\[mnl}"
|
||||||
|
[[ "$blocks2" ]] && cols+="${block_spaces// /${blocks2}\[mnl}"
|
||||||
|
fi
|
||||||
|
|
||||||
# Determine the horizontal offset of the blocks.
|
# Determine the horizontal offset of the blocks.
|
||||||
case $col_offset in
|
case $col_offset in
|
||||||
@@ -5751,7 +5826,8 @@ INFO:
|
|||||||
--song_format format Print the song data in a specific format (see config file).
|
--song_format format Print the song data in a specific format (see config file).
|
||||||
--song_shorthand on/off Print the Artist/Album/Title on separate lines.
|
--song_shorthand on/off Print the Artist/Album/Title on separate lines.
|
||||||
--memory_percent on/off Display memory percentage.
|
--memory_percent on/off Display memory percentage.
|
||||||
--memory_unit kib/mib/gib Memory output unit.
|
--memory_unit (k/m/g/t)ib Memory output unit.
|
||||||
|
--memory_precision integer Change memory output precision. (≥0, default=2)
|
||||||
--music_player player-name Manually specify a player to use.
|
--music_player player-name Manually specify a player to use.
|
||||||
Available values are listed in the config file
|
Available values are listed in the config file
|
||||||
|
|
||||||
@@ -5821,51 +5897,52 @@ ASCII:
|
|||||||
|
|
||||||
NOTE: AIX, AlmaLinux, Alpine, Alter, Amazon, AmogOS, Anarchy,
|
NOTE: AIX, AlmaLinux, Alpine, Alter, Amazon, AmogOS, Anarchy,
|
||||||
Android, Antergos, antiX, AOSC OS, AOSC OS/Retro, Aperio GNU/Linux,
|
Android, Antergos, antiX, AOSC OS, AOSC OS/Retro, Aperio GNU/Linux,
|
||||||
Apricity, Arch, ArchBox, Archcraft, ARCHlabs, ArchMerge, ArchStrike,
|
Apricity, Arch, ArchBox, Archcraft, ARCHlabs, ArchStrike, ArcoLinux,
|
||||||
ArcoLinux, Artix, Arya, Asahi, AsteroidOS, astOS, Bedrock, BigLinux,
|
Artix, Arya, Asahi, AsteroidOS, astOS, Bedrock, BigLinux, Bitrig,
|
||||||
Bitrig, BlackArch, blackPanther, BLAG, BlankOn, BlueLight, Bodhi,
|
BlackArch, blackPanther, BLAG, BlankOn, BlueLight, Bodhi, bonsai,
|
||||||
bonsai, BSD, BunsenLabs, Cachy OS, Calculate, CalinixOS, Carbs, CBL-
|
BSD, BunsenLabs, Cachy OS, Calculate, CalinixOS, Carbs, CBL-Mariner,
|
||||||
Mariner, CelOS, Center, CentOS, Chakra, ChaletOS, Chapeau,
|
CelOS, Center, CentOS, Chakra, ChaletOS, Chapeau, ChonkySealOS,
|
||||||
ChonkySealOS, Chrom, Cleanjaro, Clear Linux OS, ClearOS, Clover,
|
Chrom, Cleanjaro, Clear Linux OS, ClearOS, Clover, Cobalt, Condres,
|
||||||
Condres, Container Linux by CoreOS, CRUX, Crystal Linux, Cucumber,
|
Container Linux by CoreOS, CRUX, Crystal Linux, Cucumber,
|
||||||
CutefishOS, CyberOS, dahlia, DarkOs, Darwin, Debian, Deepin, DesaOS,
|
CutefishOS, CyberOS, dahlia, DarkOs, Darwin, Debian, Deepin, DesaOS,
|
||||||
Devuan, DracOS, DragonFly, Drauger, Elementary, Elive, EncryptOS,
|
Devuan, DietPi, DracOS, DragonFly, Drauger, Droidian, Elementary,
|
||||||
EndeavourOS, Endless, EuroLinux, Exherbo, Exodia Predator OS,
|
Elive, EncryptOS, EndeavourOS, Endless, Enso, EuroLinux, Exherbo,
|
||||||
Fedora, Feren, Finnix, FreeBSD, FreeMiNT, Frugalware, Funtoo,
|
Exodia Predator OS, Fedora, Feren, Finnix, FreeBSD, FreeMiNT,
|
||||||
GalliumOS, Garuda, Gentoo, GhostBSD, glaucus, gNewSense, GNOME, GNU,
|
Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus,
|
||||||
GoboLinux, GrapheneOS, Grombyang, Guix, Haiku, HarDClanZ, Hash,
|
gNewSense, GNOME, GNU, GoboLinux, GrapheneOS, Grombyang, Guix,
|
||||||
Huayra, HydroOS, Hyperbola, iglunix, instantOS, IRIX, Itc,
|
Haiku, HamoniKR, HarDClanZ, Hash, Huayra, HydroOS, Hyperbola,
|
||||||
januslinux, Kaisen, Kali, KaOS, KDE, Kibojoe, Kogaion, Korora,
|
iglunix, instantOS, IRIX, Itc, januslinux, Kaisen, Kali, KaOS, KDE,
|
||||||
KrassOS, KSLinux, Kubuntu, LangitKetujuh, LaxerOS, LEDE, LibreELEC,
|
Kibojoe, Kogaion, Korora, KrassOS, KSLinux, Kubuntu, LangitKetujuh,
|
||||||
Linspire, Linux, Linux Lite, Linux Mint, Linux Mint Old, Live Raizo,
|
LaxerOS, LEDE, LibreELEC, Linspire, Linux, Linux Lite, Linux Mint,
|
||||||
LMDE, Lubuntu, Lunar, mac, Mageia, MagpieOS, Mandriva, Manjaro,
|
Linux Mint Old, Live Raizo, LMDE, Lubuntu, Lunar, mac, Mageia,
|
||||||
MassOS, MatuusOS, Maui, Mer, Minix, MIRACLE LINUX, MX, Namib,
|
MagpieOS, Mandriva, Manjaro, MassOS, MatuusOS, Maui, Mer, Minix,
|
||||||
Neptune, NetBSD, Netrunner, Nitrux, NixOS, NomadBSD, Nurunner,
|
MIRACLE LINUX, MX, Namib, Neptune, NetBSD, Netrunner, Nitrux, NixOS,
|
||||||
NuTyX, Obarun, OBRevenge, Open Source Media Center, OpenBSD,
|
NomadBSD, Nurunner, NuTyX, Obarun, OBRevenge, OmniOS, Open Source
|
||||||
openEuler, OpenIndiana, openmamba, OpenMandriva, OpenStage,
|
Media Center, OpenBSD, openEuler, OpenIndiana, openmamba,
|
||||||
openSUSE, openSUSE Leap, openSUSE Tumbleweed, OpenWrt, OPNsense,
|
OpenMandriva, OpenStage, openSUSE, openSUSE Leap, openSUSE
|
||||||
Oracle, orchid, OS Elbrus, PacBSD, Parabola, parch, Pardus, Parrot,
|
Tumbleweed, OpenWrt, OPNsense, Oracle, orchid, OS Elbrus, PacBSD,
|
||||||
Parsix, PCBSD, PCLinuxOS, pearOS, Pengwin, Pentoo, Peppermint, Pisi,
|
Parabola, parch, Pardus, Parrot, Parsix, PCBSD, PCLinuxOS, pearOS,
|
||||||
PNM Linux, Pop!_OS, Porteus, PostMarketOS, Profelis SambaBOX,
|
Pengwin, Pentoo, Peppermint, Pisi, PNM Linux, Pop!_OS, Porteus,
|
||||||
Proxmox, PuffOS, Puppy, PureOS, Q4OS, Qubes, Qubyt, Quibian, Radix,
|
PostMarketOS, Profelis SambaBOX, Proxmox, PuffOS, Puppy, PureOS,
|
||||||
Raspbian, ravynOS, Reborn OS, Red Star, Redcore, Redhat, Refracted
|
Q4OS, Qubes, Qubyt, Quibian, Radix, Raspbian, ravynOS, Reborn OS,
|
||||||
Devuan, Regata, Regolith, rocky, Rosa, Sabayon, sabotage, Sailfish,
|
Red Star, Redcore, Redhat, Refracted Devuan, Regata, Regolith,
|
||||||
SalentOS, Scientific, semc, Septor, Serene, SharkLinux, ShastraOS,
|
rocky, Rosa, Sabayon, sabotage, Sailfish, SalentOS, Scientific,
|
||||||
Siduction, SkiffOS, Slackware, SliTaz, SmartOS, Soda, Solus, Source
|
semc, Septor, Serene, SharkLinux, ShastraOS, Siduction, SkiffOS,
|
||||||
Mage, Sparky, Star, SteamOS, Sulin, SunOS, SwagArch, t2, Tails,
|
Slackware, SliTaz, SmartOS, Soda, Solus, Source Mage, Sparky, Star,
|
||||||
TeArch, TorizonCore, Trisquel, Twister, Ubuntu, Ubuntu Budgie,
|
SteamOS, Stock Linux, Sulin, SunOS, SwagArch, t2, Tails, TeArch,
|
||||||
Ubuntu Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu Studio, Ubuntu
|
TorizonCore, Trisquel, Twister, Ubuntu, Ubuntu Budgie, Ubuntu
|
||||||
Sway, Ubuntu Touch, Ubuntu-GNOME, ubuntu_old02, Ultramarine Linux,
|
Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu Studio, Ubuntu Sway,
|
||||||
Univalent, Univention, Uos, uwuntu, Venom, VNux, Void, VzLinux, wii-
|
Ubuntu Touch, Ubuntu-GNOME, ubuntu_old02, Ultramarine Linux,
|
||||||
linux-ngx, Windows, Windows 10, Windows 11, XFerience, Xubuntu,
|
Univalent, Univention, Uos, uwuntu, Vanilla, Venom, VNux, Void,
|
||||||
yiffOS, Zorin have ascii logos.
|
VzLinux, wii-linux-ngx, Windows, Windows 10, Windows 11, XFerience,
|
||||||
|
Xubuntu, yiffOS, Zorin have ascii logos.
|
||||||
|
|
||||||
NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu
|
NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu
|
||||||
have 'old' logo variants, use {distro}_old to use them.
|
have 'old' logo variants, use {distro}_old to use them.
|
||||||
|
|
||||||
NOTE: alpine, android, aoscosretro, arch, arcolinux, artix,
|
NOTE: alpine, android, aoscosretro, arch, arcolinux, artix,
|
||||||
CalinixOS, centos, cleanjaro, crux, debian, dragonfly, elementary,
|
CalinixOS, centos, cleanjaro, crux, debian, dragonfly, elementary,
|
||||||
fedora, freebsd, gentoo, guix, haiku, hyperbola, linuxlite,
|
fedora, freebsd, garuda, gentoo, guix, haiku, hyperbola, linuxlite,
|
||||||
linuxmint, mac, mageia, manjaro, mx, netbsd, nixos, openbsd,
|
linuxmint, mac, mageia, manjaro, mx, netbsd, nixos, openbsd,
|
||||||
opensuse, orchid, parabola, popos, postmarketos, pureos, Raspbian,
|
opensuse, orchid, parabola, popos, postmarketos, pureos, Raspbian,
|
||||||
rocky, slackware, sunos, ubuntu, void have 'small' logo variants,
|
rocky, slackware, sunos, ubuntu, void have 'small' logo variants,
|
||||||
@@ -5904,7 +5981,10 @@ OTHER:
|
|||||||
--config none Launch the script without a config file
|
--config none Launch the script without a config file
|
||||||
--no_config Don't create the user config file.
|
--no_config Don't create the user config file.
|
||||||
--print_config Print the default config file to stdout.
|
--print_config Print the default config file to stdout.
|
||||||
--stdout Turn off all colors and disables any ASCII/image backend.
|
--stdout=on Turn off all colors and disables any ASCII/image backend.
|
||||||
|
--stdout=off Enable the colored output and ASCII/image backend
|
||||||
|
--stdout=auto Let the program decide basing on the output type (default behavior)
|
||||||
|
--stdout Equivalent to '--stdout=on', for backward compatibility
|
||||||
--help Print this text and exit
|
--help Print this text and exit
|
||||||
--version Show neofetch version
|
--version Show neofetch version
|
||||||
-v Display error messages.
|
-v Display error messages.
|
||||||
@@ -5966,6 +6046,7 @@ get_args() {
|
|||||||
"--music_player") music_player="$2" ;;
|
"--music_player") music_player="$2" ;;
|
||||||
"--memory_percent") memory_percent="$2" ;;
|
"--memory_percent") memory_percent="$2" ;;
|
||||||
"--memory_unit") memory_unit="$2" ;;
|
"--memory_unit") memory_unit="$2" ;;
|
||||||
|
"--memory_precision") mem_precision="$2" ;;
|
||||||
"--cpu_temp")
|
"--cpu_temp")
|
||||||
cpu_temp="$2"
|
cpu_temp="$2"
|
||||||
[[ "$cpu_temp" == "on" ]] && cpu_temp="C"
|
[[ "$cpu_temp" == "on" ]] && cpu_temp="C"
|
||||||
@@ -6102,6 +6183,9 @@ get_args() {
|
|||||||
;;
|
;;
|
||||||
"--no_config") no_config="on" ;;
|
"--no_config") no_config="on" ;;
|
||||||
"--stdout") stdout="on" ;;
|
"--stdout") stdout="on" ;;
|
||||||
|
"--stdout=on") stdout="on" ;;
|
||||||
|
"--stdout=off") stdout="off" ;;
|
||||||
|
"--stdout=auto") stdout="auto" ;;
|
||||||
"-v") verbose="on" ;;
|
"-v") verbose="on" ;;
|
||||||
"--print_config") printf '%s\n' "$config"; exit ;;
|
"--print_config") printf '%s\n' "$config"; exit ;;
|
||||||
"-vv") set -x; verbose="on" ;;
|
"-vv") set -x; verbose="on" ;;
|
||||||
@@ -6956,6 +7040,34 @@ ${c1} ``--:::::::-.`
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Stock Linux"*)
|
||||||
|
set_colors 4 7
|
||||||
|
read -rd '' ascii_data << 'EOF'
|
||||||
|
${c1}
|
||||||
|
|
||||||
|
#G5J5G#
|
||||||
|
&BPYJJJJJJJYPB&
|
||||||
|
&#G5JJJJJJY5YJJJJJJ5G#&
|
||||||
|
#G5YJJJJJY5G#& &#G5YJJJJJY5G#
|
||||||
|
BPYJJJJJJJ5B& &BPYJJJJJJYPB
|
||||||
|
JJJJJJJJJJY5G#& &BPYJJJJJ
|
||||||
|
JJJJJJJJJJJJJJY5G# &JJJJJ
|
||||||
|
PYJJJJJJJJJJJJJJJJYPB& GYJJJ
|
||||||
|
&BPYJJJJJJJJJJJJJJJJ5PB& &BP
|
||||||
|
#G5YJJJJJJJJJJJJJJJY5G#
|
||||||
|
PB& &BP5JJJJJJJJJJJJJJJJYPB&
|
||||||
|
JJJYG &BPYJJJJJJJJJJJJJJJJYP
|
||||||
|
JJJJJ& #G5YJJJJJJJJJJJJJJ
|
||||||
|
JJJJJYPB& &#G5YJJJJJJJJJJ
|
||||||
|
BPYJJJJJJYPB& &B5JJJJJJJYPB
|
||||||
|
#G5YJJJJJY5G#& &#G5YJJJJJY5G#
|
||||||
|
&#G5JJJJJJY5YJJJJJJ5G#&
|
||||||
|
&BPYJJJJJJJYPB&
|
||||||
|
#G5J5G#
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
"ArchMerge"*)
|
"ArchMerge"*)
|
||||||
set_colors 6 6 7 1
|
set_colors 6 6 7 1
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
@@ -7051,6 +7163,28 @@ ${c1} '
|
|||||||
'` `'
|
'` `'
|
||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Cobalt"*)
|
||||||
|
set_colors 33 33 59 31 8
|
||||||
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
${c1} ///
|
||||||
|
${c1} ,//////////////
|
||||||
|
${c1} ///////////////////////////////
|
||||||
|
${c1} ///////////////${c5}***********${c1}//////
|
||||||
|
////${c5}***********************${c1}/////
|
||||||
|
/////${c5}***********************${c1}////
|
||||||
|
//////${c5},,,,,,,,,,,,,,,,,,,,,,${c1}///
|
||||||
|
//////${c5},,,,,,,,,,,,,,,,,,,,,,,,,${c1}/////
|
||||||
|
/////${c5},,,,,,,,,,,,,,,,,,,,,,,,,,,,${c1}/////
|
||||||
|
${c4} *****${c3},,,,,,,,,,,,,,,,,,,,,,,,,,,,,${c4}*****
|
||||||
|
******${c3},,,,,,,,,,,,,,,,,,,,,,,,,,,,${c4}*****
|
||||||
|
*******${c3},,,,,,,,,,,,,,,,,,,,,,,,,${c4}******
|
||||||
|
*******${c3}......................${c4}*******
|
||||||
|
******${c3}....${c4}***********************
|
||||||
|
****************************
|
||||||
|
*****
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
"Arya"*)
|
"Arya"*)
|
||||||
set_colors 2 1
|
set_colors 2 1
|
||||||
@@ -8133,6 +8267,27 @@ ${c2} `Y$$
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Droidian"*)
|
||||||
|
set_colors 2 10
|
||||||
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
${c2} _,met$$$$$gg.
|
||||||
|
,g$$$$$$$$$$$$$$$$P.
|
||||||
|
,$$P' `$$$.
|
||||||
|
',$$P ,ggs. `$$b:
|
||||||
|
`d$$' ,$P"' ${c1}.${c2} $$$
|
||||||
|
$$P d$' ${c1},${c2} $$P
|
||||||
|
$$: $$. ${c1}-${c2} ,d$$'
|
||||||
|
$$; Y$b._ _,d$P'
|
||||||
|
Y$$. ${c1}`.${c2}`"Y$$$$P"'
|
||||||
|
${c2} `$$b ${c1}"-.__
|
||||||
|
${c2} `Y$$
|
||||||
|
`Y$$.
|
||||||
|
`$$b.
|
||||||
|
`Y$$b.
|
||||||
|
`"Y$b._
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
"Deepin"*)
|
"Deepin"*)
|
||||||
set_colors 2 7
|
set_colors 2 7
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
@@ -8200,6 +8355,31 @@ ${c1} ..,,;;;::;,..
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"DietPi"*)
|
||||||
|
set_colors 2 0
|
||||||
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
${c1} :=+******+- -+******+=:
|
||||||
|
=#-::-::::-=#:-#=-::::-::-#=
|
||||||
|
:%-::--==-::-%%-::-==--::-%:
|
||||||
|
+#-:::::=+++${c2}@@${c1}+++=-::::-#=
|
||||||
|
:#+-::::=%${c2}@@@@@${c1}=::::-+#:
|
||||||
|
=@%##%${c2}@@@@@@@@${c1}%##%@=
|
||||||
|
${c2} .#@@@@@@@@@@@@@@@@@@@@#.
|
||||||
|
%@@@@@@@@@@@@@@@@@@@@@@%
|
||||||
|
-@@@@@@@@@@@@@@@@@@@@@@@@:
|
||||||
|
.#@@@@@@@@@@%%%%%@@@@@@@@@@@#.
|
||||||
|
#@@@${c1}+-=*#%${c2}%%%%%%%%%${c1}%%#+--#${c2}@@@#
|
||||||
|
%@@%${c1}*. .:${c2}=*%%%%*${c1}=: .#${c2}@@@%
|
||||||
|
:%@@@${c1}#+=-:${c2}:-*%%%%+::${c1}:-=+%${c2}@@@%:
|
||||||
|
:@@@@%@%%%%@${c1}#${c2}#${c1}#${c2}%@%%%%@%@@@@.
|
||||||
|
+@@@@@@@@@${c1}%${c2}=*+${c1}%${c2}@%@@@@@@@@+
|
||||||
|
#@@@@@@@@@@@@@@@@@@@@@@#
|
||||||
|
-#@@@@@@@@@@@@@@@@@@#-
|
||||||
|
-*%@@@@@@@@@@%*-
|
||||||
|
.+%@@@@%+.
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
"DracOS"*)
|
"DracOS"*)
|
||||||
set_colors 1 7 3
|
set_colors 1 7 3
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
@@ -8469,6 +8649,32 @@ dMm `/++/-``/yNNh+/sdNMNddMm- mMd
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Enso"*)
|
||||||
|
set_colors 8 7
|
||||||
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
${c1}
|
||||||
|
.:--==--:.
|
||||||
|
:=*#%%%%%%%#####*+-.
|
||||||
|
.+%%%%%%%%%%%%###%%#*##*:
|
||||||
|
.*%%%%%%%%%#+==-==++*####*##-
|
||||||
|
=%%%%%%%#=: .-+**#***.
|
||||||
|
*%%%%%%#- ++*#**.
|
||||||
|
+%%%%%%+ -*+#**
|
||||||
|
:%%%%%%* .*+**=
|
||||||
|
*%%%%%%: --#*#
|
||||||
|
%%%%%%% +++#.
|
||||||
|
%%%%%%%. ++=*.
|
||||||
|
*%%%%%%+ .-+*+
|
||||||
|
:%%%%%%%- -:*+:
|
||||||
|
=%%%%%%%*. :.*+-
|
||||||
|
+%%%%%%%%*- :*=-
|
||||||
|
=%%%%%%%%%%#+=: =+=:
|
||||||
|
.+%%%%%%%%%%%%%. .-==:
|
||||||
|
.=#%%%%%%%%%%= ..:--:.
|
||||||
|
.-+#%%%%%+
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
"EuroLinux"*)
|
"EuroLinux"*)
|
||||||
set_colors 4 7
|
set_colors 4 7
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
@@ -8755,6 +8961,17 @@ o/:-...................................:
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"garuda_small")
|
||||||
|
set_colors 7 7 3 7 2 4
|
||||||
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
${c3} .----.
|
||||||
|
.' ${c6},${c3} '.
|
||||||
|
${c4} .' ${c6}'${c3}-----|
|
||||||
|
'${c5}. -----,
|
||||||
|
'.____.'
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
"Garuda"*)
|
"Garuda"*)
|
||||||
set_colors 7 7 3 7 2 4
|
set_colors 7 7 3 7 2 4
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
@@ -9060,6 +9277,37 @@ ${c3} MMMM${c4} .cOMMMMM|/MMMMM/`
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"HamoniKR"*)
|
||||||
|
set_colors 4 7 99 1 3 7
|
||||||
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
${c1}
|
||||||
|
cO0Ox.
|
||||||
|
.ldddddddo.
|
||||||
|
.lddddddddddo
|
||||||
|
'lddddddddddddc
|
||||||
|
,oddddddddddddd;
|
||||||
|
'ldddddddddddddo.
|
||||||
|
.oddddddddddddddc.
|
||||||
|
,dddddddddddddddo.
|
||||||
|
,ccoooooooocoddooo:
|
||||||
|
,cooooooooooooooooop ${c3} c000x.
|
||||||
|
${c1}.cooooooooooooooopcllll${c3} .cddddddo.
|
||||||
|
${c1}coooooooooooooop' .qlll.${c3} .ddoooooooo;
|
||||||
|
${c1}cooooooooooc; ${c3}'qlllp. .ddoooooooooo;
|
||||||
|
${c1}.cooooooc; ${c3}'lllbc...coooooooooooo;
|
||||||
|
${c1} .cooc' ${c3}.llllcoooooooooooooo.
|
||||||
|
.coooooooooooooop:
|
||||||
|
.coooooooooooooop'
|
||||||
|
.cooooooooooooop.
|
||||||
|
.cooooooooooooop.
|
||||||
|
.coooooooooooop.
|
||||||
|
.cooooooooooop.
|
||||||
|
.cooooooooop.
|
||||||
|
.cooooop'
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
"Huayra"*)
|
"Huayra"*)
|
||||||
set_colors 4 7
|
set_colors 4 7
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
@@ -9559,7 +9807,7 @@ EOF
|
|||||||
"LMDE"*)
|
"LMDE"*)
|
||||||
set_colors 2 7
|
set_colors 2 7
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
${c2} `.-::---..
|
${c2} `.-::---..
|
||||||
${c1} .:++++ooooosssoo:.
|
${c1} .:++++ooooosssoo:.
|
||||||
.+o++::. `.:oos+.
|
.+o++::. `.:oos+.
|
||||||
${c1} :oo:.` -+oo${c2}:
|
${c1} :oo:.` -+oo${c2}:
|
||||||
@@ -10430,6 +10678,22 @@ Q@@@@@ggg@@f@ @@@@@@L
|
|||||||
EOF
|
EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"OmniOS"*)
|
||||||
|
set_colors 15 3 8
|
||||||
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
${c1}
|
||||||
|
____ __ __ _ _ _
|
||||||
|
/ __ \ | \/ || \ | || |
|
||||||
|
| | | || || \| || |
|
||||||
|
| |__| || |\/| || , `${c2}_${c1}||${c2}_${c1}| ${c2}____${c1}
|
||||||
|
\____/ |_| |_||_|\${c2}/ __ \ / ___|
|
||||||
|
| | | ||(__
|
||||||
|
${c3}community${c2} | |__| | ___)|
|
||||||
|
${c3}edition${c2} \____/ |____/
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
"openbsd_small")
|
"openbsd_small")
|
||||||
set_colors 3 7 6 1 8
|
set_colors 3 7 6 1 8
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
@@ -13094,6 +13358,32 @@ ${c1} | (-- | |
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
"Vanilla"*)
|
||||||
|
set_colors 11 15
|
||||||
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
${c1}
|
||||||
|
.----:
|
||||||
|
.-------.
|
||||||
|
:---::----:
|
||||||
|
.----::-----.
|
||||||
|
......... :----::-----: ..:::-::::..
|
||||||
|
.-----------------::------------------:
|
||||||
|
----::-----------::----------::::---:
|
||||||
|
-----:::--------::-------:::-------
|
||||||
|
:------::::--::...:::::---------:
|
||||||
|
.---------::.. ..:---------.
|
||||||
|
.::-----::.. .::----::.
|
||||||
|
.:------:.......:-------:
|
||||||
|
.--------::::::::-:::-------.
|
||||||
|
.-------::-----.:-----::------.
|
||||||
|
-----::------: :------::-----
|
||||||
|
:--::--------: .-------::---:
|
||||||
|
:----------:: .:----------
|
||||||
|
|
||||||
|
EOF
|
||||||
|
;;
|
||||||
|
|
||||||
|
|
||||||
"Obarun"*)
|
"Obarun"*)
|
||||||
set_colors 6 6 7 1
|
set_colors 6 6 7 1
|
||||||
@@ -13492,6 +13782,12 @@ main() {
|
|||||||
get_distro
|
get_distro
|
||||||
get_bold
|
get_bold
|
||||||
get_distro_ascii
|
get_distro_ascii
|
||||||
|
|
||||||
|
# check if the output is a interactive terminal
|
||||||
|
[[ $stdout == auto ]] && {
|
||||||
|
[[ -t 1 ]] && stdout=off || stdout=on
|
||||||
|
}
|
||||||
|
|
||||||
[[ $stdout == on ]] && stdout
|
[[ $stdout == on ]] && stdout
|
||||||
|
|
||||||
# Minix doesn't support these sequences.
|
# Minix doesn't support these sequences.
|
||||||
|
|||||||
+55
-40
@@ -1,7 +1,7 @@
|
|||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.2.
|
||||||
.TH NEOFETCH "1" "September 2022" "Neofetch 7.3.1" "User Commands"
|
.TH NEOFETCH "1" "November 2022" "Neofetch 7.3.4" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
Neofetch \- manual page for Neofetch 7.3.1
|
Neofetch \- manual page for Neofetch 7.3.4
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B neofetch
|
.B neofetch
|
||||||
\fI\,func_name --option "value" --option "value"\/\fR
|
\fI\,func_name --option "value" --option "value"\/\fR
|
||||||
@@ -164,9 +164,12 @@ Print the Artist/Album/Title on separate lines.
|
|||||||
\fB\-\-memory_percent\fR on/off
|
\fB\-\-memory_percent\fR on/off
|
||||||
Display memory percentage.
|
Display memory percentage.
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-memory_unit\fR kib/mib/gib
|
\fB\-\-memory_unit\fR (k/m/g/t)ib
|
||||||
Memory output unit.
|
Memory output unit.
|
||||||
.TP
|
.TP
|
||||||
|
\fB\-\-memory_precision\fR integer
|
||||||
|
Change memory output precision. (???0, default=2)
|
||||||
|
.TP
|
||||||
\fB\-\-music_player\fR player\-name
|
\fB\-\-music_player\fR player\-name
|
||||||
Manually specify a player to use.
|
Manually specify a player to use.
|
||||||
Available values are listed in the config file
|
Available values are listed in the config file
|
||||||
@@ -303,49 +306,52 @@ Which Distro's ascii art to print
|
|||||||
.TP
|
.TP
|
||||||
NOTE: AIX, AlmaLinux, Alpine, Alter, Amazon, AmogOS, Anarchy,
|
NOTE: AIX, AlmaLinux, Alpine, Alter, Amazon, AmogOS, Anarchy,
|
||||||
Android, Antergos, antiX, AOSC OS, AOSC OS/Retro, Aperio GNU/Linux,
|
Android, Antergos, antiX, AOSC OS, AOSC OS/Retro, Aperio GNU/Linux,
|
||||||
Apricity, Arch, ArchBox, Archcraft, ARCHlabs, ArchMerge, ArchStrike,
|
Apricity, Arch, ArchBox, Archcraft, ARCHlabs, ArchStrike, ArcoLinux,
|
||||||
ArcoLinux, Artix, Arya, Asahi, AsteroidOS, astOS, Bedrock, BigLinux,
|
Artix, Arya, Asahi, AsteroidOS, astOS, Bedrock, BigLinux, Bitrig,
|
||||||
Bitrig, BlackArch, blackPanther, BLAG, BlankOn, BlueLight, Bodhi,
|
BlackArch, blackPanther, BLAG, BlankOn, BlueLight, Bodhi, bonsai,
|
||||||
bonsai, BSD, BunsenLabs, Cachy OS, Calculate, CalinixOS, Carbs, CBLMariner, CelOS, Center, CentOS, Chakra, ChaletOS, Chapeau,
|
BSD, BunsenLabs, Cachy OS, Calculate, CalinixOS, Carbs, CBL\-Mariner,
|
||||||
ChonkySealOS, Chrom, Cleanjaro, Clear Linux OS, ClearOS, Clover,
|
CelOS, Center, CentOS, Chakra, ChaletOS, Chapeau, ChonkySealOS,
|
||||||
Condres, Container Linux by CoreOS, CRUX, Crystal Linux, Cucumber,
|
Chrom, Cleanjaro, Clear Linux OS, ClearOS, Clover, Cobalt, Condres,
|
||||||
|
Container Linux by CoreOS, CRUX, Crystal Linux, Cucumber,
|
||||||
CutefishOS, CyberOS, dahlia, DarkOs, Darwin, Debian, Deepin, DesaOS,
|
CutefishOS, CyberOS, dahlia, DarkOs, Darwin, Debian, Deepin, DesaOS,
|
||||||
Devuan, DracOS, DragonFly, Drauger, Elementary, Elive, EncryptOS,
|
Devuan, DietPi, DracOS, DragonFly, Drauger, Droidian, Elementary,
|
||||||
EndeavourOS, Endless, EuroLinux, Exherbo, Exodia Predator OS,
|
Elive, EncryptOS, EndeavourOS, Endless, Enso, EuroLinux, Exherbo,
|
||||||
Fedora, Feren, Finnix, FreeBSD, FreeMiNT, Frugalware, Funtoo,
|
Exodia Predator OS, Fedora, Feren, Finnix, FreeBSD, FreeMiNT,
|
||||||
GalliumOS, Garuda, Gentoo, GhostBSD, glaucus, gNewSense, GNOME, GNU,
|
Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus,
|
||||||
GoboLinux, GrapheneOS, Grombyang, Guix, Haiku, HarDClanZ, Hash,
|
gNewSense, GNOME, GNU, GoboLinux, GrapheneOS, Grombyang, Guix,
|
||||||
Huayra, HydroOS, Hyperbola, iglunix, instantOS, IRIX, Itc,
|
Haiku, HamoniKR, HarDClanZ, Hash, Huayra, HydroOS, Hyperbola,
|
||||||
januslinux, Kaisen, Kali, KaOS, KDE, Kibojoe, Kogaion, Korora,
|
iglunix, instantOS, IRIX, Itc, januslinux, Kaisen, Kali, KaOS, KDE,
|
||||||
KrassOS, KSLinux, Kubuntu, LangitKetujuh, LaxerOS, LEDE, LibreELEC,
|
Kibojoe, Kogaion, Korora, KrassOS, KSLinux, Kubuntu, LangitKetujuh,
|
||||||
Linspire, Linux, Linux Lite, Linux Mint, Linux Mint Old, Live Raizo,
|
LaxerOS, LEDE, LibreELEC, Linspire, Linux, Linux Lite, Linux Mint,
|
||||||
LMDE, Lubuntu, Lunar, mac, Mageia, MagpieOS, Mandriva, Manjaro,
|
Linux Mint Old, Live Raizo, LMDE, Lubuntu, Lunar, mac, Mageia,
|
||||||
MassOS, MatuusOS, Maui, Mer, Minix, MIRACLE LINUX, MX, Namib,
|
MagpieOS, Mandriva, Manjaro, MassOS, MatuusOS, Maui, Mer, Minix,
|
||||||
Neptune, NetBSD, Netrunner, Nitrux, NixOS, NomadBSD, Nurunner,
|
MIRACLE LINUX, MX, Namib, Neptune, NetBSD, Netrunner, Nitrux, NixOS,
|
||||||
NuTyX, Obarun, OBRevenge, Open Source Media Center, OpenBSD,
|
NomadBSD, Nurunner, NuTyX, Obarun, OBRevenge, OmniOS, Open Source
|
||||||
openEuler, OpenIndiana, openmamba, OpenMandriva, OpenStage,
|
Media Center, OpenBSD, openEuler, OpenIndiana, openmamba,
|
||||||
openSUSE, openSUSE Leap, openSUSE Tumbleweed, OpenWrt, OPNsense,
|
OpenMandriva, OpenStage, openSUSE, openSUSE Leap, openSUSE
|
||||||
Oracle, orchid, OS Elbrus, PacBSD, Parabola, parch, Pardus, Parrot,
|
Tumbleweed, OpenWrt, OPNsense, Oracle, orchid, OS Elbrus, PacBSD,
|
||||||
Parsix, PCBSD, PCLinuxOS, pearOS, Pengwin, Pentoo, Peppermint, Pisi,
|
Parabola, parch, Pardus, Parrot, Parsix, PCBSD, PCLinuxOS, pearOS,
|
||||||
PNM Linux, Pop!_OS, Porteus, PostMarketOS, Profelis SambaBOX,
|
Pengwin, Pentoo, Peppermint, Pisi, PNM Linux, Pop!_OS, Porteus,
|
||||||
Proxmox, PuffOS, Puppy, PureOS, Q4OS, Qubes, Qubyt, Quibian, Radix,
|
PostMarketOS, Profelis SambaBOX, Proxmox, PuffOS, Puppy, PureOS,
|
||||||
Raspbian, ravynOS, Reborn OS, Red Star, Redcore, Redhat, Refracted
|
Q4OS, Qubes, Qubyt, Quibian, Radix, Raspbian, ravynOS, Reborn OS,
|
||||||
Devuan, Regata, Regolith, rocky, Rosa, Sabayon, sabotage, Sailfish,
|
Red Star, Redcore, Redhat, Refracted Devuan, Regata, Regolith,
|
||||||
SalentOS, Scientific, semc, Septor, Serene, SharkLinux, ShastraOS,
|
rocky, Rosa, Sabayon, sabotage, Sailfish, SalentOS, Scientific,
|
||||||
Siduction, SkiffOS, Slackware, SliTaz, SmartOS, Soda, Solus, Source
|
semc, Septor, Serene, SharkLinux, ShastraOS, Siduction, SkiffOS,
|
||||||
Mage, Sparky, Star, SteamOS, Sulin, SunOS, SwagArch, t2, Tails,
|
Slackware, SliTaz, SmartOS, Soda, Solus, Source Mage, Sparky, Star,
|
||||||
TeArch, TorizonCore, Trisquel, Twister, Ubuntu, Ubuntu Budgie,
|
SteamOS, Stock Linux, Sulin, SunOS, SwagArch, t2, Tails, TeArch,
|
||||||
Ubuntu Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu Studio, Ubuntu
|
TorizonCore, Trisquel, Twister, Ubuntu, Ubuntu Budgie, Ubuntu
|
||||||
Sway, Ubuntu Touch, Ubuntu\-GNOME, ubuntu_old02, Ultramarine Linux,
|
Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu Studio, Ubuntu Sway,
|
||||||
Univalent, Univention, Uos, uwuntu, Venom, VNux, Void, VzLinux, wiilinux\-ngx, Windows, Windows 10, Windows 11, XFerience, Xubuntu,
|
Ubuntu Touch, Ubuntu\-GNOME, ubuntu_old02, Ultramarine Linux,
|
||||||
yiffOS, Zorin have ascii logos.
|
Univalent, Univention, Uos, uwuntu, Vanilla, Venom, VNux, Void,
|
||||||
|
VzLinux, wii\-linux\-ngx, Windows, Windows 10, Windows 11, XFerience,
|
||||||
|
Xubuntu, yiffOS, Zorin have ascii logos.
|
||||||
.TP
|
.TP
|
||||||
NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu
|
NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu
|
||||||
have 'old' logo variants, use {distro}_old to use them.
|
have 'old' logo variants, use {distro}_old to use them.
|
||||||
.TP
|
.TP
|
||||||
NOTE: alpine, android, aoscosretro, arch, arcolinux, artix,
|
NOTE: alpine, android, aoscosretro, arch, arcolinux, artix,
|
||||||
CalinixOS, centos, cleanjaro, crux, debian, dragonfly, elementary,
|
CalinixOS, centos, cleanjaro, crux, debian, dragonfly, elementary,
|
||||||
fedora, freebsd, gentoo, guix, haiku, hyperbola, linuxlite,
|
fedora, freebsd, garuda, gentoo, guix, haiku, hyperbola, linuxlite,
|
||||||
linuxmint, mac, mageia, manjaro, mx, netbsd, nixos, openbsd,
|
linuxmint, mac, mageia, manjaro, mx, netbsd, nixos, openbsd,
|
||||||
opensuse, orchid, parabola, popos, postmarketos, pureos, Raspbian,
|
opensuse, orchid, parabola, popos, postmarketos, pureos, Raspbian,
|
||||||
rocky, slackware, sunos, ubuntu, void have 'small' logo variants,
|
rocky, slackware, sunos, ubuntu, void have 'small' logo variants,
|
||||||
@@ -412,9 +418,18 @@ Don't create the user config file.
|
|||||||
\fB\-\-print_config\fR
|
\fB\-\-print_config\fR
|
||||||
Print the default config file to stdout.
|
Print the default config file to stdout.
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-stdout\fR
|
\fB\-\-stdout\fR=\fI\,on\/\fR
|
||||||
Turn off all colors and disables any ASCII/image backend.
|
Turn off all colors and disables any ASCII/image backend.
|
||||||
.TP
|
.TP
|
||||||
|
\fB\-\-stdout\fR=\fI\,off\/\fR
|
||||||
|
Enable the colored output and ASCII/image backend
|
||||||
|
.TP
|
||||||
|
\fB\-\-stdout\fR=\fI\,auto\/\fR
|
||||||
|
Let the program decide basing on the output type (default behavior)
|
||||||
|
.TP
|
||||||
|
\fB\-\-stdout\fR
|
||||||
|
Equivalent to '\-\-stdout=on', for backward compatibility
|
||||||
|
.TP
|
||||||
\fB\-\-help\fR
|
\fB\-\-help\fR
|
||||||
Print this text and exit
|
Print this text and exit
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "neowofetch",
|
"name": "neowofetch",
|
||||||
"version": "1.4.1",
|
"version": "1.4.4",
|
||||||
"description": "Updated neofetch",
|
"description": "Updated neofetch",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import pathlib
|
|||||||
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
|
|
||||||
import hyfetch
|
import hyfetch.constants
|
||||||
|
|
||||||
# The directory containing this file
|
# The directory containing this file
|
||||||
HERE = pathlib.Path(__file__).parent
|
HERE = pathlib.Path(__file__).parent
|
||||||
@@ -14,7 +14,7 @@ README = (HERE / "README.md").read_text('utf-8')
|
|||||||
# This call to setup() does all the work
|
# This call to setup() does all the work
|
||||||
setup(
|
setup(
|
||||||
name="HyFetch",
|
name="HyFetch",
|
||||||
version=hyfetch.__version__,
|
version=hyfetch.constants.VERSION,
|
||||||
description="neofetch with flags <3",
|
description="neofetch with flags <3",
|
||||||
long_description=README,
|
long_description=README,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|||||||
@@ -0,0 +1,68 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import time
|
||||||
|
from dataclasses import dataclass
|
||||||
|
from pathlib import Path
|
||||||
|
from urllib.request import urlretrieve
|
||||||
|
|
||||||
|
from hyfetch.color_util import printc, color
|
||||||
|
from hyfetch.neofetch_util import term_size
|
||||||
|
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class Theme:
|
||||||
|
done_char: str
|
||||||
|
todo_char: str
|
||||||
|
prefix: str = ''
|
||||||
|
suffix: str = ''
|
||||||
|
done_len: int = 1
|
||||||
|
todo_len: int = 1
|
||||||
|
|
||||||
|
|
||||||
|
CLASSIC_THEME = Theme('█', '.', '[', ']')
|
||||||
|
NEW_THEME = Theme('&a━', '&c━')
|
||||||
|
EMOJI_THEME = Theme('✅', '🕑', done_len=2, todo_len=2)
|
||||||
|
EGG_THEME = Theme('🐣', '🥚', done_len=2, todo_len=2)
|
||||||
|
FLOWER_THEME = Theme('🌸', '🥀', done_len=2, todo_len=2)
|
||||||
|
|
||||||
|
|
||||||
|
def print_progressbar(total: int, i: int, length: int | None = None, theme: Theme = EMOJI_THEME, unit=''):
|
||||||
|
if not length:
|
||||||
|
length = term_size()[0]
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
completed = f'{i * 100 / total:.0f}%'
|
||||||
|
placeholder = 'PLACEHOLDER_BAR'
|
||||||
|
template = f'{theme.prefix}{placeholder}{theme.suffix}&r {completed} {i}/{total}{unit}'
|
||||||
|
|
||||||
|
length -= len(template) - len(placeholder) + 2
|
||||||
|
|
||||||
|
progress = int(i / total * length)
|
||||||
|
bar = f'{theme.done_char * (progress // theme.todo_len)}{theme.todo_char * ((length - progress) // theme.done_len)}'
|
||||||
|
print(color(template.replace(placeholder, bar)), end='\r', flush=True)
|
||||||
|
|
||||||
|
|
||||||
|
def download_pbar(url: str, path: Path):
|
||||||
|
def hook(b: int, bsize: int, tsize: int):
|
||||||
|
print_progressbar(tsize // 1024 // 1024, b * bsize // 1024 // 1024, unit=' MB')
|
||||||
|
|
||||||
|
if path.is_dir():
|
||||||
|
filename = url.split('/')[-1]
|
||||||
|
path = path / filename
|
||||||
|
path.parent.mkdir(exist_ok=True, parents=True)
|
||||||
|
|
||||||
|
urlretrieve(url, filename=path, reporthook=hook)
|
||||||
|
print()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
# theme = {'emoji': EMOJI_THEME, 'flower': FLOWER_THEME, 'egg': EGG_THEME, 'classic': CLASSIC_THEME, 'new': NEW_THEME}
|
||||||
|
#
|
||||||
|
# for name, t in theme.items():
|
||||||
|
# print(f'\n{name} theme:')
|
||||||
|
# for i in range(100):
|
||||||
|
# print_progressbar(100, i, theme=t)
|
||||||
|
# time.sleep(0.015)
|
||||||
|
# print()
|
||||||
|
download_pbar('https://github.com/git-for-windows/git/releases/download/v2.37.2.windows.2/MinGit-2.37.2.2-busybox-64-bit.zip', Path('Downloads'))
|
||||||
@@ -124,6 +124,7 @@ def create_release(v: str):
|
|||||||
# 4. Push
|
# 4. Push
|
||||||
print('Pushing commits...')
|
print('Pushing commits...')
|
||||||
subprocess.check_call(['git', 'push'])
|
subprocess.check_call(['git', 'push'])
|
||||||
|
subprocess.check_call(['git', 'push', 'origin', v])
|
||||||
|
|
||||||
|
|
||||||
def deploy():
|
def deploy():
|
||||||
@@ -131,7 +132,7 @@ def deploy():
|
|||||||
Deploy release to pip and npm
|
Deploy release to pip and npm
|
||||||
"""
|
"""
|
||||||
print('Deploying to pypi...')
|
print('Deploying to pypi...')
|
||||||
subprocess.check_call(['bash', './deploy.sh'])
|
subprocess.check_call(['bash', 'tools/deploy.sh'])
|
||||||
print('Done!')
|
print('Done!')
|
||||||
|
|
||||||
print('Deploying to npm...')
|
print('Deploying to npm...')
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
# Pull request that I don't plan on merging, or already merged pull request that the script didn't
|
# Pull request that I don't plan on merging, or already merged pull request that the script didn't
|
||||||
# detect.
|
# detect.
|
||||||
IgnoreList:
|
IgnoreList:
|
||||||
|
# [2193] Added DietPi os ASCII art
|
||||||
|
2193: duplicate
|
||||||
# [2154] Added Support for Uwuntu
|
# [2154] Added Support for Uwuntu
|
||||||
2154: merged
|
2154: merged
|
||||||
# [2156] Update neofetch (for macOS 13)
|
# [2156] Update neofetch (for macOS 13)
|
||||||
|
|||||||
Reference in New Issue
Block a user