Compare commits
70 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| df11c756dd | |||
| 5f066e4ebf | |||
| ca3c887b61 | |||
| fac90ec5d3 | |||
| 4cb65c468c | |||
| 0693d6e316 | |||
| 2a312d0a7b | |||
| 8f628bb37b | |||
| 503251cbce | |||
| a37ee211f2 | |||
| 0ac2ffbba5 | |||
| dd950092a6 | |||
| bd8066407e | |||
| 6be684c26f | |||
| dba600cc89 | |||
| cdbf8a6b24 | |||
| a437957702 | |||
| bf5276bcc4 | |||
| 11f4242598 | |||
| dfe77dea5f | |||
| c47d80ae1d | |||
| 83ba569fde | |||
| 73fc473ae3 | |||
| 625f48168b | |||
| 9914ff2a55 | |||
| f20e80375a | |||
| b8ec68a943 | |||
| 1f7f76e078 | |||
| e288da8de2 | |||
| a72a49da13 | |||
| 24e1ed4617 | |||
| 01f65d91b5 | |||
| 953a09b686 | |||
| fe31b5bf34 | |||
| bf0c20b188 | |||
| c9ed3e1789 | |||
| 6d1359d8e9 | |||
| 219a7c48cc | |||
| 3b1e1385cc | |||
| c6453e2137 | |||
| 200c1a6d53 | |||
| 4225a0c453 | |||
| 4fe0890f21 | |||
| 857037fa37 | |||
| b7b2322346 | |||
| ac27543cd8 | |||
| c40cb09409 | |||
| 365abe2c80 | |||
| 2007c7c01e | |||
| 9747856f15 | |||
| 8104cd822a | |||
| 2d1abc8e30 | |||
| afb7092667 | |||
| 4a16cfec9b | |||
| 9acc0c0719 | |||
| 1315d0b2a7 | |||
| 331deaf293 | |||
| 3a1ac3e25a | |||
| a6a17d102c | |||
| 9605e4036f | |||
| 088e0d484b | |||
| 9b7756c5ae | |||
| 5c22c75f72 | |||
| bac650c84a | |||
| cbe8906073 | |||
| faa1cca154 | |||
| 8ef39ffcbf | |||
| 6778fd42a5 | |||
| 4e5f51b2a2 | |||
| 1d49e6109c |
@@ -1,20 +0,0 @@
|
||||
## Description
|
||||
|
||||
If you're suggesting a new feature then just a description will suffice.
|
||||
|
||||
- [ ] Does this issue still occur in the master branch? (**Required if issue**)
|
||||
|
||||
|
||||
#### Neofetch version
|
||||
|
||||
## Screenshot
|
||||
|
||||
## Config file
|
||||
|
||||
## Verbose log
|
||||
|
||||
1. Run `neofetch -vv 2> neofetchlog`
|
||||
2. Upload the contents of `neofetchlog` to pastebin, gist or equivalent.
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
name: Content Request
|
||||
about: Suggest supporting new flags, distros, package managers, etc.
|
||||
title: ''
|
||||
labels: 'content-request'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
### Describe the content
|
||||
Describe the content you would like to see added to HyFetch.
|
||||
|
||||
### Links
|
||||
Please include relevant links to the content.
|
||||
|
||||
e.g. For distros, include a link to the distro's official website, download link, or development repository.
|
||||
|
||||
### Additional context
|
||||
Add any other context about the problem here.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature Request
|
||||
about: Suggest a new idea for this project
|
||||
title: ''
|
||||
labels: 'feature-request'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
name: HyFetch Bug Report
|
||||
about: Create a report for coloring related bugs.
|
||||
title: ''
|
||||
labels: 'hyfetch'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
### Describe the bug
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
- [ ] Does this issue still occur in the master branch? (**Required**)
|
||||
|
||||
### Expected behavior
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
### Screenshots
|
||||
Please include a screenshot of your system information if the specific system environment is relevant to the bug.
|
||||
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
### Config file
|
||||
|
||||
Please paste the content of `~/.config/hyfetch.json` below:
|
||||
|
||||
```json
|
||||
"(here)"
|
||||
```
|
||||
|
||||
### Additional context
|
||||
Add any other context about the problem here.
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
name: Neofetch Bug Report
|
||||
about: Create a report for system-information related bugs.
|
||||
title: ''
|
||||
labels: 'neofetch'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
### Describe the bug
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
- [ ] Does this issue still occur in the master branch? (**Required**)
|
||||
|
||||
### Expected behavior
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
### Screenshots
|
||||
Please include a screenshot of your system information if the specific system environment is relevant to the bug.
|
||||
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
### Config file
|
||||
1. Run `cp ~/.config/neofetch/config.conf conf.txt`
|
||||
2. Drag `conf.txt` here to upload it.
|
||||
|
||||
### Verbose log
|
||||
1. Run `neofetch -vv 2> neofetch.log`
|
||||
2. Drag `neofetch.log` here to upload it.
|
||||
|
||||
### Additional context
|
||||
Add any other context about the problem here.
|
||||
@@ -1,10 +1,18 @@
|
||||
## Description
|
||||
|
||||
Only fill in the fields below if relevant.
|
||||
<!-- Thank you so much for contributing! ❤️ -->
|
||||
|
||||
### Description
|
||||
Describe the goals that the pull request accomplishes.
|
||||
|
||||
## Features
|
||||
### Relevant Links
|
||||
If there are related issues, please link them here.
|
||||
|
||||
## Issues
|
||||
Please also include links relevant to the changes.
|
||||
|
||||
## TODO
|
||||
e.g. For new distros, include a link to the distro's official website, download link, or development repository.
|
||||
|
||||
### Screenshots
|
||||
If applicable, please include screenshots before and after your changes.
|
||||
|
||||
### Additional context
|
||||
Add any other context about the problem or changes here.
|
||||
|
||||
+5
-1
@@ -115,4 +115,8 @@ dmypy.json
|
||||
|
||||
# Custom
|
||||
.idea
|
||||
._*
|
||||
._*
|
||||
webhook-log
|
||||
start_moderation.sh
|
||||
gh_moderator.toml
|
||||
moderator-data
|
||||
|
||||
@@ -32,6 +32,7 @@ Currently, these distributions have existing packages for HyFetch:
|
||||
* Nix: `nix-env -i hyfetch` (Thanks to [@YisuiDenghua](https://github.com/YisuiDenghua))
|
||||
* Guix: `guix install hyfetch` (Thanks to [@WammKD](https://github.com/WammKD))
|
||||
* Slackware `sbopkg -b hyfetch` Slackware [Slackbuild](https://slackbuilds.org/repository/15.0/desktop/hyfetch/?search=hyfetch) (Thanks to [@bittin](https://github.com/bittin) and Urchlay)
|
||||
* Nix Profile `nix profile install nixpkgs#hyfetch`
|
||||
|
||||
|
||||
### Method 3: Install the latest developmental version using git
|
||||
@@ -89,7 +90,6 @@ Updates to `neowofetch` begins with the emoji 🖼️
|
||||
|
||||
* [ ] (Important!) Refactor flag storage & coloring to support non-stride patterns
|
||||
* [ ] Config menu: Allow left-right arrow keys for pagination
|
||||
* [ ] Neofetch argument pass through
|
||||
|
||||
### Nightly
|
||||
|
||||
@@ -101,14 +101,34 @@ pip install git+https://github.com/hykilpikonna/hyfetch.git@master
|
||||
|
||||
<!-- CHANGELOG STARTS HERE --->
|
||||
|
||||
### 1.4.9
|
||||
|
||||
* 🌈 Add pride month easter-egg animation! ⭐️
|
||||
* 🌈 Autocompletion for bash, zsh, tcsh ([#96](https://github.com/hykilpikonna/hyfetch/pull/96))
|
||||
* 🌈 Add nix profile installation method ([#114](https://github.com/hykilpikonna/hyfetch/pull/114))
|
||||
* 🌈 Add experimental color overlay function for more accurate lightness adjusting (using `--c-overlay`)
|
||||
* 🌈 Allow neofetch argument passthrough (using `--args='...'`)
|
||||
* 🌈 Show recommended terminal size ([#129](https://github.com/hykilpikonna/hyfetch/pull/129))
|
||||
* 🌈 Update issue & pull request templates
|
||||
* 🖼 Hostname - Fix FQDN substitution
|
||||
* 🖼 Version - Fix Windows version detection ([dylanaraps#2309](https://github.com/dylanaraps/neofetch/pull/2309))
|
||||
* 🖼 Packages - Fix winget stuck on agreement ([#82](https://github.com/hykilpikonna/hyfetch/pull/82))
|
||||
* 🖼 Distro - Fix Windows text encoding ([#115](https://github.com/hykilpikonna/hyfetch/pull/115))
|
||||
* 🖼 Distro - Add Astra Linux ([dylanaraps#2313](https://github.com/dylanaraps/neofetch/pull/2313))
|
||||
* 🖼 Distro - Add FemboyOS ([#121](https://github.com/hykilpikonna/hyfetch/pull/121))
|
||||
* 🖼 Distro - Add Nobara Linux ([dylanaraps#2326](https://github.com/dylanaraps/neofetch/pull/2326))
|
||||
* 🖼 Font - Fix Konsole ppid detection ([#116](https://github.com/hykilpikonna/hyfetch/pull/116))
|
||||
* 🖼 Font - Fix Konsole terminal font detection ([#127](https://github.com/hykilpikonna/hyfetch/pull/127))
|
||||
* 🖼 Image - Optimize sixel image display ([dylanaraps#2316](https://github.com/dylanaraps/neofetch/pull/2316))
|
||||
|
||||
### 1.4.8
|
||||
|
||||
* 🌈 Improved Windows git bash detection ([#99](https://github.com/hykilpikonna/hyfetch/pull/99))
|
||||
* 🌈 Improved color formatting codes ([#101](https://github.com/hykilpikonna/hyfetch/pull/101))
|
||||
* 🌈 Allow specifying distro in config ([#102](https://github.com/hykilpikonna/hyfetch/pull/102))
|
||||
* 🌈 Allow specifying custom ascii files ([#104](https://github.com/hykilpikonna/hyfetch/pull/104))
|
||||
* 🌈 Add omniromantic and pangender ([#106](https://github.com/hykilpikonna/hyfetch/pull/106))
|
||||
* 🌈 Now officially packaged for ArchLinux Community & Slackware! ([#112](https://github.com/hykilpikonna/hyfetch/pull/112)) ([#109](https://github.com/hykilpikonna/hyfetch/pull/109))
|
||||
* 🌈 Add omniromantic and pangender flags ([#106](https://github.com/hykilpikonna/hyfetch/pull/106))
|
||||
* 🌈 Now officially packaged for ArchLinux Community & Slackware! ([#112](https://github.com/hykilpikonna/hyfetch/pull/112) | [#109](https://github.com/hykilpikonna/hyfetch/pull/109))
|
||||
* 🖼 Host - Update Apple device model detection. ([#111](https://github.com/hykilpikonna/hyfetch/pull/111))
|
||||
* 🖼 Distro - Add Salient OS. ([dylanaraps#2301](https://github.com/dylanaraps/neofetch/pull/2301))
|
||||
* 🖼 Distro - Add PikaOS. ([#105](https://github.com/hykilpikonna/hyfetch/pull/105))
|
||||
|
||||
@@ -1 +1 @@
|
||||
VERSION = '1.4.8'
|
||||
VERSION = '1.4.9'
|
||||
|
||||
@@ -239,3 +239,13 @@ class RGB:
|
||||
|
||||
def is_light(self):
|
||||
return self.hsl().l > 0.5
|
||||
|
||||
def overlay(self, color: 'RGB', alpha: float) -> 'RGB':
|
||||
"""
|
||||
Overlay a color on top of this color
|
||||
|
||||
:param color: Overlay color
|
||||
:param alpha: Overlay alpha
|
||||
:return: New color (original isn't modified)
|
||||
"""
|
||||
return RGB(*[round((1 - alpha) * v1 + alpha * v2) for v1, v2 in zip(self, color)])
|
||||
|
||||
@@ -35,6 +35,7 @@ class GlobalConfig:
|
||||
override_distro: str | None
|
||||
debug: bool
|
||||
is_light: bool
|
||||
use_overlay: bool
|
||||
|
||||
def light_dark(self) -> LightDark:
|
||||
return 'light' if self.is_light else 'dark'
|
||||
@@ -45,6 +46,6 @@ class GlobalConfig:
|
||||
return 0.65 if term.lower() == 'dark' else 0.4
|
||||
|
||||
|
||||
GLOBAL_CFG = GlobalConfig(color_mode='8bit', override_distro=None, debug=False, is_light=False)
|
||||
GLOBAL_CFG = GlobalConfig(color_mode='8bit', override_distro=None, debug=False, is_light=False, use_overlay=False)
|
||||
|
||||
MINGIT_URL = 'https://github.com/git-for-windows/git/releases/download/v2.37.2.windows.2/MinGit-2.37.2.2-busybox-32-bit.zip'
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
astra_linux = AsciiArt(match=r'''"Astra Linux"*''', color='160 231', ascii=r"""
|
||||
${c1} AA
|
||||
${c1} AaaA
|
||||
${c1} Aa${c2}/\${c1}aA
|
||||
${c1} Aa${c2}/${c1}aa${c2}\${c1}aA
|
||||
${c1} Aa${c2}/${c1}aAAa${c2}\${c1}aA
|
||||
${c1} aA${c2}/${c1}aaAAaa${c2}\${c1}Aa
|
||||
${c1} aA${c2}/${c1}aaAAAAaa${c2}\${c1}Aa
|
||||
${c1} aaaaaaAAAAa${c2}/${c1}aaAAAAAAaa${c2}\${c1}aAAAAaaaaa
|
||||
${c1} aAAa${c2}-----${c1}aaaaaAAAAAAAAAAaaaaa${c2}-----${c1}aAAa
|
||||
${c1} aAA${c2}\ ${c1}aAAAAAAAAAAAAAAAAAAAAAAa${c2} /${c1}AAa
|
||||
${c1} aAa${c2}\${c1}aAAA${c2}\${c1}AAAA${c2}\${c1}AAAA${c2}\${c1}AAA${c2}\${c1}AAa${c2}/${c1}aAa
|
||||
${c1} aAa${c2}\${c1}aA${c2}\\${c1}AAA${c2}\\${c1}AAA${c2}\\${c1}AA${c2}\\/${c1}aAa
|
||||
${c1} aAA${c2}\${c1}aA${c2}\\${c1}AAA${c2}\\${c1}AAA${c2}\\${c1}Aa${c2}/${c1}AAa
|
||||
${c1} aA${c2}\${c1}aA${c2}\\${c1}AAA${c2}\\${c1}AAA${c2}\\/${c1}Aa
|
||||
${c1} aA${c2}/${c1}AA${c2}\\\${c1}AA${c2}\\\${c1}AA${c2}\\\${c1}Aa
|
||||
${c1} aA${c2}/\${c1}AAa${c2}\\\${c1}Aa${c2}\\\${c1}Aa${c2}\\\${c1}Aa
|
||||
${c1} aA${c2}/\\${c1}AAa${c2}\\/\${c1}a${c2}\\\${c1}Aa${c2}\\${c1}Aa
|
||||
${c1} aA${c2}/${c1}a${c2}\\\${c1}Aa${c2}\/${c1}AA${c2}\\\\\${c1}Aa${c2}\\${c1}Aa
|
||||
${c1} aA${c2}/${c1}aA${c2}\\/${c1}aAa aAa${c2}\\\${c1}Aa${c2}\${c1}Aa
|
||||
${c1} aA${c2}/\${c1}A${c2}\/${c1}Aa aA${c2}\\${c1}A${c2}\\${c1}Aa
|
||||
${c1} A${c2}|/${c1}aaAa aAaa${c2}\|${c1}A
|
||||
${c1} aAaa aaAa
|
||||
""")
|
||||
|
||||
@@ -468,6 +468,10 @@ def detect(name: str) -> AsciiArt | None:
|
||||
from .feren import feren
|
||||
return feren
|
||||
|
||||
if name.startswith('femboyos'):
|
||||
from .femboyos import femboyos
|
||||
return femboyos
|
||||
|
||||
if name.startswith('finnix'):
|
||||
from .finnix import finnix
|
||||
return finnix
|
||||
@@ -800,6 +804,10 @@ def detect(name: str) -> AsciiArt | None:
|
||||
from .nixos import nixos
|
||||
return nixos
|
||||
|
||||
if name.startswith('nobara'):
|
||||
from .nobara import nobara
|
||||
return nobara
|
||||
|
||||
if name.startswith('nomadbsd'):
|
||||
from .nomadbsd import nomadbsd
|
||||
return nomadbsd
|
||||
@@ -1056,6 +1064,10 @@ def detect(name: str) -> AsciiArt | None:
|
||||
from .rosa import rosa
|
||||
return rosa
|
||||
|
||||
if name.startswith('astra linux'):
|
||||
from .astra_linux import astra_linux
|
||||
return astra_linux
|
||||
|
||||
if name.startswith('sabotage'):
|
||||
from .sabotage import sabotage
|
||||
return sabotage
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
femboyos = AsciiArt(match=r'''"FemboyOS"*''', color='4', ascii=r"""
|
||||
${c1}MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
|
||||
MMMMWKkxkKWMMMMMMMMMMMMMMMMMMMMWKkxkKWMM
|
||||
MMMMXo. .;xKWMMMMMMMMMMMMMMMMMMXo. .oXMM
|
||||
MMWXx,..'..oXMMMMMMMMMMMMMMMMWKx, .lXMM
|
||||
MMNo. .cOc.,xKWMMMMMMMMMMMMWXx;.....cXMM
|
||||
MMXl..;kKl. .oXMMMMMMMMMMWKx;..,ok:.'o0W
|
||||
WKx,.cKWNk;..lXMMMMMMMMWKx;..,o0NXl. .oN
|
||||
No. .lXMMWKc.,dKWMMMMMMNo..;d0NWMNx,..lX
|
||||
Nk:,:kNMMMNk:,ckNMMMMMMNxcxXWMMMMMN0ockN
|
||||
MWNNNWMMMMMWNNNWMMMMMMMMWWWMMMMMMMMMWWWM
|
||||
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
|
||||
MMMMMMMNXKXNWMMMMMMMMMMMWNKOKWMMMMMMMMMM
|
||||
MMMMMMWKdccxXMMMMMMMMMMW0o'.oXMMMMMMMMMM
|
||||
MMMMMMMNO:.'o0NKkkkkkOXXo. .lXMMMMMMMMMM
|
||||
MMMMMMMMNx,..;o;. .:o,..;kNMMMMMMMMMM
|
||||
MMMMMMMMMNO: ... .cKWMMMMMMMMMMM
|
||||
MMMMMMMMMMNx,. .;dk:. .;kNMMMMMMMMMMMM
|
||||
MMMMMMMMMMMN0ocxXWNkl:,:xXWMMMMMMMMMMMMM
|
||||
MMMMMMMMMMMMMWNWMMMWWNNNWMMMMMMMMMMMMMMM
|
||||
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
|
||||
""")
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
# This file is automatically generated. Please do not modify.
|
||||
|
||||
from . import AsciiArt
|
||||
|
||||
nobara = AsciiArt(match=r'''"Nobara"*''', color='"#999999" "#d80a0a" "#e5b90b"', ascii=r"""
|
||||
${c1} ⢀⣤⣴⣶⣶⣶⣦⣤⡀⠀⣀⣠⣤⣴⣶⣶⣶⣶⣶⣶⣶⣶⣤⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⠉⠁⠀⠀⠉⠉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀${c3}⢀⣀⣀⡀${c1}⠀⠀⠀⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠀⠀⠀${c3}⢠⣾⣿⣿⣿⣿⣷⡄${c1}⠀⠀⠀⠻⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁⠀⠀⠀${c3}⣿⣿⣿⣿⣿⣿⣿⡇${c1}⠀⠀⠀⠀⠀⣀⣀⣬⣽⣿⣿⣿⣿⣿⣿⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀${c3}⠈⠻⢿⣿⣿⡿⠟⠁${c1}⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀
|
||||
${c2} ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣤⣄⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀
|
||||
${c2} ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀
|
||||
${c2} ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀
|
||||
${c2} ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠛⠉⠉⠛⠛⢿⣿⣿⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠀
|
||||
${c2} ⠘⢿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀
|
||||
${c2} ⠈⠙⠛⠛⠛⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠛⠛⠛⠉⠁
|
||||
""")
|
||||
|
||||
+58
-28
@@ -2,13 +2,14 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import datetime
|
||||
import json
|
||||
import random
|
||||
import traceback
|
||||
from itertools import permutations
|
||||
from math import ceil
|
||||
|
||||
from . import termenv, neofetch_util
|
||||
from . import termenv, neofetch_util, pride_month
|
||||
from .color_scale import Scale
|
||||
from .color_util import clear_screen
|
||||
from .constants import *
|
||||
@@ -32,6 +33,7 @@ def check_config(path) -> Config:
|
||||
|
||||
return create_config()
|
||||
|
||||
|
||||
def create_config() -> Config:
|
||||
"""
|
||||
Create config interactively
|
||||
@@ -64,10 +66,12 @@ def create_config() -> Config:
|
||||
# 0. Check term size
|
||||
try:
|
||||
term_len, term_lines = os.get_terminal_size().columns, os.get_terminal_size().lines
|
||||
if term_len < 2 * asc_width + 4 or term_lines < 30:
|
||||
term_len_min = 2 * asc_width + 4
|
||||
term_lines_min = 30
|
||||
if term_len < term_len_min or term_lines < term_lines_min:
|
||||
printc(f'&cWarning: Your terminal is too small ({term_len} * {term_lines}). \n'
|
||||
f'Please resize it for better experience.')
|
||||
input('Press any key to ignore...')
|
||||
f'Please resize it to at least ({term_len_min} * {term_lines_min}) for better experience.')
|
||||
input('Press enter to ignore...')
|
||||
except:
|
||||
# print('Warning: We cannot detect your terminal size.')
|
||||
pass
|
||||
@@ -295,6 +299,36 @@ def create_config() -> Config:
|
||||
return c
|
||||
|
||||
|
||||
def create_parser() -> argparse.ArgumentParser:
|
||||
# Create CLI
|
||||
hyfetch = color('&l&bhyfetch&~&L')
|
||||
parser = argparse.ArgumentParser(description=color(f'{hyfetch} - neofetch with flags <3'), prog="hyfetch")
|
||||
|
||||
parser.add_argument('-c', '--config', action='store_true', help=color(f'Configure hyfetch'))
|
||||
parser.add_argument('-C', '--config-file', dest='config_file', default=CONFIG_PATH, help=f'Use another config file')
|
||||
parser.add_argument('-p', '--preset', help=f'Use preset', choices=list(PRESETS.keys()))
|
||||
parser.add_argument('-m', '--mode', help=f'Color mode', choices=['8bit', 'rgb'])
|
||||
parser.add_argument('-b', '--backend', help=f'Choose a *fetch backend', choices=['neofetch', 'fastfetch', 'fastfetch-old'])
|
||||
parser.add_argument('--args', help=f'Additional arguments pass-through to backend')
|
||||
parser.add_argument('--c-scale', dest='scale', help=f'Lighten colors by a multiplier', type=float)
|
||||
parser.add_argument('--c-set-l', dest='light', help=f'Set lightness value of the colors', type=float)
|
||||
parser.add_argument('--c-overlay', action='store_true', dest='overlay', help=f'Use experimental overlay color adjusting instead of HSL lightness')
|
||||
parser.add_argument('-V', '--version', dest='version', action='store_true', help=f'Check version')
|
||||
parser.add_argument('--june', action='store_true', help=f'Show pride month easter egg')
|
||||
parser.add_argument('--debug', action='store_true', help=f'Debug mode')
|
||||
|
||||
parser.add_argument('--distro', '--test-distro', dest='distro', help=f'Test for a specific distro')
|
||||
parser.add_argument('--ascii-file', help='Use a specific file for the ascii art')
|
||||
|
||||
# Hidden debug arguments
|
||||
# --test-print: Print the ascii distro and exit
|
||||
parser.add_argument('--test-print', action='store_true', help=argparse.SUPPRESS)
|
||||
# --ask-exit: Ask for input before exiting
|
||||
parser.add_argument('--ask-exit', action='store_true', help=argparse.SUPPRESS)
|
||||
|
||||
return parser
|
||||
|
||||
|
||||
def run():
|
||||
# Optional: Import readline
|
||||
try:
|
||||
@@ -307,31 +341,13 @@ def run():
|
||||
import colorama
|
||||
colorama.just_fix_windows_console()
|
||||
|
||||
# Create CLI
|
||||
hyfetch = color('&l&bhyfetch&~&L')
|
||||
parser = argparse.ArgumentParser(description=color(f'{hyfetch} - neofetch with flags <3'))
|
||||
|
||||
parser.add_argument('-c', '--config', action='store_true', help=color(f'Configure {hyfetch}'))
|
||||
parser.add_argument('-C', '--config-file', dest='config_file', default=CONFIG_PATH, help=f'Use another config file')
|
||||
parser.add_argument('-p', '--preset', help=f'Use preset', choices=PRESETS.keys())
|
||||
parser.add_argument('-m', '--mode', help=f'Color mode', choices=['8bit', 'rgb'])
|
||||
parser.add_argument('-b', '--backend', help=f'Choose a *fetch backend', choices=['neofetch', 'fastfetch', 'fastfetch-old'])
|
||||
parser.add_argument('--c-scale', dest='scale', help=f'Lighten colors by a multiplier', type=float)
|
||||
parser.add_argument('--c-set-l', dest='light', help=f'Set lightness value of the colors', type=float)
|
||||
parser.add_argument('-V', '--version', dest='version', action='store_true', help=f'Check version')
|
||||
parser.add_argument('--debug', action='store_true', help=f'Debug mode')
|
||||
|
||||
parser.add_argument('--distro', '--test-distro', dest='distro', help=f'Test for a specific distro')
|
||||
parser.add_argument('--ascii-file', help='Use a specific file for the ascii art')
|
||||
|
||||
# Hidden debug arguments
|
||||
# --test-print: Print the ascii distro and exit
|
||||
parser.add_argument('--test-print', action='store_true', help=argparse.SUPPRESS)
|
||||
# --ask-exit: Ask for input before exiting
|
||||
parser.add_argument('--ask-exit', action='store_true', help=argparse.SUPPRESS)
|
||||
|
||||
parser = create_parser()
|
||||
args = parser.parse_args()
|
||||
|
||||
# Use a custom distro
|
||||
GLOBAL_CFG.override_distro = args.distro
|
||||
GLOBAL_CFG.use_overlay = args.overlay
|
||||
|
||||
if args.version:
|
||||
print(f'Version is {VERSION}')
|
||||
return
|
||||
@@ -358,6 +374,20 @@ def run():
|
||||
# Load config or create config
|
||||
config = create_config() if args.config else check_config(args.config_file)
|
||||
|
||||
# Check if it's June (pride month)
|
||||
now = datetime.datetime.now()
|
||||
if now.month == 6 and now.year not in config.pride_month_shown and os.isatty(sys.stdout.fileno()):
|
||||
args.june = True
|
||||
|
||||
if args.june:
|
||||
pride_month.start_animation()
|
||||
print()
|
||||
print("Happy pride month!")
|
||||
print("(You can always view the animation again with `hyfetch --june`)")
|
||||
print()
|
||||
config.pride_month_shown.append(now.year)
|
||||
config.save()
|
||||
|
||||
# Use a custom distro
|
||||
GLOBAL_CFG.override_distro = args.distro or config.distro
|
||||
|
||||
@@ -388,7 +418,7 @@ def run():
|
||||
try:
|
||||
asc = get_distro_ascii() if not args.ascii_file else Path(args.ascii_file).read_text("utf-8")
|
||||
asc = config.color_align.recolor_ascii(asc, preset)
|
||||
neofetch_util.run(asc, config.backend)
|
||||
neofetch_util.run(asc, config.backend, args.args or '')
|
||||
except Exception as e:
|
||||
print(f'Error: {e}')
|
||||
traceback.print_exc()
|
||||
|
||||
@@ -17,6 +17,7 @@ class Config:
|
||||
color_align: ColorAlignment = field(default_factory=lambda: ColorAlignment('horizontal'))
|
||||
backend: BackendLiteral = "neofetch"
|
||||
distro: str | None = None
|
||||
pride_month_shown: list[int] = field(default_factory=list)
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, d: dict):
|
||||
|
||||
@@ -25,6 +25,7 @@ from .types import BackendLiteral, ColorAlignMode
|
||||
|
||||
RE_NEOFETCH_COLOR = re.compile('\\${c[0-9]}')
|
||||
|
||||
|
||||
def literal_input(prompt: str, options: Iterable[str], default: str, show_ops: bool = True) -> str:
|
||||
"""
|
||||
Ask the user to provide an input among a list of options
|
||||
@@ -68,6 +69,7 @@ def literal_input(prompt: str, options: Iterable[str], default: str, show_ops: b
|
||||
|
||||
return find_selection(selection)
|
||||
|
||||
|
||||
def term_size() -> tuple[int, int]:
|
||||
"""
|
||||
Get terminal size
|
||||
@@ -336,20 +338,21 @@ def get_distro_name():
|
||||
return run_neofetch_cmd('ascii_distro_name', True)
|
||||
|
||||
|
||||
def run(asc: str, backend: BackendLiteral):
|
||||
def run(asc: str, backend: BackendLiteral, args: str = ''):
|
||||
if backend == "neofetch":
|
||||
return run_neofetch(asc)
|
||||
return run_neofetch(asc, args)
|
||||
if backend == "fastfetch":
|
||||
return run_fastfetch(asc)
|
||||
return run_fastfetch(asc, args)
|
||||
if backend == "fastfetch-old":
|
||||
return run_fastfetch(asc, legacy=True)
|
||||
return run_fastfetch(asc, args, legacy=True)
|
||||
|
||||
|
||||
def run_neofetch(asc: str):
|
||||
def run_neofetch(asc: str, args: str = ''):
|
||||
"""
|
||||
Run neofetch with colors
|
||||
|
||||
:param asc: Ascii art
|
||||
:param args: Additional arguments to pass to neofetch
|
||||
"""
|
||||
# Escape backslashes here because backslashes are escaped in neofetch for printf
|
||||
asc = asc.replace('\\', '\\\\')
|
||||
@@ -361,14 +364,17 @@ def run_neofetch(asc: str):
|
||||
path.write_text(asc)
|
||||
|
||||
# Call neofetch with the temp file
|
||||
run_neofetch_cmd(f'--ascii --source {path.absolute()} --ascii-colors')
|
||||
if args:
|
||||
args = ' ' + args
|
||||
run_neofetch_cmd(f'--ascii --source {path.absolute()} --ascii-colors' + args)
|
||||
|
||||
|
||||
def run_fastfetch(asc: str, legacy: bool = False):
|
||||
def run_fastfetch(asc: str, args: str = '', legacy: bool = False):
|
||||
"""
|
||||
Run neofetch with colors
|
||||
|
||||
:param asc: Ascii art
|
||||
:param args: Additional arguments to pass to fastfetch
|
||||
:param legacy: Set true when using fastfetch < 1.8.0
|
||||
"""
|
||||
# Write temp file
|
||||
@@ -378,7 +384,7 @@ def run_fastfetch(asc: str, legacy: bool = False):
|
||||
path.write_text(asc)
|
||||
|
||||
# Call fastfetch with the temp file
|
||||
proc = subprocess.run(['fastfetch', '--raw' if legacy else '--file-raw', path.absolute()])
|
||||
proc = subprocess.run(['fastfetch', '--raw' if legacy else '--file-raw', path.absolute(), *shlex.split(args)])
|
||||
if proc.returncode == 144:
|
||||
printc("&6Error code 144 detected: Please upgrade fastfetch to >=1.8.0 or use the 'fastfetch-old' backend")
|
||||
|
||||
@@ -404,7 +410,6 @@ def get_fore_back(distro: str | None = None) -> tuple[int, int] | None:
|
||||
# Foreground-background recommendation
|
||||
fore_back = {
|
||||
'fedora': (2, 1),
|
||||
'ubuntu': (2, 1),
|
||||
'kubuntu': (2, 1),
|
||||
'lubuntu': (2, 1),
|
||||
'xubuntu': (2, 1),
|
||||
|
||||
+26
-33
@@ -119,11 +119,35 @@ class ColorProfile:
|
||||
:param term: Terminal color (can be "dark" or "light")
|
||||
:return: New color profile (original isn't modified)
|
||||
"""
|
||||
if GLOBAL_CFG.use_overlay:
|
||||
return self.overlay_dl(light, term)
|
||||
|
||||
term = term or GLOBAL_CFG.light_dark()
|
||||
assert term.lower() in ['light', 'dark']
|
||||
at_least, at_most = (True, None) if term.lower() == 'dark' else (None, True)
|
||||
return self.set_light_raw(light, at_least, at_most)
|
||||
|
||||
def overlay_raw(self, color: RGB, alpha: float) -> 'ColorProfile':
|
||||
"""
|
||||
Overlay a color on top of the color profile
|
||||
|
||||
:param color: Color to overlay
|
||||
:param alpha: Alpha value (0-1)
|
||||
:return: New color profile (original isn't modified)
|
||||
"""
|
||||
return ColorProfile([c.overlay(color, alpha) for c in self.colors])
|
||||
|
||||
def overlay_dl(self, light: float, term: LightDark | None = None):
|
||||
"""
|
||||
Same as set_light_dl except that this function uses RGB overlaying instead of HSL lightness change
|
||||
"""
|
||||
term = term or GLOBAL_CFG.light_dark()
|
||||
assert term.lower() in ['light', 'dark']
|
||||
|
||||
# If it's light bg, overlay black, else overlay white
|
||||
overlay_color = RGB.from_hex('#000000' if term.lower() == 'light' else '#FFFFFF')
|
||||
return self.overlay_raw(overlay_color, abs(light - 0.5) * 2)
|
||||
|
||||
def set_light_dl_def(self, term: LightDark | None = None):
|
||||
"""
|
||||
Set default lightness with respect to dark/light terminals
|
||||
@@ -478,53 +502,22 @@ PRESETS: dict[str, ColorProfile] = {
|
||||
'autoromantic': ColorProfile([ # symbol interpreted
|
||||
'#99D9EA',
|
||||
'#99D9EA',
|
||||
'#99D9EA',
|
||||
'#99D9EA',
|
||||
'#99D9EA',
|
||||
'#000000',
|
||||
'#3DA542',
|
||||
'#3DA542',
|
||||
'#000000',
|
||||
'#7F7F7F',
|
||||
'#7F7F7F',
|
||||
'#7F7F7F',
|
||||
'#7F7F7F',
|
||||
'#7F7F7F',
|
||||
]),
|
||||
|
||||
# i didn't expect this one to work. cool!
|
||||
'boyflux2': ColorProfile([
|
||||
'boyflux2': ColorProfile(ColorProfile([
|
||||
'#E48AE4',
|
||||
'#9A81B4',
|
||||
'#55BFAB',
|
||||
'#FFFFFF',
|
||||
'#A8A8A8',
|
||||
'#81D5EF',
|
||||
'#81D5EF',
|
||||
'#81D5EF',
|
||||
'#81D5EF',
|
||||
'#81D5EF',
|
||||
'#69ABE5',
|
||||
'#69ABE5',
|
||||
'#69ABE5',
|
||||
'#69ABE5',
|
||||
'#69ABE5',
|
||||
'#69ABE5',
|
||||
'#69ABE5',
|
||||
'#69ABE5',
|
||||
'#69ABE5',
|
||||
'#69ABE5',
|
||||
'#5276D4',
|
||||
'#5276D4',
|
||||
'#5276D4',
|
||||
'#5276D4',
|
||||
'#5276D4',
|
||||
'#5276D4',
|
||||
'#5276D4',
|
||||
'#5276D4',
|
||||
'#5276D4',
|
||||
'#5276D4',
|
||||
]),
|
||||
]).with_weights([1, 1, 1, 1, 1, 5, 5, 5])),
|
||||
|
||||
"finsexual": ColorProfile([
|
||||
"#B18EDF",
|
||||
|
||||
@@ -0,0 +1,127 @@
|
||||
import math
|
||||
from time import sleep
|
||||
|
||||
from hyfetch import presets
|
||||
from hyfetch.color_util import RGB, color, printc
|
||||
from hyfetch.constants import IS_WINDOWS
|
||||
from hyfetch.neofetch_util import term_size
|
||||
from hyfetch.presets import PRESETS
|
||||
|
||||
|
||||
def key_pressed():
|
||||
if IS_WINDOWS:
|
||||
import msvcrt
|
||||
return msvcrt.kbhit() # Non-blocking check for key press
|
||||
else:
|
||||
import select
|
||||
import sys
|
||||
return select.select([sys.stdin], [], [], 0) == ([sys.stdin], [], [])
|
||||
|
||||
|
||||
def start_animation():
|
||||
text = r"""
|
||||
.======================================================.
|
||||
| . . .__ . . . , . | |
|
||||
| |__| _.._ ._ . [__)._.* _| _ |\/| _ ._ -+-|_ | |
|
||||
| | |(_][_)[_)\_| | [ |(_](/, | |(_)[ ) | [ ) * |
|
||||
| | | ._| |
|
||||
'======================================================'""".strip("\n")
|
||||
text_lines = text.split("\n")
|
||||
text_height = len(text_lines)
|
||||
text_width = len(text_lines[0])
|
||||
|
||||
notice = "Press enter to continue"
|
||||
|
||||
speed = 2
|
||||
frame_delay = 1 / 25
|
||||
|
||||
colors: list[RGB] = []
|
||||
frame = 0
|
||||
|
||||
w, h = term_size()
|
||||
blocks = 9
|
||||
block_width = w // blocks
|
||||
|
||||
text_start_y = h // 2 - text_height // 2
|
||||
text_end_y = text_start_y + text_height
|
||||
text_start_x = w // 2 - text_width // 2
|
||||
text_end_x = text_start_x + text_width
|
||||
|
||||
notice_start_x = w - len(notice) - 1
|
||||
notice_end_x = w - 1
|
||||
notice_y = h - 1
|
||||
|
||||
# Add everything in PRESETS to colors
|
||||
colors = [c for preset in PRESETS.values() for c in preset.colors]
|
||||
|
||||
black = RGB(0, 0, 0)
|
||||
fg = RGB.from_hex("#FFE09B")
|
||||
|
||||
def draw_frame():
|
||||
buf = ""
|
||||
|
||||
# Loop over the height
|
||||
for y in range(h):
|
||||
# Print the starting color
|
||||
buf += colors[((frame + y) // block_width) % len(colors)].to_ansi_rgb(foreground=False)
|
||||
buf += fg.to_ansi_rgb(foreground=True)
|
||||
|
||||
# Loop over the width
|
||||
x = 0
|
||||
while x < w:
|
||||
idx = frame + x + y + int(math.sin(y + 0.5 * frame) * 2)
|
||||
y_text = text_start_y <= y < text_end_y
|
||||
|
||||
border = 1 + int(not (y == text_start_y or y == text_end_y - 1))
|
||||
|
||||
# If it's a switching point
|
||||
if idx % block_width == 0 or x == text_start_x - border or x == text_end_x + border \
|
||||
or x == notice_start_x - 1 or x == notice_end_x + 1:
|
||||
# Print the color at the current frame
|
||||
c = colors[(idx // block_width) % len(colors)]
|
||||
if (y_text and text_start_x - border <= x < text_end_x + border) \
|
||||
or (y == notice_y and notice_start_x - 1 <= x < notice_end_x + 1):
|
||||
# buf += c.set_light(0.3).to_ansi_rgb(foreground=False)
|
||||
buf += c.overlay(black, 0.5).to_ansi_rgb(foreground=False)
|
||||
else:
|
||||
buf += c.to_ansi_rgb(foreground=False)
|
||||
|
||||
# If text should be printed, print text
|
||||
if y_text and text_start_x <= x < text_end_x:
|
||||
# Add white background
|
||||
buf += text_lines[y - text_start_y][x - text_start_x]
|
||||
elif y == notice_y and notice_start_x <= x < notice_end_x:
|
||||
buf += notice[x - notice_start_x]
|
||||
else:
|
||||
buf += ' '
|
||||
|
||||
x += 1
|
||||
|
||||
# New line if it isn't the last line
|
||||
if y != h - 1:
|
||||
buf += color('&r\n')
|
||||
|
||||
print(buf, end='', flush=True)
|
||||
|
||||
try:
|
||||
while 1:
|
||||
# Clear the screen
|
||||
print("\033[2J\033[H", end="")
|
||||
draw_frame()
|
||||
frame += speed
|
||||
sleep(frame_delay)
|
||||
|
||||
if key_pressed():
|
||||
break
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
# Clear the screen
|
||||
printc("&r")
|
||||
print("\033[2J\033[H", end="", flush=True)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
start_animation()
|
||||
|
||||
|
||||
@@ -0,0 +1,142 @@
|
||||
# AUTOMATICALLY GENERATED by `shtab`
|
||||
|
||||
|
||||
|
||||
_shtab_hyfetch_option_strings=('-h' '--help' '-c' '--config' '-C' '--config-file' '-p' '--preset' '-m' '--mode' '-b' '--backend' '--c-scale' '--c-set-l' '-V' '--version' '--debug' '--distro' '--test-distro' '--ascii-file')
|
||||
|
||||
|
||||
|
||||
_shtab_hyfetch__p_choices=('rainbow' 'transgender' 'nonbinary' 'agender' 'queer' 'genderfluid' 'bisexual' 'pansexual' 'polysexual' 'omnisexual' 'omniromantic' 'gay-men' 'lesbian' 'abrosexual' 'asexual' 'aromantic' 'aroace1' 'aroace2' 'aroace3' 'autosexual' 'intergender' 'greygender' 'akiosexual' 'bigender' 'demigender' 'demiboy' 'demigirl' 'transmasculine' 'transfeminine' 'genderfaun' 'demifaun' 'genderfae' 'demifae' 'neutrois' 'biromantic1' 'biromantic2' 'autoromantic' 'boyflux2' 'finsexual' 'unlabeled1' 'unlabeled2' 'pangender' 'gendernonconforming1' 'gendernonconforming2' 'femboy' 'tomboy' 'gendervoid' 'voidgirl' 'voidboy' 'beiyang' 'burger')
|
||||
_shtab_hyfetch___preset_choices=('rainbow' 'transgender' 'nonbinary' 'agender' 'queer' 'genderfluid' 'bisexual' 'pansexual' 'polysexual' 'omnisexual' 'omniromantic' 'gay-men' 'lesbian' 'abrosexual' 'asexual' 'aromantic' 'aroace1' 'aroace2' 'aroace3' 'autosexual' 'intergender' 'greygender' 'akiosexual' 'bigender' 'demigender' 'demiboy' 'demigirl' 'transmasculine' 'transfeminine' 'genderfaun' 'demifaun' 'genderfae' 'demifae' 'neutrois' 'biromantic1' 'biromantic2' 'autoromantic' 'boyflux2' 'finsexual' 'unlabeled1' 'unlabeled2' 'pangender' 'gendernonconforming1' 'gendernonconforming2' 'femboy' 'tomboy' 'gendervoid' 'voidgirl' 'voidboy' 'beiyang' 'burger')
|
||||
_shtab_hyfetch__m_choices=('8bit' 'rgb')
|
||||
_shtab_hyfetch___mode_choices=('8bit' 'rgb')
|
||||
_shtab_hyfetch__b_choices=('neofetch' 'fastfetch' 'fastfetch-old')
|
||||
_shtab_hyfetch___backend_choices=('neofetch' 'fastfetch' 'fastfetch-old')
|
||||
|
||||
_shtab_hyfetch__h_nargs=0
|
||||
_shtab_hyfetch___help_nargs=0
|
||||
_shtab_hyfetch__c_nargs=0
|
||||
_shtab_hyfetch___config_nargs=0
|
||||
_shtab_hyfetch__V_nargs=0
|
||||
_shtab_hyfetch___version_nargs=0
|
||||
_shtab_hyfetch___debug_nargs=0
|
||||
_shtab_hyfetch___test_print_nargs=0
|
||||
_shtab_hyfetch___ask_exit_nargs=0
|
||||
|
||||
|
||||
# $1=COMP_WORDS[1]
|
||||
_shtab_compgen_files() {
|
||||
compgen -f -- $1 # files
|
||||
}
|
||||
|
||||
# $1=COMP_WORDS[1]
|
||||
_shtab_compgen_dirs() {
|
||||
compgen -d -- $1 # recurse into subdirs
|
||||
}
|
||||
|
||||
# $1=COMP_WORDS[1]
|
||||
_shtab_replace_nonword() {
|
||||
echo "${1//[^[:word:]]/_}"
|
||||
}
|
||||
|
||||
# set default values (called for the initial parser & any subparsers)
|
||||
_set_parser_defaults() {
|
||||
local subparsers_var="${prefix}_subparsers[@]"
|
||||
sub_parsers=${!subparsers_var}
|
||||
|
||||
local current_option_strings_var="${prefix}_option_strings[@]"
|
||||
current_option_strings=${!current_option_strings_var}
|
||||
|
||||
completed_positional_actions=0
|
||||
|
||||
_set_new_action "pos_${completed_positional_actions}" true
|
||||
}
|
||||
|
||||
# $1=action identifier
|
||||
# $2=positional action (bool)
|
||||
# set all identifiers for an action's parameters
|
||||
_set_new_action() {
|
||||
current_action="${prefix}_$(_shtab_replace_nonword $1)"
|
||||
|
||||
local current_action_compgen_var=${current_action}_COMPGEN
|
||||
current_action_compgen="${!current_action_compgen_var}"
|
||||
|
||||
local current_action_choices_var="${current_action}_choices[@]"
|
||||
current_action_choices="${!current_action_choices_var}"
|
||||
|
||||
local current_action_nargs_var="${current_action}_nargs"
|
||||
if [ -n "${!current_action_nargs_var}" ]; then
|
||||
current_action_nargs="${!current_action_nargs_var}"
|
||||
else
|
||||
current_action_nargs=1
|
||||
fi
|
||||
|
||||
current_action_args_start_index=$(( $word_index + 1 ))
|
||||
|
||||
current_action_is_positional=$2
|
||||
}
|
||||
|
||||
# Notes:
|
||||
# `COMPREPLY`: what will be rendered after completion is triggered
|
||||
# `completing_word`: currently typed word to generate completions for
|
||||
# `${!var}`: evaluates the content of `var` and expand its content as a variable
|
||||
# hello="world"
|
||||
# x="hello"
|
||||
# ${!x} -> ${hello} -> "world"
|
||||
_shtab_hyfetch() {
|
||||
local completing_word="${COMP_WORDS[COMP_CWORD]}"
|
||||
COMPREPLY=()
|
||||
|
||||
prefix=_shtab_hyfetch
|
||||
word_index=0
|
||||
_set_parser_defaults
|
||||
word_index=1
|
||||
|
||||
# determine what arguments are appropriate for the current state
|
||||
# of the arg parser
|
||||
while [ $word_index -ne $COMP_CWORD ]; do
|
||||
local this_word="${COMP_WORDS[$word_index]}"
|
||||
|
||||
if [[ -n $sub_parsers && " ${sub_parsers[@]} " =~ " ${this_word} " ]]; then
|
||||
# valid subcommand: add it to the prefix & reset the current action
|
||||
prefix="${prefix}_$(_shtab_replace_nonword $this_word)"
|
||||
_set_parser_defaults
|
||||
fi
|
||||
|
||||
if [[ " ${current_option_strings[@]} " =~ " ${this_word} " ]]; then
|
||||
# a new action should be acquired (due to recognised option string or
|
||||
# no more input expected from current action);
|
||||
# the next positional action can fill in here
|
||||
_set_new_action $this_word false
|
||||
fi
|
||||
|
||||
if [[ "$current_action_nargs" != "*" ]] && \
|
||||
[[ "$current_action_nargs" != "+" ]] && \
|
||||
[[ "$current_action_nargs" != *"..." ]] && \
|
||||
(( $word_index + 1 - $current_action_args_start_index >= \
|
||||
$current_action_nargs )); then
|
||||
$current_action_is_positional && let "completed_positional_actions += 1"
|
||||
_set_new_action "pos_${completed_positional_actions}" true
|
||||
fi
|
||||
|
||||
let "word_index+=1"
|
||||
done
|
||||
|
||||
# Generate the completions
|
||||
|
||||
if [[ "${completing_word}" == -* ]]; then
|
||||
# optional argument started: use option strings
|
||||
COMPREPLY=( $(compgen -W "${current_option_strings[*]}" -- "${completing_word}") )
|
||||
else
|
||||
# use choices & compgen
|
||||
local IFS=$'\n' # items may contain spaces, so delimit using newline
|
||||
COMPREPLY=( $([ -n "${current_action_compgen}" ] \
|
||||
&& "${current_action_compgen}" "${completing_word}") )
|
||||
unset IFS
|
||||
COMPREPLY+=( $(compgen -W "${current_action_choices[*]}" -- "${completing_word}") )
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
complete -o filenames -F _shtab_hyfetch hyfetch
|
||||
@@ -0,0 +1,14 @@
|
||||
# AUTOMATICALLY GENERATED by `shtab`
|
||||
|
||||
|
||||
|
||||
complete hyfetch \
|
||||
'c/--/(mode test-distro preset config c-scale c-set-l config-file ascii-file version debug distro help backend)/' \
|
||||
'c/-/(m h V C p b c -)/' \
|
||||
'n/-p/(rainbow transgender nonbinary agender queer genderfluid bisexual pansexual polysexual omnisexual omniromantic gay-men lesbian abrosexual asexual aromantic aroace1 aroace2 aroace3 autosexual intergender greygender akiosexual bigender demigender demiboy demigirl transmasculine transfeminine genderfaun demifaun genderfae demifae neutrois biromantic1 biromantic2 autoromantic boyflux2 finsexual unlabeled1 unlabeled2 pangender gendernonconforming1 gendernonconforming2 femboy tomboy gendervoid voidgirl voidboy beiyang burger)/' \
|
||||
'n/--preset/(rainbow transgender nonbinary agender queer genderfluid bisexual pansexual polysexual omnisexual omniromantic gay-men lesbian abrosexual asexual aromantic aroace1 aroace2 aroace3 autosexual intergender greygender akiosexual bigender demigender demiboy demigirl transmasculine transfeminine genderfaun demifaun genderfae demifae neutrois biromantic1 biromantic2 autoromantic boyflux2 finsexual unlabeled1 unlabeled2 pangender gendernonconforming1 gendernonconforming2 femboy tomboy gendervoid voidgirl voidboy beiyang burger)/' \
|
||||
'n/-m/(8bit rgb)/' \
|
||||
'n/--mode/(8bit rgb)/' \
|
||||
'n/-b/(neofetch fastfetch fastfetch-old)/' \
|
||||
'n/--backend/(neofetch fastfetch fastfetch-old)/' \
|
||||
'p/*/()/'
|
||||
@@ -0,0 +1,51 @@
|
||||
#compdef hyfetch
|
||||
|
||||
# AUTOMATICALLY GENERATED by `shtab`
|
||||
|
||||
|
||||
_shtab_hyfetch_commands() {
|
||||
local _commands=(
|
||||
|
||||
)
|
||||
_describe 'hyfetch commands' _commands
|
||||
}
|
||||
|
||||
_shtab_hyfetch_options=(
|
||||
"(- : *)"{-h,--help}"[show this help message and exit]"
|
||||
{-c,--config}"[Configure hyfetch]"
|
||||
{-C,--config-file}"[Use another config file]:config_file:"
|
||||
{-p,--preset}"[Use preset]:preset:(rainbow transgender nonbinary agender queer genderfluid bisexual pansexual polysexual omnisexual omniromantic gay-men lesbian abrosexual asexual aromantic aroace1 aroace2 aroace3 autosexual intergender greygender akiosexual bigender demigender demiboy demigirl transmasculine transfeminine genderfaun demifaun genderfae demifae neutrois biromantic1 biromantic2 autoromantic boyflux2 finsexual unlabeled1 unlabeled2 pangender gendernonconforming1 gendernonconforming2 femboy tomboy gendervoid voidgirl voidboy beiyang burger)"
|
||||
{-m,--mode}"[Color mode]:mode:(8bit rgb)"
|
||||
{-b,--backend}"[Choose a \*fetch backend]:backend:(neofetch fastfetch fastfetch-old)"
|
||||
"--c-scale[Lighten colors by a multiplier]:scale:"
|
||||
"--c-set-l[Set lightness value of the colors]:light:"
|
||||
{-V,--version}"[Check version]"
|
||||
"--debug[Debug mode]"
|
||||
{--distro,--test-distro}"[Test for a specific distro]:distro:"
|
||||
"--ascii-file[Use a specific file for the ascii art]:ascii_file:"
|
||||
)
|
||||
|
||||
|
||||
_shtab_hyfetch() {
|
||||
local context state line curcontext="$curcontext" one_or_more='(-)*' remainder='(*)'
|
||||
|
||||
if ((${_shtab_hyfetch_options[(I)${(q)one_or_more}*]} + ${_shtab_hyfetch_options[(I)${(q)remainder}*]} == 0)); then # noqa: E501
|
||||
_shtab_hyfetch_options+=(': :_shtab_hyfetch_commands' '*::: :->hyfetch')
|
||||
fi
|
||||
_arguments -C $_shtab_hyfetch_options
|
||||
|
||||
case $state in
|
||||
hyfetch)
|
||||
words=($line[1] "${words[@]}")
|
||||
(( CURRENT += 1 ))
|
||||
curcontext="${curcontext%:*:*}:_shtab_hyfetch-$line[1]:"
|
||||
case $line[1] in
|
||||
|
||||
esac
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
|
||||
typeset -A opt_args
|
||||
_shtab_hyfetch "$@"
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Usage: ./install-autocomplete.sh [Uninstall]
|
||||
if [[ "$1" == "uninstall" ]]; then
|
||||
uninstall=true
|
||||
echo -n "Uninstalling "
|
||||
else
|
||||
echo -n "Installing "
|
||||
fi
|
||||
echo "autocomplete scripts for HyFetch..."
|
||||
|
||||
# Stop on error
|
||||
set -e
|
||||
|
||||
# Obtain path of the current bash script
|
||||
script_path="$(dirname "$(realpath "$0")")"
|
||||
|
||||
# Installing for a specific shell in a specific directory if it exists
|
||||
install-for()
|
||||
{
|
||||
shell=$1
|
||||
dir=$2
|
||||
|
||||
case $shell in
|
||||
bash)
|
||||
filename="hyfetch"
|
||||
;;
|
||||
zsh)
|
||||
filename="_hyfetch"
|
||||
;;
|
||||
csh)
|
||||
filename="hyfetch.completion.csh"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown shell: $shell"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ -d "$dir" ]]; then
|
||||
if [[ "$uninstall" ]]; then
|
||||
rm -f "$dir/$filename"
|
||||
echo "⭐ Uninstalled for $shell in $dir"
|
||||
else
|
||||
cp "$script_path/autocomplete.$shell" "$dir/$filename"
|
||||
echo "⭐ Installed for $shell in $dir"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Copy files
|
||||
install-for bash /etc/bash_completion.d
|
||||
install-for bash /usr/share/bash-completion/completions
|
||||
|
||||
install-for zsh /usr/share/zsh/functions/Completion/Unix
|
||||
install-for zsh /usr/share/zsh/site-functions
|
||||
install-for zsh /usr/share/zsh-completions
|
||||
install-for zsh /usr/local/share/zsh/site-functions
|
||||
|
||||
install-for csh /etc/profile.d
|
||||
|
||||
echo "Done!"
|
||||
@@ -28,7 +28,7 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
version=7.3.8
|
||||
version=7.3.9
|
||||
|
||||
# Fallback to a value of '5' for shells which support bash
|
||||
# but do not set the 'BASH_' shell variables (osh).
|
||||
@@ -836,21 +836,21 @@ image_source="auto"
|
||||
# NOTE: AIX, AlmaLinux, Alpine, Alter, Amazon, AmogOS, Anarchy, Android, Antergos, antiX, AOSC OS,
|
||||
# AOSC OS/Retro, Aperio GNU/Linux, Aperture, Apricity, Arch, ArchBox, Archcraft, archcraft_ascii,
|
||||
# archcraft_minimal, ARCHlabs, ArchMerge, ArchStrike, ArcoLinux, ArseLinux, Artix, Arya, Asahi,
|
||||
# Aster, AsteroidOS, astOS, Bedrock, BigLinux, Bitrig, BlackArch, blackPanther, BLAG, BlankOn,
|
||||
# BlueLight, Bodhi, bonsai, BSD, BunsenLabs, CachyOS, Calculate, CalinixOS, Carbs, CBL-Mariner,
|
||||
# CelOS, Center, CentOS, Chakra, ChaletOS, Chapeau, ChonkySealOS, Chrom, Cleanjaro, Clear Linux OS,
|
||||
# ClearOS, Clover, Cobalt, Condres, Container Linux by CoreOS, CRUX, Crystal Linux, Cucumber,
|
||||
# CutefishOS, CuteOS, CyberOS, dahlia, DarkOs, Darwin, Debian, Deepin, DesaOS, Devuan, DietPi,
|
||||
# DracOS, DragonFly, Drauger, Droidian, Elementary, Elive, EncryptOS, EndeavourOS, Endless, Enso,
|
||||
# EuroLinux, Exherbo, Exodia Predator OS, Fedora, Feren, Finnix, Floflis, FreeBSD, FreeMiNT,
|
||||
# Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus, gNewSense, GNOME, GNU,
|
||||
# Aster, AsteroidOS, astOS, Astra Linux, Bedrock, BigLinux, Bitrig, BlackArch, blackPanther, BLAG,
|
||||
# BlankOn, BlueLight, Bodhi, bonsai, BSD, BunsenLabs, CachyOS, Calculate, CalinixOS, Carbs, CBL-
|
||||
# Mariner, CelOS, Center, CentOS, Chakra, ChaletOS, Chapeau, ChonkySealOS, Chrom, Cleanjaro, Clear
|
||||
# Linux OS, ClearOS, Clover, Cobalt, Condres, Container Linux by CoreOS, CRUX, Crystal Linux,
|
||||
# Cucumber, CutefishOS, CuteOS, CyberOS, dahlia, DarkOs, Darwin, Debian, Deepin, DesaOS, Devuan,
|
||||
# DietPi, DracOS, DragonFly, Drauger, Droidian, Elementary, Elive, EncryptOS, EndeavourOS, Endless,
|
||||
# Enso, EuroLinux, Exherbo, Exodia Predator OS, Fedora, FemboyOS, Feren, Finnix, Floflis, FreeBSD,
|
||||
# FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus, gNewSense, GNOME, GNU,
|
||||
# GoboLinux, GrapheneOS, Grombyang, Guix, Haiku, HamoniKR, HarDClanZ, Hash, Huayra, Hybrid, HydroOS,
|
||||
# Hyperbola, iglunix, instantOS, IRIX, Itc, januslinux, Kaisen, Kali, KaOS, KDE, Kibojoe, Kogaion,
|
||||
# Korora, KrassOS, KSLinux, Kubuntu, LangitKetujuh, LaxerOS, LEDE, LibreELEC, Linspire, Linux, Linux
|
||||
# Lite, Linux Mint, Linux Mint Old, Live Raizo, LMDE, Lubuntu, Lunar, mac, Mageia, MagpieOS,
|
||||
# Mandriva, Manjaro, MassOS, MatuusOS, Maui, Mer, Minix, MIRACLE LINUX, MX, Namib, NekOS, Neptune,
|
||||
# NetBSD, Netrunner, Nitrux, NixOS, NomadBSD, Nurunner, NuTyX, Obarun, OBRevenge, OmniOS, Open
|
||||
# Source Media Center, OpenBSD, openEuler, OpenIndiana, openmamba, OpenMandriva, OpenStage,
|
||||
# NetBSD, Netrunner, Nitrux, NixOS, Nobara, NomadBSD, Nurunner, NuTyX, Obarun, OBRevenge, OmniOS,
|
||||
# Open Source Media Center, OpenBSD, openEuler, OpenIndiana, openmamba, OpenMandriva, OpenStage,
|
||||
# openSUSE, openSUSE Leap, openSUSE Tumbleweed, OpenWrt, OPNsense, Oracle, orchid, OS Elbrus,
|
||||
# PacBSD, Parabola, parch, Pardus, Parrot, Parsix, PCBSD, PCLinuxOS, pearOS, Pengwin, Pentoo,
|
||||
# Peppermint, PikaOS, Pisi, PNM Linux, Pop!_OS, Porteus, PostMarketOS, Profelis SambaBOX, Proxmox,
|
||||
@@ -1100,6 +1100,19 @@ get_distro() {
|
||||
on|tiny) distro="LindowsOS" ;;
|
||||
*) distro="$(awk '/Version/ {print $2,$3}' /etc/lindowsos-version)"
|
||||
esac
|
||||
|
||||
elif [[ -f /etc/astra_version ]]; then
|
||||
distro="Astra Linux"
|
||||
distro_version="$(sed -nr 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p' < /etc/astra_version)"
|
||||
if [[ $distro_version == "2.12"* ]]; then
|
||||
distro_codename="ALCE"
|
||||
else
|
||||
distro_codename="ALSE"
|
||||
fi
|
||||
case $distro_shorthand in
|
||||
on|tiny) ;;
|
||||
*) distro="${distro} ${distro_version} ${distro_codename}"
|
||||
esac
|
||||
|
||||
elif type -p pveversion >/dev/null; then
|
||||
case $distro_shorthand in
|
||||
@@ -1245,14 +1258,40 @@ get_distro() {
|
||||
fi
|
||||
fi
|
||||
|
||||
# Gets the windows tag caption (ie `Microsoft Windows 11 Pro Insider Preview`)
|
||||
#
|
||||
# Then removes the `Microsoft` and `Windows` part and gets the current
|
||||
# version of Windows (old code reported Windows 10 even if host runs Windows 11).
|
||||
#
|
||||
# Finally, we decline it in three versions :
|
||||
#
|
||||
# - The `on` version (ie `[Windows 11.0.25330]`)
|
||||
# - The `tiny` version (ie `Windows 11`)
|
||||
# - The `any` version (ie `on Windows 11 Pro Insider Preview`)
|
||||
if [[ $(< /proc/version) == *Microsoft* || $kernel_version == *Microsoft* ]]; then
|
||||
windows_version=$(wmic.exe os get Version)
|
||||
windows_version=$(trim "${windows_version/Version}")
|
||||
|
||||
windows_version_verbose=$(reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -v ProductName | grep REG_)
|
||||
windows_version_verbose=$(trim "${windows_version_verbose/ProductName}")
|
||||
windows_version_verbose=$(trim "${windows_version_verbose/REG_SZ}")buildnumber=$(reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -v CurrentBuildNumber | grep REG_)
|
||||
windows_version_verbose=$(trim "${windows_version_verbose/Windows}")
|
||||
windows_buildnumber=$(reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -v CurrentBuildNumber | grep REG_)
|
||||
windows_buildnumber=${buildnumber/CurrentBuildNumber}
|
||||
windows_buildnumber=${buildnumber/REG_SZ}
|
||||
if [[ "$windows_version_verbose" == *"10"* ]] && (( windows_buildnumber >= 22000 )); then
|
||||
windows_version_verbose=${windows_version_verbose/10/11}
|
||||
fi
|
||||
|
||||
windows_version_current=${windows_version_verbose//[^[:digit:]]/}
|
||||
|
||||
windows_version_number_long=$(wmic.exe os get Version)
|
||||
windows_version_number_long=$(trim "${windows_version_number_long/Version}")
|
||||
windows_version_number_long=$(trim "${windows_version_number_long}")
|
||||
windows_version_number_long="${windows_version_current}${windows_version_number_long:2}"
|
||||
|
||||
case $distro_shorthand in
|
||||
on) distro+=" [Windows $windows_version]" ;;
|
||||
tiny) distro="Windows ${windows_version::2}" ;;
|
||||
*) distro+=" on Windows $windows_version" ;;
|
||||
on) distro+=" [Windows $windows_version_number_long]" ;;
|
||||
tiny) distro=" Windows $windows_version_current" ;;
|
||||
*) distro+=" on Windows $windows_version_verbose" ;;
|
||||
esac
|
||||
|
||||
# Chrome OS doesn't conform to the /etc/*-release standard.
|
||||
@@ -1349,9 +1388,17 @@ get_distro() {
|
||||
;;
|
||||
|
||||
Windows)
|
||||
distro=$(wmic os get Caption)
|
||||
distro=${distro/Caption}
|
||||
distro=${distro/Microsoft }
|
||||
distro=$(reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -v ProductName | grep REG_)
|
||||
distro=${distro/ProductName}
|
||||
distro=${distro/REG_SZ}
|
||||
buildnumber=$(reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -v CurrentBuildNumber | grep REG_)
|
||||
buildnumber=${buildnumber/CurrentBuildNumber}
|
||||
buildnumber=${buildnumber/REG_SZ}
|
||||
|
||||
# If the value of "ProductName" obtained is Windows 10 and the value of "CurrentBuildNumber" is greater than 22000, then the actual operating system version is Windows 11.
|
||||
if [[ "$distro" == *"Windows 10"* ]] && (( buildnumber >= 22000 )); then
|
||||
distro=${distro/Windows 10/Windows 11}
|
||||
fi
|
||||
;;
|
||||
|
||||
Solaris|illumos)
|
||||
@@ -1718,7 +1765,7 @@ get_title() {
|
||||
;;
|
||||
*)
|
||||
hostname=${HOSTNAME:-$(hostname)}
|
||||
hostname=${hostname%.*}
|
||||
hostname=${hostname%%.*}
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -2057,7 +2104,7 @@ get_packages() {
|
||||
has choco && dir "$ProgramData"/chocolatey/lib/*
|
||||
|
||||
# Count winget
|
||||
has winget && tot winget list
|
||||
has winget && tot winget list --accept-source-agreements
|
||||
;;
|
||||
|
||||
Haiku)
|
||||
@@ -2224,6 +2271,10 @@ get_de() {
|
||||
if [[ $DESKTOP_SESSION == *regolith ]]; then
|
||||
de=Regolith
|
||||
|
||||
# Added support Fly for Astra Linux
|
||||
elif [[ $DESKTOP_SESSION == fly ]]; then
|
||||
de=Fly
|
||||
|
||||
elif [[ $XDG_CURRENT_DESKTOP ]]; then
|
||||
de=${XDG_CURRENT_DESKTOP/X\-}
|
||||
de=${de/Budgie:GNOME/Budgie}
|
||||
@@ -2617,6 +2668,16 @@ get_wm_theme() {
|
||||
wm_theme=$(leftwm-theme status | grep "Your current theme" | sed -e 's/Your current theme is //g' -e 's/\,.*$//g')
|
||||
fi
|
||||
;;
|
||||
|
||||
fly-wm)
|
||||
fly_config_file
|
||||
if grep -q 'DecorTheme' "${fly_config_file}" 2>/dev/null; then
|
||||
wm_theme=$(awk -F'=' '/^DecorTheme/{print $2}' "${fly_config_file}")
|
||||
fi
|
||||
if [ -z "$wm_theme" ] || [ "$wm_theme" = "Not Found" ]; then
|
||||
wm_theme=Default
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
wm_theme=$(trim_quotes "$wm_theme")
|
||||
@@ -3880,6 +3941,28 @@ get_style() {
|
||||
shopt -u nullglob
|
||||
;;
|
||||
|
||||
"Fly")
|
||||
fly_config_file
|
||||
if [[ $fly == "ColorScheme" ]]; then
|
||||
fly_theme="$(
|
||||
basename "$(
|
||||
awk -F '=' '/^'"${fly}"'/{print $2}' "${HOME}/.fly/paletterc"
|
||||
)"
|
||||
)"
|
||||
if [[ $wm_theme == "Default" && $fly_theme != *"FlyDefault"* ]]; then
|
||||
fly_theme=$(awk -F '=' '/^'"${fly}"'/{print $2}'\
|
||||
"${HOME}/.config/fly-admin-themerc")
|
||||
fi
|
||||
elif [[ $fly == "IconTheme" ]]; then
|
||||
fly_theme=$(awk -F '=' '/^'"${fly}"'/{print $2}' "${fly_config_file}")
|
||||
elif [[ $fly == "DefaultFont" ]]; then
|
||||
fly_theme=$(awk -F'=' '/^'"${fly}"'/\
|
||||
{gsub(/"/, "", $2); \
|
||||
sub(/-.*/, "", $2); \
|
||||
print $2}' "${fly_config_file}")
|
||||
fi
|
||||
fly_theme+=" [$de], "
|
||||
;;
|
||||
esac
|
||||
|
||||
# Check for general GTK2 Theme.
|
||||
@@ -4009,6 +4092,7 @@ get_style() {
|
||||
}
|
||||
theme=''
|
||||
local cur_theme=''
|
||||
append_theme "$fly_theme" 'Fly'
|
||||
append_theme "$qt_theme" 'Qt'
|
||||
append_theme "$gtk2_theme" 'GTK2'
|
||||
append_theme "$gtk3_theme" 'GTK3'
|
||||
@@ -4036,7 +4120,7 @@ get_theme() {
|
||||
kde="widgetStyle"
|
||||
lxqt="style"
|
||||
qt5ct="style=" # There is a property called 'stylesheets'.
|
||||
|
||||
fly="ColorScheme"
|
||||
|
||||
get_style
|
||||
}
|
||||
@@ -4049,7 +4133,7 @@ get_icons() {
|
||||
kde="Theme"
|
||||
lxqt="icon_theme"
|
||||
qt5ct="icon_theme"
|
||||
|
||||
fly="IconTheme"
|
||||
|
||||
get_style
|
||||
icons="$theme"
|
||||
@@ -4063,6 +4147,7 @@ get_font() {
|
||||
kde="font"
|
||||
lxqt="font"
|
||||
qt5ct="general"
|
||||
fly="DefaultFont"
|
||||
|
||||
get_style
|
||||
font="$theme"
|
||||
@@ -4282,6 +4367,17 @@ END
|
||||
# Get Process ID of current konsole window / tab
|
||||
child="$(get_ppid "$$")"
|
||||
|
||||
# Loop while the process name is not "konsole"
|
||||
while [[ "$(ps -p "$(get_ppid "$child")" -o comm=)" != "konsole" ]]; do
|
||||
# Get the parent process ID
|
||||
child="$(get_ppid "$child")"
|
||||
|
||||
# Exit the loop if the parent process ID is 1 (i.e., init)
|
||||
if [[ "$child" == "1" ]]; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
QT_BINDIR="$(qtpaths --binaries-dir)" && PATH+=":$QT_BINDIR"
|
||||
|
||||
IFS=$'\n' read -d "" -ra konsole_instances \
|
||||
@@ -4308,7 +4404,7 @@ END
|
||||
profile_filename="${profile_filename/$'\n'*}"
|
||||
|
||||
[[ $profile_filename ]] && \
|
||||
term_font="$(awk -F '=|,' '/Font=/ {print $2,$3}' "$profile_filename")"
|
||||
term_font="$(awk -F '=|,' '/^Font=/ {print $2,$3}' "$profile_filename")"
|
||||
;;
|
||||
|
||||
"lxterminal"*)
|
||||
@@ -5406,7 +5502,7 @@ display_image() {
|
||||
;;
|
||||
|
||||
"sixel")
|
||||
img2sixel \
|
||||
img2sixel -I \
|
||||
-w "$width" \
|
||||
-h "$height" \
|
||||
"$image"
|
||||
@@ -5785,6 +5881,11 @@ tde_config_dir() {
|
||||
tde_config_dir="${tde_config_dir/$'/:'*}"
|
||||
}
|
||||
|
||||
fly_config_file() {
|
||||
# Return main path the fly config file
|
||||
fly_config_file=${HOME}/.fly/theme/current.themerc
|
||||
}
|
||||
|
||||
term_padding() {
|
||||
# Get terminal padding to properly align cursor.
|
||||
[[ -z "$term" ]] && get_term
|
||||
@@ -6079,45 +6180,46 @@ ASCII:
|
||||
Android, Antergos, antiX, AOSC OS, AOSC OS/Retro, Aperio GNU/Linux,
|
||||
Aperture, Apricity, Arch, ArchBox, Archcraft, archcraft_ascii,
|
||||
archcraft_minimal, ARCHlabs, ArchMerge, ArchStrike, ArcoLinux,
|
||||
ArseLinux, Artix, Arya, Asahi, Aster, AsteroidOS, astOS, Bedrock,
|
||||
BigLinux, Bitrig, BlackArch, blackPanther, BLAG, BlankOn, BlueLight,
|
||||
Bodhi, bonsai, BSD, BunsenLabs, CachyOS, Calculate, CalinixOS,
|
||||
Carbs, CBL-Mariner, CelOS, Center, CentOS, Chakra, ChaletOS,
|
||||
Chapeau, ChonkySealOS, Chrom, Cleanjaro, Clear Linux OS, ClearOS,
|
||||
Clover, Cobalt, Condres, Container Linux by CoreOS, CRUX, Crystal
|
||||
Linux, Cucumber, CutefishOS, CuteOS, CyberOS, dahlia, DarkOs,
|
||||
Darwin, Debian, Deepin, DesaOS, Devuan, DietPi, DracOS, DragonFly,
|
||||
Drauger, Droidian, Elementary, Elive, EncryptOS, EndeavourOS,
|
||||
Endless, Enso, EuroLinux, Exherbo, Exodia Predator OS, Fedora,
|
||||
Feren, Finnix, Floflis, FreeBSD, FreeMiNT, Frugalware, Funtoo,
|
||||
GalliumOS, Garuda, Gentoo, GhostBSD, glaucus, gNewSense, GNOME, GNU,
|
||||
GoboLinux, GrapheneOS, Grombyang, Guix, Haiku, HamoniKR, HarDClanZ,
|
||||
Hash, Huayra, Hybrid, HydroOS, Hyperbola, iglunix, instantOS, IRIX,
|
||||
Itc, januslinux, Kaisen, Kali, KaOS, KDE, Kibojoe, Kogaion, Korora,
|
||||
KrassOS, KSLinux, Kubuntu, LangitKetujuh, LaxerOS, LEDE, LibreELEC,
|
||||
Linspire, Linux, Linux Lite, Linux Mint, Linux Mint Old, Live Raizo,
|
||||
LMDE, Lubuntu, Lunar, mac, Mageia, MagpieOS, Mandriva, Manjaro,
|
||||
MassOS, MatuusOS, Maui, Mer, Minix, MIRACLE LINUX, MX, Namib, NekOS,
|
||||
Neptune, NetBSD, Netrunner, Nitrux, NixOS, NomadBSD, Nurunner,
|
||||
NuTyX, Obarun, OBRevenge, OmniOS, Open Source Media Center, OpenBSD,
|
||||
openEuler, OpenIndiana, openmamba, OpenMandriva, OpenStage,
|
||||
openSUSE, openSUSE Leap, openSUSE Tumbleweed, OpenWrt, OPNsense,
|
||||
Oracle, orchid, OS Elbrus, PacBSD, Parabola, parch, Pardus, Parrot,
|
||||
Parsix, PCBSD, PCLinuxOS, pearOS, Pengwin, Pentoo, Peppermint,
|
||||
PikaOS, Pisi, PNM Linux, Pop!_OS, Porteus, PostMarketOS, Profelis
|
||||
SambaBOX, Proxmox, PuffOS, Puppy, PureOS, Q4OS, Qubes, Qubyt,
|
||||
Quibian, Radix, Raspbian, ravynOS, Reborn OS, Red Star, Redcore,
|
||||
Redhat, Refracted Devuan, Regata, Regolith, RhaymOS, rocky, Rosa,
|
||||
Sabayon, sabotage, Sailfish, SalentOS, Salient OS, Sasanqua,
|
||||
Scientific, semc, Septor, Serene, SharkLinux, ShastraOS, Siduction,
|
||||
SkiffOS, Slackware, SliTaz, SmartOS, Soda, Solus, Source Mage,
|
||||
Sparky, Star, SteamOS, Stock Linux, Sulin, SunOS, SwagArch, t2,
|
||||
Tails, TeArch, TorizonCore, Trisquel, Twister, Ubuntu, Ubuntu
|
||||
Budgie, Ubuntu Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu Studio,
|
||||
Ubuntu Sway, Ubuntu Touch, Ubuntu-GNOME, ubuntu_old02, Ultramarine
|
||||
Linux, Univalent, Univention, Uos, UrukOS, uwuntu, Vanilla, Venom,
|
||||
VNux, Void, VzLinux, wii-linux-ngx, Windows, Windows 10, Windows 11,
|
||||
XFerience, Xubuntu, yiffOS, Zorin have ascii logos.
|
||||
ArseLinux, Artix, Arya, Asahi, Aster, AsteroidOS, astOS, Astra
|
||||
Linux, Bedrock, BigLinux, Bitrig, BlackArch, blackPanther, BLAG,
|
||||
BlankOn, BlueLight, Bodhi, bonsai, BSD, BunsenLabs, CachyOS,
|
||||
Calculate, CalinixOS, Carbs, CBL-Mariner, CelOS, Center, CentOS,
|
||||
Chakra, ChaletOS, Chapeau, ChonkySealOS, Chrom, Cleanjaro, Clear
|
||||
Linux OS, ClearOS, Clover, Cobalt, Condres, Container Linux by
|
||||
CoreOS, CRUX, Crystal Linux, Cucumber, CutefishOS, CuteOS, CyberOS,
|
||||
dahlia, DarkOs, Darwin, Debian, Deepin, DesaOS, Devuan, DietPi,
|
||||
DracOS, DragonFly, Drauger, Droidian, Elementary, Elive, EncryptOS,
|
||||
EndeavourOS, Endless, Enso, EuroLinux, Exherbo, Exodia Predator OS,
|
||||
Fedora, FemboyOS, Feren, Finnix, Floflis, FreeBSD, FreeMiNT,
|
||||
Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus,
|
||||
gNewSense, GNOME, GNU, GoboLinux, GrapheneOS, Grombyang, Guix,
|
||||
Haiku, HamoniKR, HarDClanZ, Hash, Huayra, Hybrid, HydroOS,
|
||||
Hyperbola, iglunix, instantOS, IRIX, Itc, januslinux, Kaisen, Kali,
|
||||
KaOS, KDE, Kibojoe, Kogaion, Korora, KrassOS, KSLinux, Kubuntu,
|
||||
LangitKetujuh, LaxerOS, LEDE, LibreELEC, Linspire, Linux, Linux
|
||||
Lite, Linux Mint, Linux Mint Old, Live Raizo, LMDE, Lubuntu, Lunar,
|
||||
mac, Mageia, MagpieOS, Mandriva, Manjaro, MassOS, MatuusOS, Maui,
|
||||
Mer, Minix, MIRACLE LINUX, MX, Namib, NekOS, Neptune, NetBSD,
|
||||
Netrunner, Nitrux, NixOS, Nobara, NomadBSD, Nurunner, NuTyX, Obarun,
|
||||
OBRevenge, OmniOS, Open Source Media Center, OpenBSD, openEuler,
|
||||
OpenIndiana, openmamba, OpenMandriva, OpenStage, openSUSE, openSUSE
|
||||
Leap, openSUSE Tumbleweed, OpenWrt, OPNsense, Oracle, orchid, OS
|
||||
Elbrus, PacBSD, Parabola, parch, Pardus, Parrot, Parsix, PCBSD,
|
||||
PCLinuxOS, pearOS, Pengwin, Pentoo, Peppermint, PikaOS, Pisi, PNM
|
||||
Linux, Pop!_OS, Porteus, PostMarketOS, Profelis SambaBOX, Proxmox,
|
||||
PuffOS, Puppy, PureOS, Q4OS, Qubes, Qubyt, Quibian, Radix, Raspbian,
|
||||
ravynOS, Reborn OS, Red Star, Redcore, Redhat, Refracted Devuan,
|
||||
Regata, Regolith, RhaymOS, rocky, Rosa, Sabayon, sabotage, Sailfish,
|
||||
SalentOS, Salient OS, Sasanqua, Scientific, semc, Septor, Serene,
|
||||
SharkLinux, ShastraOS, Siduction, SkiffOS, Slackware, SliTaz,
|
||||
SmartOS, Soda, Solus, Source Mage, Sparky, Star, SteamOS, Stock
|
||||
Linux, Sulin, SunOS, SwagArch, t2, Tails, TeArch, TorizonCore,
|
||||
Trisquel, Twister, Ubuntu, Ubuntu Budgie, Ubuntu Cinnamon, Ubuntu
|
||||
Kylin, Ubuntu MATE, Ubuntu Studio, Ubuntu Sway, Ubuntu Touch,
|
||||
Ubuntu-GNOME, ubuntu_old02, Ultramarine Linux, Univalent,
|
||||
Univention, Uos, UrukOS, uwuntu, Vanilla, Venom, VNux, Void,
|
||||
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 {distro}_old to use them.
|
||||
@@ -9142,6 +9244,32 @@ ${c1} `----------`
|
||||
EOF
|
||||
;;
|
||||
|
||||
"FemboyOS"*)
|
||||
set_colors 4
|
||||
read -rd '' ascii_data <<'EOF'
|
||||
${c1}MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
|
||||
MMMMWKkxkKWMMMMMMMMMMMMMMMMMMMMWKkxkKWMM
|
||||
MMMMXo. .;xKWMMMMMMMMMMMMMMMMMMXo. .oXMM
|
||||
MMWXx,..'..oXMMMMMMMMMMMMMMMMWKx, .lXMM
|
||||
MMNo. .cOc.,xKWMMMMMMMMMMMMWXx;.....cXMM
|
||||
MMXl..;kKl. .oXMMMMMMMMMMWKx;..,ok:.'o0W
|
||||
WKx,.cKWNk;..lXMMMMMMMMWKx;..,o0NXl. .oN
|
||||
No. .lXMMWKc.,dKWMMMMMMNo..;d0NWMNx,..lX
|
||||
Nk:,:kNMMMNk:,ckNMMMMMMNxcxXWMMMMMN0ockN
|
||||
MWNNNWMMMMMWNNNWMMMMMMMMWWWMMMMMMMMMWWWM
|
||||
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
|
||||
MMMMMMMNXKXNWMMMMMMMMMMMWNKOKWMMMMMMMMMM
|
||||
MMMMMMWKdccxXMMMMMMMMMMW0o'.oXMMMMMMMMMM
|
||||
MMMMMMMNO:.'o0NKkkkkkOXXo. .lXMMMMMMMMMM
|
||||
MMMMMMMMNx,..;o;. .:o,..;kNMMMMMMMMMM
|
||||
MMMMMMMMMNO: ... .cKWMMMMMMMMMMM
|
||||
MMMMMMMMMMNx,. .;dk:. .;kNMMMMMMMMMMMM
|
||||
MMMMMMMMMMMN0ocxXWNkl:,:xXWMMMMMMMMMMMMM
|
||||
MMMMMMMMMMMMMWNWMMMWWNNNWMMMMMMMMMMMMMMM
|
||||
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
|
||||
EOF
|
||||
;;
|
||||
|
||||
"Finnix"*)
|
||||
set_colors 4 7 7
|
||||
read -rd '' ascii_data <<'EOF'
|
||||
@@ -10935,6 +11063,30 @@ ${c1} ▝▀▀▀ ▀▀▀▀▘ ${c2}▀▀▀▘
|
||||
EOF
|
||||
;;
|
||||
|
||||
"Nobara"*)
|
||||
set_colors "#999999" "#d80a0a" "#e5b90b"
|
||||
|
||||
read -rd '' ascii_data <<'EOF'
|
||||
${c1} ⢀⣤⣴⣶⣶⣶⣦⣤⡀⠀⣀⣠⣤⣴⣶⣶⣶⣶⣶⣶⣶⣶⣤⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⣰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⡀⠀⠀⠀⠀⠀⠀⠀⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⠉⠁⠀⠀⠉⠉⠛⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀${c3}⢀⣀⣀⡀${c1}⠀⠀⠀⠈⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠀⠀⠀${c3}⢠⣾⣿⣿⣿⣿⣷⡄${c1}⠀⠀⠀⠻⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁⠀⠀⠀${c3}⣿⣿⣿⣿⣿⣿⣿⡇${c1}⠀⠀⠀⠀⠀⣀⣀⣬⣽⣿⣿⣿⣿⣿⣿⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀${c3}⠈⠻⢿⣿⣿⡿⠟⠁${c1}⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀
|
||||
⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀
|
||||
${c2} ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣤⣤⣄⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀
|
||||
${c2} ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀
|
||||
${c2} ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀
|
||||
${c2} ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠛⠉⠉⠛⠛⢿⣿⣿⠀⠀⠀⠀⠀⠸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠀
|
||||
${c2} ⠘⢿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀
|
||||
${c2} ⠈⠙⠛⠛⠛⠋⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠛⠛⠛⠛⠉⠁
|
||||
EOF
|
||||
;;
|
||||
|
||||
"NomadBSD"*)
|
||||
set_colors 4
|
||||
read -rd '' ascii_data <<'EOF'
|
||||
@@ -12411,6 +12563,38 @@ RO ROSA ROS ROSAROSAR ROSARO RO
|
||||
EOF
|
||||
;;
|
||||
|
||||
"Astra Linux"*)
|
||||
if [[ $ascii_distro == *"ALCE"* ]]; then
|
||||
set_colors 160 231
|
||||
else
|
||||
set_colors 32 231
|
||||
fi
|
||||
read -rd '' ascii_data <<'EOF'
|
||||
${c1} AA
|
||||
${c1} AaaA
|
||||
${c1} Aa${c2}/\\${c1}aA
|
||||
${c1} Aa${c2}/${c1}aa${c2}\\${c1}aA
|
||||
${c1} Aa${c2}/${c1}aAAa${c2}\\${c1}aA
|
||||
${c1} aA${c2}/${c1}aaAAaa${c2}\\${c1}Aa
|
||||
${c1} aA${c2}/${c1}aaAAAAaa${c2}\\${c1}Aa
|
||||
${c1} aaaaaaAAAAa${c2}/${c1}aaAAAAAAaa${c2}\\${c1}aAAAAaaaaa
|
||||
${c1} aAAa${c2}-----${c1}aaaaaAAAAAAAAAAaaaaa${c2}-----${c1}aAAa
|
||||
${c1} aAA${c2}\ ${c1}aAAAAAAAAAAAAAAAAAAAAAAa${c2} /${c1}AAa
|
||||
${c1} aAa${c2}\\${c1}aAAA${c2}\\${c1}AAAA${c2}\\${c1}AAAA${c2}\\${c1}AAA${c2}\\${c1}AAa${c2}/${c1}aAa
|
||||
${c1} aAa${c2}\\${c1}aA${c2}\\\\${c1}AAA${c2}\\\\${c1}AAA${c2}\\\\${c1}AA${c2}\\\\/${c1}aAa
|
||||
${c1} aAA${c2}\\${c1}aA${c2}\\\\${c1}AAA${c2}\\\\${c1}AAA${c2}\\\\${c1}Aa${c2}/${c1}AAa
|
||||
${c1} aA${c2}\\${c1}aA${c2}\\\\${c1}AAA${c2}\\\\${c1}AAA${c2}\\\\/${c1}Aa
|
||||
${c1} aA${c2}/${c1}AA${c2}\\\\\\${c1}AA${c2}\\\\\\${c1}AA${c2}\\\\\\${c1}Aa
|
||||
${c1} aA${c2}/\\${c1}AAa${c2}\\\\\\${c1}Aa${c2}\\\\\\${c1}Aa${c2}\\\\\\${c1}Aa
|
||||
${c1} aA${c2}/\\\\${c1}AAa${c2}\\\\/\\${c1}a${c2}\\\\\\${c1}Aa${c2}\\\\${c1}Aa
|
||||
${c1} aA${c2}/${c1}a${c2}\\\\\\${c1}Aa${c2}\\/${c1}AA${c2}\\\\\\\\\\${c1}Aa${c2}\\\\${c1}Aa
|
||||
${c1} aA${c2}/${c1}aA${c2}\\\\/${c1}aAa aAa${c2}\\\\\\${c1}Aa${c2}\\${c1}Aa
|
||||
${c1} aA${c2}/\\${c1}A${c2}\\/${c1}Aa aA${c2}\\\\${c1}A${c2}\\\\${c1}Aa
|
||||
${c1} A${c2}|/${c1}aaAa aAaa${c2}\\|${c1}A
|
||||
${c1} aAaa aaAa
|
||||
EOF
|
||||
;;
|
||||
|
||||
"sabotage"*)
|
||||
set_colors 4 7 1
|
||||
read -rd '' ascii_data <<'EOF'
|
||||
|
||||
+42
-41
@@ -1,7 +1,7 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH NEOFETCH "1" "April 2023" "Neofetch 7.3.8" "User Commands"
|
||||
.TH NEOFETCH "1" "June 2023" "Neofetch 7.3.9" "User Commands"
|
||||
.SH NAME
|
||||
Neofetch \- manual page for Neofetch 7.3.8
|
||||
Neofetch \- manual page for Neofetch 7.3.9
|
||||
.SH SYNOPSIS
|
||||
.B neofetch
|
||||
\fI\,func_name --option "value" --option "value"\/\fR
|
||||
@@ -314,45 +314,46 @@ NOTE: AIX, AlmaLinux, Alpine, Alter, Amazon, AmogOS, Anarchy,
|
||||
Android, Antergos, antiX, AOSC OS, AOSC OS/Retro, Aperio GNU/Linux,
|
||||
Aperture, Apricity, Arch, ArchBox, Archcraft, archcraft_ascii,
|
||||
archcraft_minimal, ARCHlabs, ArchMerge, ArchStrike, ArcoLinux,
|
||||
ArseLinux, Artix, Arya, Asahi, Aster, AsteroidOS, astOS, Bedrock,
|
||||
BigLinux, Bitrig, BlackArch, blackPanther, BLAG, BlankOn, BlueLight,
|
||||
Bodhi, bonsai, BSD, BunsenLabs, CachyOS, Calculate, CalinixOS,
|
||||
Carbs, CBL\-Mariner, CelOS, Center, CentOS, Chakra, ChaletOS,
|
||||
Chapeau, ChonkySealOS, Chrom, Cleanjaro, Clear Linux OS, ClearOS,
|
||||
Clover, Cobalt, Condres, Container Linux by CoreOS, CRUX, Crystal
|
||||
Linux, Cucumber, CutefishOS, CuteOS, CyberOS, dahlia, DarkOs,
|
||||
Darwin, Debian, Deepin, DesaOS, Devuan, DietPi, DracOS, DragonFly,
|
||||
Drauger, Droidian, Elementary, Elive, EncryptOS, EndeavourOS,
|
||||
Endless, Enso, EuroLinux, Exherbo, Exodia Predator OS, Fedora,
|
||||
Feren, Finnix, Floflis, FreeBSD, FreeMiNT, Frugalware, Funtoo,
|
||||
GalliumOS, Garuda, Gentoo, GhostBSD, glaucus, gNewSense, GNOME, GNU,
|
||||
GoboLinux, GrapheneOS, Grombyang, Guix, Haiku, HamoniKR, HarDClanZ,
|
||||
Hash, Huayra, Hybrid, HydroOS, Hyperbola, iglunix, instantOS, IRIX,
|
||||
Itc, januslinux, Kaisen, Kali, KaOS, KDE, Kibojoe, Kogaion, Korora,
|
||||
KrassOS, KSLinux, Kubuntu, LangitKetujuh, LaxerOS, LEDE, LibreELEC,
|
||||
Linspire, Linux, Linux Lite, Linux Mint, Linux Mint Old, Live Raizo,
|
||||
LMDE, Lubuntu, Lunar, mac, Mageia, MagpieOS, Mandriva, Manjaro,
|
||||
MassOS, MatuusOS, Maui, Mer, Minix, MIRACLE LINUX, MX, Namib, NekOS,
|
||||
Neptune, NetBSD, Netrunner, Nitrux, NixOS, NomadBSD, Nurunner,
|
||||
NuTyX, Obarun, OBRevenge, OmniOS, Open Source Media Center, OpenBSD,
|
||||
openEuler, OpenIndiana, openmamba, OpenMandriva, OpenStage,
|
||||
openSUSE, openSUSE Leap, openSUSE Tumbleweed, OpenWrt, OPNsense,
|
||||
Oracle, orchid, OS Elbrus, PacBSD, Parabola, parch, Pardus, Parrot,
|
||||
Parsix, PCBSD, PCLinuxOS, pearOS, Pengwin, Pentoo, Peppermint,
|
||||
PikaOS, Pisi, PNM Linux, Pop!_OS, Porteus, PostMarketOS, Profelis
|
||||
SambaBOX, Proxmox, PuffOS, Puppy, PureOS, Q4OS, Qubes, Qubyt,
|
||||
Quibian, Radix, Raspbian, ravynOS, Reborn OS, Red Star, Redcore,
|
||||
Redhat, Refracted Devuan, Regata, Regolith, RhaymOS, rocky, Rosa,
|
||||
Sabayon, sabotage, Sailfish, SalentOS, Salient OS, Sasanqua,
|
||||
Scientific, semc, Septor, Serene, SharkLinux, ShastraOS, Siduction,
|
||||
SkiffOS, Slackware, SliTaz, SmartOS, Soda, Solus, Source Mage,
|
||||
Sparky, Star, SteamOS, Stock Linux, Sulin, SunOS, SwagArch, t2,
|
||||
Tails, TeArch, TorizonCore, Trisquel, Twister, Ubuntu, Ubuntu
|
||||
Budgie, Ubuntu Cinnamon, Ubuntu Kylin, Ubuntu MATE, Ubuntu Studio,
|
||||
Ubuntu Sway, Ubuntu Touch, Ubuntu\-GNOME, ubuntu_old02, Ultramarine
|
||||
Linux, Univalent, Univention, Uos, UrukOS, uwuntu, Vanilla, Venom,
|
||||
VNux, Void, VzLinux, wii\-linux\-ngx, Windows, Windows 10, Windows 11,
|
||||
XFerience, Xubuntu, yiffOS, Zorin have ascii logos.
|
||||
ArseLinux, Artix, Arya, Asahi, Aster, AsteroidOS, astOS, Astra
|
||||
Linux, Bedrock, BigLinux, Bitrig, BlackArch, blackPanther, BLAG,
|
||||
BlankOn, BlueLight, Bodhi, bonsai, BSD, BunsenLabs, CachyOS,
|
||||
Calculate, CalinixOS, Carbs, CBL\-Mariner, CelOS, Center, CentOS,
|
||||
Chakra, ChaletOS, Chapeau, ChonkySealOS, Chrom, Cleanjaro, Clear
|
||||
Linux OS, ClearOS, Clover, Cobalt, Condres, Container Linux by
|
||||
CoreOS, CRUX, Crystal Linux, Cucumber, CutefishOS, CuteOS, CyberOS,
|
||||
dahlia, DarkOs, Darwin, Debian, Deepin, DesaOS, Devuan, DietPi,
|
||||
DracOS, DragonFly, Drauger, Droidian, Elementary, Elive, EncryptOS,
|
||||
EndeavourOS, Endless, Enso, EuroLinux, Exherbo, Exodia Predator OS,
|
||||
Fedora, FemboyOS, Feren, Finnix, Floflis, FreeBSD, FreeMiNT,
|
||||
Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, GhostBSD, glaucus,
|
||||
gNewSense, GNOME, GNU, GoboLinux, GrapheneOS, Grombyang, Guix,
|
||||
Haiku, HamoniKR, HarDClanZ, Hash, Huayra, Hybrid, HydroOS,
|
||||
Hyperbola, iglunix, instantOS, IRIX, Itc, januslinux, Kaisen, Kali,
|
||||
KaOS, KDE, Kibojoe, Kogaion, Korora, KrassOS, KSLinux, Kubuntu,
|
||||
LangitKetujuh, LaxerOS, LEDE, LibreELEC, Linspire, Linux, Linux
|
||||
Lite, Linux Mint, Linux Mint Old, Live Raizo, LMDE, Lubuntu, Lunar,
|
||||
mac, Mageia, MagpieOS, Mandriva, Manjaro, MassOS, MatuusOS, Maui,
|
||||
Mer, Minix, MIRACLE LINUX, MX, Namib, NekOS, Neptune, NetBSD,
|
||||
Netrunner, Nitrux, NixOS, Nobara, NomadBSD, Nurunner, NuTyX, Obarun,
|
||||
OBRevenge, OmniOS, Open Source Media Center, OpenBSD, openEuler,
|
||||
OpenIndiana, openmamba, OpenMandriva, OpenStage, openSUSE, openSUSE
|
||||
Leap, openSUSE Tumbleweed, OpenWrt, OPNsense, Oracle, orchid, OS
|
||||
Elbrus, PacBSD, Parabola, parch, Pardus, Parrot, Parsix, PCBSD,
|
||||
PCLinuxOS, pearOS, Pengwin, Pentoo, Peppermint, PikaOS, Pisi, PNM
|
||||
Linux, Pop!_OS, Porteus, PostMarketOS, Profelis SambaBOX, Proxmox,
|
||||
PuffOS, Puppy, PureOS, Q4OS, Qubes, Qubyt, Quibian, Radix, Raspbian,
|
||||
ravynOS, Reborn OS, Red Star, Redcore, Redhat, Refracted Devuan,
|
||||
Regata, Regolith, RhaymOS, rocky, Rosa, Sabayon, sabotage, Sailfish,
|
||||
SalentOS, Salient OS, Sasanqua, Scientific, semc, Septor, Serene,
|
||||
SharkLinux, ShastraOS, Siduction, SkiffOS, Slackware, SliTaz,
|
||||
SmartOS, Soda, Solus, Source Mage, Sparky, Star, SteamOS, Stock
|
||||
Linux, Sulin, SunOS, SwagArch, t2, Tails, TeArch, TorizonCore,
|
||||
Trisquel, Twister, Ubuntu, Ubuntu Budgie, Ubuntu Cinnamon, Ubuntu
|
||||
Kylin, Ubuntu MATE, Ubuntu Studio, Ubuntu Sway, Ubuntu Touch,
|
||||
Ubuntu\-GNOME, ubuntu_old02, Ultramarine Linux, Univalent,
|
||||
Univention, Uos, UrukOS, uwuntu, Vanilla, Venom, VNux, Void,
|
||||
VzLinux, wii\-linux\-ngx, Windows, Windows 10, Windows 11, XFerience,
|
||||
Xubuntu, yiffOS, Zorin have ascii logos.
|
||||
.TP
|
||||
NOTE: arch, dragonfly, Fedora, LangitKetujuh, nixos, redhat, Ubuntu
|
||||
have 'old' logo variants, use {distro}_old to use them.
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "neowofetch",
|
||||
"version": "1.4.8",
|
||||
"version": "1.4.9",
|
||||
"description": "Updated neofetch",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import shlex
|
||||
from subprocess import check_output
|
||||
@@ -52,7 +53,7 @@ if __name__ == '__main__':
|
||||
|
||||
# Fetch commit information
|
||||
commits = http.get(f'https://api.github.com/repos/{upstream}/pulls/{pr}/commits').json()
|
||||
author = commits[0]['commit']['author']
|
||||
author = json.loads(os.environ.get("override_author")) or commits[-1]['commit']['author']
|
||||
|
||||
# Create commit message
|
||||
title = info["title"].replace('"', '\\"')
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
Symbolic11
|
||||
GentlemanMC
|
||||
dr03m
|
||||
|
@@ -130,8 +130,7 @@ def create_release(v: str):
|
||||
# 4. Push
|
||||
print('Pushing commits...')
|
||||
subprocess.check_call(['git', 'push'])
|
||||
subprocess.check_call(['git', 'push', 'origin', v])
|
||||
subprocess.check_call(['git', 'push', 'origin', f'neofetch-{NEOFETCH_NEW_VERSION}'])
|
||||
subprocess.check_call(['git', 'push', 'origin', v, f'neofetch-{NEOFETCH_NEW_VERSION}'])
|
||||
|
||||
|
||||
def deploy():
|
||||
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Echo all commands
|
||||
set -x
|
||||
|
||||
shtab --shell=bash -u hyfetch.main.create_parser > hyfetch/scripts/autocomplete.bash
|
||||
shtab --shell=zsh -u hyfetch.main.create_parser > hyfetch/scripts/autocomplete.zsh
|
||||
shtab --shell=tcsh -u hyfetch.main.create_parser > hyfetch/scripts/autocomplete.csh
|
||||
@@ -0,0 +1,10 @@
|
||||
# Secret of Github Webhook to verify the request is from Github
|
||||
webhook_secret = "secret"
|
||||
|
||||
# Github token and repo to regulate
|
||||
gh_token = "token"
|
||||
gh_repo = "owner/repo"
|
||||
|
||||
# AI harm classifier token
|
||||
harm_classifier_url = "https://example.com/classify"
|
||||
harm_classifier_token = "token"
|
||||
@@ -0,0 +1,155 @@
|
||||
# Start the server with:
|
||||
#
|
||||
# uvicorn tools.gh_moderator:app --reload --port 59523
|
||||
#
|
||||
# pip install openai pygithub fastapi uvicorn hypy_utils
|
||||
|
||||
import hashlib
|
||||
import hmac
|
||||
import json
|
||||
import unicodedata
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
|
||||
import openai
|
||||
import tomllib as toml
|
||||
from fastapi import FastAPI, Request, Response
|
||||
from github import Github
|
||||
from hypy_utils import write, json_stringify
|
||||
from hypy_utils.logging_utils import setup_logger
|
||||
from openai.openai_object import OpenAIObject
|
||||
|
||||
from hyfetch.color_util import printc
|
||||
|
||||
log = setup_logger()
|
||||
|
||||
|
||||
def read_config():
|
||||
with open(Path.home() / ".config/gh_moderator.toml", "rb") as f:
|
||||
return toml.load(f)
|
||||
|
||||
|
||||
app = FastAPI()
|
||||
config = read_config()
|
||||
webhook_secret = bytes(config["webhook_secret"], "utf-8")
|
||||
|
||||
gh = Github(per_page=100, login_or_token=config["gh_token"])
|
||||
me = gh.get_user()
|
||||
repo = gh.get_repo(config["gh_repo"])
|
||||
printc(f"&a[+] Logged in as {me.login}")
|
||||
|
||||
harm_classifier_url, harm_classifier_token = config["harm_classifier_url"], config["harm_classifier_token"]
|
||||
|
||||
script_path = Path(__file__).parent
|
||||
supported_events = ["issue_comment", "issues", "pull_request", "pull_request_review_comment"]
|
||||
ai_notice = f"If you think this is a false-positive, please contact the owner of this repo."
|
||||
|
||||
openai.organization = config['OpenAI']['org']
|
||||
openai.api_key = config['OpenAI']['key']
|
||||
openai_model = config['OpenAI']['model']
|
||||
|
||||
|
||||
def get_content(event: str, obj: dict) -> str:
|
||||
# Get the content of the event
|
||||
match event:
|
||||
case "issue_comment" | "pull_request_review_comment":
|
||||
return obj["comment"]["body"]
|
||||
case "issues":
|
||||
return obj["issue"]["title"] + "\n\n" + obj["issue"]["body"]
|
||||
case "pull_request":
|
||||
return obj["pull_request"]["title"] + "\n\n" + obj["pull_request"]["body"]
|
||||
|
||||
|
||||
def redact(event: str, obj: dict, id: str, reason: str):
|
||||
"""
|
||||
Redact the event
|
||||
"""
|
||||
printc(f"&c[!] Redacting {event} {id} for {reason}.")
|
||||
tail = f"\n\n> Reason: {reason}\n> {ai_notice}"
|
||||
redact_notice = f"[Redacted by [AI Content Moderator]({me.html_url})]{tail}"
|
||||
|
||||
match event:
|
||||
case "issue_comment":
|
||||
# Redact the comment
|
||||
comment = repo.get_issue(obj["issue"]["number"]).get_comment(obj["comment"]["id"])
|
||||
comment.edit(body=redact_notice)
|
||||
|
||||
case "pull_request_review_comment":
|
||||
# Redact the comment
|
||||
comment = repo.get_pull(obj["pull_request"]["number"]).get_review_comment(obj["comment"]["id"])
|
||||
comment.edit(body=redact_notice)
|
||||
|
||||
case "issues" | "pull_request":
|
||||
# Close the issue
|
||||
iss = repo.get_issue(obj["issue"]["number"])
|
||||
iss.edit(title="[Redacted]", body=redact_notice, state="closed")
|
||||
iss.create_comment(f"Issue closed for potentially offensive content.{tail}")
|
||||
iss.lock("spam")
|
||||
|
||||
|
||||
async def process_event(event: str, obj: dict, id: str):
|
||||
# Preliminary checks
|
||||
if event not in supported_events:
|
||||
printc(f"&7[-] Unknown event: {event}")
|
||||
return
|
||||
|
||||
if obj['repository']['full_name'] != repo.full_name:
|
||||
printc(f"&7[-] Unknown repository: {obj['repository']['full_name']}")
|
||||
return
|
||||
|
||||
blacklist_users = {v for v in (script_path / "blacklist_users.csv").read_text().split("\n") if v}
|
||||
actor = obj["sender"]["login"]
|
||||
if actor == me.login:
|
||||
printc(f"&7[-] Ignoring event by myself: {id} {event} by {actor}")
|
||||
return
|
||||
printc(f"&e[+] Received event: {id} {event} by {actor}")
|
||||
|
||||
if actor in blacklist_users:
|
||||
redact(event, obj, id, "User is blacklisted")
|
||||
return
|
||||
|
||||
# Normalize content
|
||||
content = unicodedata.normalize("NFKC", get_content(event, obj))
|
||||
|
||||
# Ask OpenAI to predict if it's offensive
|
||||
res: OpenAIObject = openai.Moderation.create(content, openai_model).results[0]
|
||||
write(f"moderator-data/openai/{id}.json", json_stringify(res))
|
||||
if res.flagged:
|
||||
printc(f"\n&c[!] AI classified {event} {id} by {actor} as offensive !!!\n> Content: {content}\n\n")
|
||||
reason = " | ".join(f"{k} {res.category_scores.get(k) * 100:.0f}%" for k, v in res.categories.items() if v)
|
||||
redact(event, obj, id, f"Flagged by OpenAI : {reason}")
|
||||
return
|
||||
|
||||
printc(f"&a[~] AI classified {event} {id} by {actor} as safe.")
|
||||
|
||||
|
||||
@app.post("/")
|
||||
async def handle_webhook(request: Request, response: Response):
|
||||
# Read headers
|
||||
event = request.headers.get("X-GitHub-Event")
|
||||
signature = request.headers.get("X-Hub-Signature")
|
||||
|
||||
# Verify the signature
|
||||
body = await request.body()
|
||||
if not verify_signature(signature, body):
|
||||
response.status_code = 401
|
||||
return {"message": "Invalid signature"}
|
||||
|
||||
# Parse the event body
|
||||
obj = json.loads(body.decode())
|
||||
|
||||
# Log the request
|
||||
id = datetime.now().isoformat()
|
||||
write(f"moderator-data/webhook/{id}-{event}.json", json_stringify(obj, indent=4))
|
||||
|
||||
await process_event(event, obj, id)
|
||||
|
||||
return {"message": "OK"}
|
||||
|
||||
|
||||
# Helper function to verify the signature
|
||||
def verify_signature(signature: str, payload: bytes) -> bool:
|
||||
hash_type, signature = signature.split("=")
|
||||
digest = hmac.new(webhook_secret, msg=payload, digestmod=getattr(hashlib, hash_type)).hexdigest()
|
||||
return hmac.compare_digest(digest, signature)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
import os
|
||||
import time
|
||||
|
||||
from github import Github
|
||||
|
||||
if __name__ == '__main__':
|
||||
gh = Github(per_page=100, login_or_token=os.environ.get('GH_TOKEN'))
|
||||
|
||||
repo = gh.get_repo("hykilpikonna/hyfetch")
|
||||
|
||||
while True:
|
||||
iss = repo.get_issues(state='open')
|
||||
|
||||
for i in iss:
|
||||
if i.user.login in ['Symbolic11']:
|
||||
i.edit(title="[Redacted]", body="[Redacted by Content Moderation Bot]", state="closed")
|
||||
i.create_comment("Issue closed by bot for offensive content.")
|
||||
|
||||
print(f"Closed {i.number}")
|
||||
|
||||
time.sleep(2)
|
||||
@@ -15,7 +15,7 @@ from hypy_utils import write
|
||||
from hyfetch.distros import AsciiArt
|
||||
|
||||
RE_SPLIT = regex.compile('EOF[ \n]*?;;')
|
||||
RE_COLORS = regex.compile("""(?<=set_colors )[a-z\\d ]+(?=\n)""")
|
||||
RE_COLORS = regex.compile("""(?<=set_colors )[\"#a-z\\d ]+(?=\n)""")
|
||||
|
||||
|
||||
def substr(s: str, start: str, end: str | None = None):
|
||||
|
||||
Reference in New Issue
Block a user