Compare commits

..

12 Commits

Author SHA1 Message Date
azalea e64f7efca6 [F] Fix escaping (Fix #500)
Shellcheck / check (push) Has been cancelled
2026-04-20 23:45:57 -04:00
azalea 7bfb750f63 [F] Fix #499: neowofetch not found 2026-04-20 01:43:50 -04:00
azalea 7433df5d74 [O] Dockerize AI github moderator 2026-04-20 01:33:44 -04:00
azalea 2361be73ba [F] Update AI github moderator usage 2026-04-20 01:33:44 -04:00
azalea 5f8a34142e [U] Release 2.1.0 2026-04-20 01:33:44 -04:00
azalea 36c081c2ce [F] Order ascii checks 2026-04-12 18:53:27 +00:00
azalea 4ee3cd6b85 [O] Remove unused 2026-04-12 18:40:57 +00:00
azalea 5b9865382e [F] Maybe fix path escaping issue #496 2026-04-12 18:36:46 +00:00
Luna Jernberg 6241531ce9 Update Slackware installation instructions (#495)
Updated Slackware installation instructions to include new maintainer MDKDIO.
2026-04-12 05:53:54 +08:00
Zzyzx Wolfe 2196517709 [+] Queer Villain Pride flag. (#497)
Sourced from https://distressedegg.fun/qvp
2026-04-12 05:53:32 +08:00
azalea 7a2b2ba744 Revise change log and notation details
Reintroduce About Notation section and update change log.
2026-04-08 22:00:11 +08:00
azalea 4b7c92ba4b [F] Fix build pkg 2026-04-07 21:39:20 +00:00
67 changed files with 338 additions and 296 deletions
Generated
+1 -1
View File
@@ -272,7 +272,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hyfetch"
version = "2.1.0-rc1"
version = "2.1.0"
dependencies = [
"aho-corasick",
"ansi_colours",
+1 -1
View File
@@ -3,7 +3,7 @@ resolver = "2"
members = ["crates/*"]
[workspace.package]
version = "2.1.0-rc1"
version = "2.1.0"
authors = ["Azalea Gui <azalea@hydev.org>"]
edition = "2021"
rust-version = "1.75.0"
+8 -11
View File
@@ -37,7 +37,7 @@ Currently, these distributions have existing packages for HyFetch:
* Nix: `nix-env -i hyfetch` (Thanks to [@YisuiDenghua](https://github.com/YisuiDenghua))
* Nix Profile: `nix profile install nixpkgs#hyfetch`
* Guix: `guix install hyfetch` (Thanks to [@WammKD](https://github.com/WammKD))
* Slackware: `sbopkg -b hyfetch` [Slackbuild](https://slackbuilds.org/repository/15.0/desktop/hyfetch/?search=hyfetch) (Thanks to [@bittin](https://github.com/bittin) , willysr (https://github.com/willysr), jebrhansen and Urchlay)
* Slackware: `sbopkg -b hyfetch` [Slackbuild](https://slackbuilds.org/repository/15.0/desktop/hyfetch/?search=hyfetch) (Thanks to [@bittin](https://github.com/bittin) , willysr (https://github.com/willysr), jebrhansen and Urchlay and new maintainer MDKDIO)
* Homebrew: `brew install hyfetch` (Thanks to [@catumin](https://github.com/catumin) and [@osalbahr](https://github.com/osalbahr))
* openSUSE Tumbleweed: `zypper in python311-hyfetch` (Thanks to [@catumin](https://github.com/catumin))
* Gentoo: `emerge --ask app-misc/hyfetch` (Thanks to [@catumin](https://github.com/catumin))
@@ -109,16 +109,6 @@ You can also install your version locally by running `pip install .` in the repo
## Change Log
### About Notation
Updates to HyFetch begins with the emoji 🌈
Updates to `neowofetch` begins with the emoji 🖼️
### TODO
* [ ] (Important!) Refactor flag storage & coloring to support non-stride patterns
* [ ] Config menu: Allow left-right arrow keys for pagination
### Nightly
Note: You can install the latest nightly version by using:
@@ -129,6 +119,8 @@ cargo install --git https://github.com/hykilpikonna/hyfetch
<!-- CHANGELOG STARTS HERE --->
### 2.1.0
### 2.1.0-rc1
### 2.1.0
@@ -277,6 +269,11 @@ This is a massive update, rewriting the entire hyfetch core from Python to Rust
This version would be the last version of HyFetch on Python as we migrate to Rust (Huge thanks to everyone on [#317](https://github.com/hykilpikonna/hyfetch/pull/317)!). It will also be an effort to start a transition that phases out the neowofetch/neofetch backend in favor of FastFetch, since the time needed to maintain the NF backend currently exceed our capacity. If you are willing to help maintaining it, please let us know!
### About Notation
Updates to HyFetch begins with the emoji 🌈
Updates to `neowofetch` begins with the emoji 🖼️
* 🌈 **Improve Windows support**
* 🌈 **Include FastFetch into HyFetch PyPI package**
* 🌈 Detached our fork from neofetch
+10 -4
View File
@@ -146,9 +146,7 @@ impl Distro {
// Both sides are *
if m.starts_with('*') && m.ends_with('*') {
conds.push(format!(
r#"name.starts_with("{stripped}") || name.ends_with("{stripped}")"#
));
conds.push(format!(r#"name.contains("{stripped}")"#));
continue;
}
@@ -273,7 +271,15 @@ fn parse_ascii_distros(distro_dir: &Path) -> Result<Vec<AsciiDistro>>
.filter_map(|e| e.ok())
.map(|e| e.path())
.collect();
paths.sort();
// Sort by name length descending, then name descending.
// This ensures that more specific distros (e.g. windows_11, arch_small) are
// checked before more general ones (e.g. windows, arch).
paths.sort_by(|a, b| {
b.to_str()
.map_or(0, |s| s.len())
.cmp(&a.to_str().map_or(0, |s| s.len()))
.then(b.cmp(a))
});
for path in paths {
if path.extension().and_then(|s| s.to_str()) == Some("ascii") {
+8 -4
View File
@@ -3,8 +3,6 @@ use std::ffi::OsStr;
#[cfg(feature = "macchina")]
use std::fs;
use std::io::{Write as _};
#[cfg(windows)]
use std::io::{self};
use std::path::PathBuf;
use std::process::Command;
use std::sync::OnceLock;
@@ -411,8 +409,14 @@ where
{
let bash_path = bash_path().context("failed to get bash path")?;
let mut command = Command::new(bash_path);
command.arg(neofetch_path);
command.args(args);
// Convert path to use forward slashes because bash will interpret backslashes as escapes
command.arg(neofetch_path.to_string_lossy().replace('\\', "/"));
for arg in args {
// Also convert any backslashes in arguments to forward slashes for bash
command.arg(arg.as_ref().to_string_lossy().replace('\\', "/"));
}
Ok(command)
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH VERSION: "1" "April 2026" "Version: 2.1.0-rc1" "User Commands"
.TH VERSION: "1" "April 2026" "Version: 2.1.0" "User Commands"
.SH NAME
Version: \- manual page for Version: 2.1.0-rc1
Version: \- manual page for Version: 2.1.0
.SH SYNOPSIS
.B hyfetch
[\fI\,-c\/\fR] [\fI\,-C=CONFIG_FILE\/\fR] [\fI\,-p=PRESET\/\fR] [\fI\,-m=MODE\/\fR] [\fI\,-b=BACKEND\/\fR] [\fI\,--args=ARGS\/\fR] [\fI\,--c-scale=\/\fR
+7
View File
@@ -5,6 +5,13 @@ import os
from .py import run_py
from .rs import run_rust
def run_neofetch():
from .neofetch_util import run_neofetch_cmd
import sys
run_neofetch_cmd(sys.argv[1:])
if __name__ == '__main__':
if os.environ.get('HYFETCH_PY', False):
run_py()
+1 -1
View File
@@ -1,3 +1,3 @@
from __future__ import annotations
VERSION = '2.1.0-rc1'
VERSION = '2.1.0'
+14 -14
View File
@@ -1,17 +1,17 @@
{"match": "\"Ad\u00e9lie\"* | \"Adelie\"*", "color": "4 7 6"}
${c1} ${c3} ,-^-___
${c3} /\\\\\\///
${c2}refined.${c1} /\\\\\\\\//
${c2}reliable.${c1} /\\\\\\///
${c2}ready.${c1} /\\\\/////\\
__///\\\\\\\\/////\\
${c3} _//////\\\\\\\\\\\\\\////
${c1} ///////${c3}\\\\\\\\\\\\\\\\\\\\//
//////${c1}\\\\\\\\\\/
/////\\\\\\\\\\/
/////${c3}\\\\\\\\/
/\\\\///\\\\\\/
/\\\\\\/${c1}\\\/
/\\\\\\\\//
${c3} /\\\///
${c2}refined.${c1} /\\\\//
${c2}reliable.${c1} /\\\///
${c2}ready.${c1} /\\/////\
__///\\\\/////\
${c3} _//////\\\\\\\////
${c1} ///////${c3}\\\\\\\\\\//
//////${c1}\\\\\/
/////\\\\\/
/////${c3}\\\\/
/\\///\\\/
/\\\/${c1}\\/
/\\\\//
//////
/// ${c3}\\\\\\\\\\
/// ${c3}\\\\\
+6 -6
View File
@@ -1,7 +1,7 @@
{"match": "\"alpine_small\"", "color": "4 7"}
${c1} /\\ /\\
/${c2}/ ${c1}\\ \\
/${c2}/ ${c1}\\ \\
/${c2}// ${c1}\\ \\
${c2}// ${c1}\\ \\
\\
${c1} /\ /\
/${c2}/ ${c1}\ \
/${c2}/ ${c1}\ \
/${c2}// ${c1}\ \
${c2}// ${c1}\ \
\
+10 -10
View File
@@ -1,20 +1,20 @@
{"match": "\"AmogOS\"*", "color": "15 6"}
${c1} ___________
/ \\
/ ${c2}______${c1} \\
/ ${c2}/ \\${c1} \\
| ${c2}( )${c1} \\
/ ${c2}\\______/${c1} |
/ \
/ ${c2}______${c1} \
/ ${c2}/ \${c1} \
| ${c2}( )${c1} \
/ ${c2}\______/${c1} |
| |
/ \\
/ \
| |
| |
/ |
| |
| _______ |
____/ / \\ |
____/ / \ |
/ | | |
| / ____/ |
\\_________/ / |
\\ __/
\\_______/
\_________/ / |
\ __/
\_______/
+1 -1
View File
@@ -2,6 +2,6 @@
${c1} ;, ,;
';,.-----.,;'
,' ',
/ O O \\
/ O O \
| |
'-----------------'
+7 -7
View File
@@ -1,8 +1,8 @@
{"match": "\"arch_small\"", "color": "6 7 1"}
${c1} /\\
/ \\
/\\ \\
${c2} / \\
/ ,, \\
/ | | -\\
/_-'' ''-_\\
${c1} /\
/ \
/\ \
${c2} / \
/ ,, \
/ | | -\
/_-'' ''-_\
+1 -1
View File
@@ -5,7 +5,7 @@
?******************;
'*n` .'`^,;;,^`'. ,cc.
-<. .[l
// ^^ ^^ \\
// ^^ ^^ \
!^ ${c2}^^${c1} ":
'tt}` ${c2}!~]rj_${c1} ")t/.
Itttt?' ${c2}~~]rr]${c1} `{tttt,
+8 -8
View File
@@ -4,19 +4,19 @@ ${c1} oQA#$%UMn
G #
6 %
?#M#%KW3"
// \\\
// \\\
// \\\
// \\\
// \\
// \\
// \\
// \\
n%@$DK&ML .0O3#@&M_
P # 8 W
H U G #
B N O @
C&&#%HNAR 'WS3QMHB"
// \\\ \\\
// \\\ \\\
// \\\ \\\
// \\\ \\\
// \\ \\
// \\ \\
// \\ \\
// \\ \\
uURF$##Bv nKWB$%ABc aM@3R@D@b
8 M @ O # %
% & G U @ @
+9 -9
View File
@@ -10,14 +10,14 @@ ${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} 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
+17 -17
View File
@@ -1,23 +1,23 @@
{"match": "\"Astra Linux\"*", "color": "160 231", "foreground": [2]}
${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} 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} 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
+11 -11
View File
@@ -2,17 +2,17 @@
${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}\\\ \\\${c1}---------------------
------${c2}\\\ \\\\\\\\\\\\\\\\\${c1}------
-------${c2}\\\ \\\${c1}-----
--------${c2}\\\ \\\${c1}----
---------${c2}\\\ ______ \\\${c1}---
----------${c2}\\\ ///${c1}---
-----------${c2}\\\ ///${c1}----
------------${c2}\\\ ///${c1}-----
-------------${c2}\\\////////////////${c1}------
--------------------------------------
--------------------------------------
--------------------------------------
+4 -4
View File
@@ -1,8 +1,8 @@
{"match": "\"centos_small\"*", "color": "3 2 4 5 7"}
${c2} ____${c1}^${c4}____
${c2} |\\ ${c1}|${c4} /|
${c2} | \\ ${c1}|${c4} / |
${c2} |\ ${c1}|${c4} /|
${c2} | \ ${c1}|${c4} / |
${c4}<---- ${c3}---->
${c3} | / ${c2}|${c1} \\ |
${c3} |/__${c2}|${c1}__\\|
${c3} | / ${c2}|${c1} \ |
${c3} |/__${c2}|${c1}__\|
${c2} v
+3 -3
View File
@@ -2,7 +2,7 @@
${c1} ___
(${c3}.· ${c1}|
(${c2}<> ${c1}|
/ ${c3}__ ${c1}\\
( ${c3}/ \\ ${c1}/|
${c2}_${c1}/\\ ${c3}__)${c1}/${c2}_${c1})
/ ${c3}__ ${c1}\
( ${c3}/ \ ${c1}/|
${c2}_${c1}/\ ${c3}__)${c1}/${c2}_${c1})
${c2}\/${c1}-____${c2}\/
+1 -1
View File
@@ -4,7 +4,7 @@ ${c3} !M$EEEEEEEEEEEP
${c3}&MMMMMM${c2}MMMMMMMMMMMMM9
${c3}~MMM${c1}MMMM${c2}MMMMMMMMMMMMC
${c1}" ${c3}M${c1}MMMMMMM${c2}MMMMMMMMMMs
${c1}iM${c2}MMM&&${c1}MMMMMMMM${c2}MMMMMMMM\\
${c1}iM${c2}MMM&&${c1}MMMMMMMM${c2}MMMMMMMM\
${c1}BMMM${c2}MMMMM${c1}MMMMMMM${c2}MMMMMM${c3}"
${c1}9MMMMM${c2}MMMMMMM${c1}MMMM${c2}MMMM${c3}MMMf-
${c2}sMMMMMMMM${c1}MM${c2}M${c3}MMMMMMMMM3_
+2 -2
View File
@@ -1,7 +1,7 @@
{"match": "\"debian_small\"", "color": "1 7 3"}
${c1} _____
/ __ \\
/ __ \
| / |
| \\___-
| \___-
-_
--_
+4 -4
View File
@@ -3,8 +3,8 @@ ${c1} +-+-+-+-+-+-+-+
|${c3}d${c1}|${c3}i${c1}|${c3}g${c1}|${c3}i${c1}|${c3}t${c1}|${c3}a${c1}|${c3}l${c1}|
+-+-+-+-+-+-+-+
${c2} _ _ _ _ _______ __
| | | | \\ | |_ _\\ \\ / /
| | | | \\| | | | \\ V /
| | | | \ | |_ _\ \ / /
| | | | \| | | | \ V /
| | | | . ` | | | > <
| |__| | |\\ |_| |_ / . \\
\\____/|_| \\_|_____/_/ \\_\\
| |__| | |\ |_| |_ / . \
\____/|_| \_|_____/_/ \_\
+4 -4
View File
@@ -5,14 +5,14 @@
"==.__/~|~\__.=="
"==._( Y )_.=="
${c2}.-'~~""~=--...,__${c1}\/|\/${c2}__,...--=~""~~'-.
( ..=${c1}\\=${c1}/${c2}=.. )
`'-. ,.-"`;${c1}/=\\${c2};"-.,_ .-'`
( ..=${c1}\=${c1}/${c2}=.. )
`'-. ,.-"`;${c1}/=\${c2};"-.,_ .-'`
`~"-=-~` .-~` ${c1}|=|${c2} `~-. `~-=-"~`
.-~` /${c1}|=|${c2}\ `~-.
.~` / ${c1}|=|${c2} \ `~.
.-~` .' ${c1}|=|${c2} `. `~-.
(` _,.-="` ${c1} |=|${c2} `"=-.,_ `)
`~"~"` ${c1} |=|${c2} `"~"~`
${c1} /=\\
\\=/
${c1} /=\
\=/
^
+5 -5
View File
@@ -1,7 +1,7 @@
{"match": "\"elementary_small\"*", "color": "4 7 1"}
${c2} _______
/ ____ \\
/ | / /\\
|__\\ / / |
\\ /__/ /
\\_______/
/ ____ \
/ | / /\
|__\ / / |
\ /__/ /
\_______/
+3 -3
View File
@@ -1,10 +1,10 @@
{"match": "\"Fedora_old\"* | \"RFRemix\"*", "color": "4 7 1"}
${c1} /:-------------:\\
${c1} /:-------------:\
:-------------------::
:-----------${c2}/shhOHbmp${c1}---:\\
:-----------${c2}/shhOHbmp${c1}---:\
/-----------${c2}omMMMNNNMMD ${c1}---:
:-----------${c2}sMMMMNMNMP${c1}. ---:
:-----------${c2}:MMMdP${c1}------- ---\\
:-----------${c2}:MMMdP${c1}------- ---\
,------------${c2}:MMMd${c1}-------- ---:
:------------${c2}:MMMd${c1}------- .---:
:---- ${c2}oNMMMMMMMMMNho${c1} .----:
+2 -2
View File
@@ -1,6 +1,6 @@
{"match": "\"freebsd_small\"", "color": "1 7 3"}
${c1}/\\,-'''''-,/\\
\\_) (_/
${c1}/\,-'''''-,/\
\_) (_/
| |
| |
; ;
+2 -2
View File
@@ -1,7 +1,7 @@
{"match": "\"gentoo_small\"", "color": "5 7"}
${c1} _-----_
( \\
\ 0 \\
( \
\ 0 \
${c2} \ )
/ _/
( _-
+1 -1
View File
@@ -5,7 +5,7 @@ ${c1} _-`````-, ,- '- .
:/ : _... ..._ `` :
:: : /._ .`:'_.._\. || :
:: `._ ./ ,` : \ . _.'' .
`:. / | -. \-. \\_ /
`:. / | -. \-. \_ /
\:._ _/ .' .@) \@) ` `\ ,.'
_/,--' .- .\,-.`--`.
,'/'' (( \ ` )
+2 -2
View File
@@ -11,8 +11,8 @@ ee ${c2}`/:oooooooo+: ${c1}ee
ee ${c2}`/+ +++ +: ${c1}ee
ee ${c2}+o+\ ${c1}ee
eee ${c2}+o+\ ${c1}eee
eee ${c2}// \\ooo/ \\\ ${c1}eee
eee ${c2}//++++oooo++++\\\ ${c1}eee
eee ${c2}// \ooo/ \\ ${c1}eee
eee ${c2}//++++oooo++++\\ ${c1}eee
eeee ${c2}::::++oooo+::::: ${c1}eeee
eeeee ${c3}Grombyang OS ${c1} eeee
eeeeeeeeeeeeeeeeeeeeeee
+6 -6
View File
@@ -1,8 +1,8 @@
{"match": "\"guix_small\"*", "color": "3 7 6 1 8"}
${c1}|.__ __.|
|__ \\ / __|
\\ \\ / /
\\ \\ / /
\\ \\ / /
\\ \\/ /
\\__/
|__ \ / __|
\ \ / /
\ \ / /
\ \ / /
\ \/ /
\__/
+2 -2
View File
@@ -1,8 +1,8 @@
{"match": "\"haiku_small\"*", "color": "2 8"}
${c1} ,^,
/ \\
/ \
*--_ ; ; _--*
\\ '" "' /
\ '" "' /
'. .'
.-'" "'-.
'-.__. .__.-'
+4 -4
View File
@@ -2,7 +2,7 @@
${c1} |`__.`/
\____/
.--.
/ \\
/ ___ \\
/ .` `.\\
/.` `.\\
/ \
/ ___ \
/ .` `.\
/.` `.\
+2 -2
View File
@@ -9,8 +9,8 @@ ${c1}/#/${c4}//${c3}4${c4}//${c2}/W/ ${c4}^+.`${c1}`###${c2}NM\
${c1}##'${c4}|${c3}.l${c4}|${c2},&/ ${c4}`.',${c1}I#I${c2}HI#
${c1}#I${c4}||${c3}`I${c4}|${c2}(#( ${c3})`'${c1})##${c2}H~^
${c1}@\${c4}|||${c3}\${c4}\${c2}`X\ ${c3}///${c1},##%V${c3}'/
${c4}\\\\\\${c3}Y,${c2}*@b, ${c3}.-+//${c1}/&#%#/${c3},'
${c4}`\\\\${c2},.${c4}\${c3}<${c2}`*${c3}^`x<${c1},z<#&#x"${c3},'
${c4}\\\${c3}Y,${c2}*@b, ${c3}.-+//${c1}/&#%#/${c3},'
${c4}`\\${c2},.${c4}\${c3}<${c2}`*${c3}^`x<${c1},z<#&#x"${c3},'
${c3}`x<<${c2}`Xx,${c3}`<_`${c1}+{##&@P^${c4}'>${c3}'
${c3}`<_<<${c2}^<\-.${c3}`*`>${c1}<^'${c4},-'
${c3}`<_=-${c2}^\Xx${c1}XX\.${c3}+<.
+4 -4
View File
@@ -1,6 +1,6 @@
{"match": "\"LainOS\"*", "color": "4 14 7 2 3 5"}
${c2} /==\\
\\==/
${c2} /==\
\==/
${c1} · · · · · · ·
· · · · · · · · · ·
· · · ${c2}.-======-.${c1}· · · ·
@@ -13,8 +13,8 @@ ${c2} .::.${c1} ·${c2}.-============-.${c1}· ${c2}.::.
':===:${c1} · ${c2}:===.${c1} · ${c3}'--'${c1} · ${c2}.===:${c1} · ${c2}:===:'
':==:${c1}· ${c2}':===:.${c1}' ·· '${c2}.:===:'${c1} ·${c2}:==:'
'::'${c1} · ${c2}'===-. .-==='${c1} · ${c2}'::'
${c2}/==\\${c1} · · · ${c2}:=== ===:${c1} · · · ${c2}/==\\
\\==/${c1} · · ·${c2}:===${c1} ·${c2}===:${c1}· · · ${c2}\\==/${c2}
${c2}/==\${c1} · · · ${c2}:=== ===:${c1} · · · ${c2}/==\
\==/${c1} · · ·${c2}:===${c1} ·${c2}===:${c1}· · · ${c2}\==/${c2}
.-. ${c1}· ${c2}:===${c1}· ${c2}===:${c1} ·${c2} ${c2}.-.
.===. .=== ===. .===.
.======== ========.
+4 -4
View File
@@ -1,9 +1,9 @@
{"match": "\"Linspire\"* | \"Freespire\"* | \"Lindows\"*", "color": "4 2"}
${c2} __^
${c2} __/ \\
${c2} MMy dMy __/ \\
${c2} dMMy MMy ${c1}MM${c2} \\
${c2} MMMy ,, ${c1}dMMMMn ${c2}\\
${c2} __/ \
${c2} MMy dMy __/ \
${c2} dMMy MMy ${c1}MM${c2} \
${c2} MMMy ,, ${c1}dMMMMn ${c2}\
${c2} dMMy dMM dMMMMMMy ${c1}dMM MM dMMMMMy dMM MM.nMMM dMMMMMM
${c1}MMM ${c2}MMy MMy MMy ${c1}dMM MMy MMy MMy MMy dy dMy
${c1}MMM ${c2}dMM dMM MMy ${c1}dMMMMy dMM dMM dMM dMM dMMMMMMM
+3 -3
View File
@@ -2,7 +2,7 @@
${c2} ___
${c2} (${c1}.. ${c2}|
${c2} (${c3}<> ${c2}|
${c2} / ${c1}__ ${c2}\\
${c2} ( ${c1}/ \\ ${c2}/|
${c3}_${c2}/\\ ${c1}__)${c2}/${c3}_${c2})
${c2} / ${c1}__ ${c2}\
${c2} ( ${c1}/ \ ${c2}/|
${c3}_${c2}/\ ${c1}__)${c2}/${c3}_${c2})
${c3}\/${c2}-____${c3}\/
+5 -5
View File
@@ -1,8 +1,8 @@
{"match": "\"linuxlite_small\"*", "color": "3 7"}
${c1} /\\
/ \\
${c1} /\
/ \
/ ${c2}/ ${c1}/
> ${c2}/ ${c1}/
\\ ${c2}\\ ${c1}\\
\\_${c2}\\${c1}_\\
${c2} \\
\ ${c2}\ ${c1}\
\_${c2}\${c1}_\
${c2} \
+3 -3
View File
@@ -1,8 +1,8 @@
{"match": "\"linuxmint_small\"*", "color": "2 7"}
${c1} ___________
|_ \\
|_ \
| ${c2}| _____ ${c1}|
| ${c2}| | | | ${c1}|
| ${c2}| | | | ${c1}|
| ${c2}\\__${c2}___/ ${c1}|
\\_________/
| ${c2}\__${c2}___/ ${c1}|
\_________/
+4 -4
View File
@@ -2,7 +2,7 @@
${c1} *
*
**
${c2} /\\__/\\
/ \\
\\ /
\\____/
${c2} /\__/\
/ \
\ /
\____/
+7 -7
View File
@@ -1,8 +1,8 @@
{"match": "\"mx_small\"*", "color": "4 6 7"}
${c3} \\\\ /
\\\\/
\\\\
/\\/ \\\\
/ \\ /\\
/ \\/ \\
/__________\\
${c3} \\ /
\\/
\\
/\/ \\
/ \ /\
/ \/ \
/__________\
+7 -7
View File
@@ -1,8 +1,8 @@
{"match": "\"netbsd_small\"*", "color": "5 7"}
${c2}\\\\${c1}\`-______,----__
${c2} \\\\ ${c1}__,---\`_
${c2} \\\\ ${c1}\`.____
${c2} \\\\${c1}-______,----\`-
${c2} \\\\
\\\\
\\\\
${c2}\\${c1}\`-______,----__
${c2} \\ ${c1}__,---\`_
${c2} \\ ${c1}\`.____
${c2} \\${c1}-______,----\`-
${c2} \\
\\
\\
+6 -6
View File
@@ -1,8 +1,8 @@
{"match": "\"nixos_old_small\"*", "color": "4 6"}
${c1} \\ ${c2}\\ //
${c1} ==\\__${c2}\\/ ${c1}//
${c2} // ${c2}\\${c1}//
${c1} \ ${c2}\ //
${c1} ==\__${c2}\/ ${c1}//
${c2} // ${c2}\${c1}//
${c2}==// ${c1}//==
${c2} //${c1}\\${c2}___${c1}//
${c2}// ${c1}/\\ ${c2}\\==
${c1}// \\ ${c2}\\
${c2} //${c1}\${c2}___${c1}//
${c2}// ${c1}/\ ${c2}\==
${c1}// \ ${c2}\
+6 -6
View File
@@ -1,8 +1,8 @@
{"match": "\"nixos_small\"", "color": "4 6"}
${c1} \\\\ \\\\ //
==\\\\__\\\\/ //
// \\\\//
${c1} \\ \\ //
==\\__\\/ //
// \\//
==// //==
//\\\\___//
// /\\\\ \\\\==
// \\\\ \\\\
//\\___//
// /\\ \\==
// \\ \\
+6 -6
View File
@@ -1,14 +1,14 @@
{"match": "\"NomadBSD\"*", "color": "4"}
${c1} _======__
(===============\\
(===================\\
(===============\
(===================\
_ _---__
(= ====-
(= ======
(== ======
(== ======
(==\\ \\=-_ _=/ /====/
(==\\ \\========/ /====/ /====-_
(==\\ \\=====/ /==/ /===--
(==\ \=-_ _=/ /====/
(==\ \========/ /====/ /====-_
(==\ \=====/ /==/ /===--
/================/ /===-
\\===========/
\===========/
+8 -8
View File
@@ -8,17 +8,17 @@ ${c1} / ||\| Y J ) / |/| ./
J |)'( | ` F`.'/ ${c3} _
${c1} -<| F __ .-< ${c3}(_)
${c1} | / .-'${c3}. ${c1}`. /${c3}-. ${c1}L___
J \\ < ${c3}\ ${c1} | | ${c5}O${c3}\\${c1}|.-' ${c3} _
${c1} _J \\ .- \\${c3}/ ${c5}O ${c3}| ${c1}| \\ |${c1}F ${c3}(_)
${c1} '-F -<_. \\ .-' `-' L__
J \ < ${c3}\ ${c1} | | ${c5}O${c3}\${c1}|.-' ${c3} _
${c1} _J \ .- \${c3}/ ${c5}O ${c3}| ${c1}| \ |${c1}F ${c3}(_)
${c1} '-F -<_. \ .-' `-' L__
__J _ _. >-' ${c1})${c4}._. ${c1}|-'
${c1} `-|.' /_. ${c4}\_| ${c1} F
/.- . _.<
/' /.' .' `\\
/L /' |/ _.-'-\\
/' /.' .' `\
/L /' |/ _.-'-\
/'J ___.---'\|
|\ .--' V | `. `
|/`. `-. `._)
/ .-.\\
\\ ( `\\
`.\\
/ .-.\
\ ( `\
`.\
+4 -4
View File
@@ -1,8 +1,8 @@
{"match": "\"openbsd_small\"", "color": "3 7 6 1 8"}
${c1} _____
\\- -/
\\_/ \\
\- -/
\_/ \
| ${c2}O O${c1} |
|_ < ) 3 )
/ \\ /
/-_____-\\
/ \ /
/-_____-\
+4 -4
View File
@@ -1,8 +1,8 @@
{"match": "\"opensuse_small\" | \"suse_small\"*", "color": "2 7"}
${c1} _______
__| __ \\
/ .\\ \\
\\__/ |
__| __ \
/ .\ \
\__/ |
_______|
\\_______
\_______
__________/
+6 -6
View File
@@ -1,9 +1,9 @@
{"match": "\"popos_small\"* | \"pop_os_small\"*", "color": "6 7"}
${c1}______
\\ _ \\ __
\\ \\ \\ \\ / /
\\ \\_\\ \\ / /
\\ ___\\ /_/
\\ \\ _
__\\_\\__(_)_
\ _ \ __
\ \ \ \ / /
\ \_\ \ / /
\ ___\ /_/
\ \ _
__\_\__(_)_
(___________)`
+18 -18
View File
@@ -1,19 +1,19 @@
{"match": "\"PostMarketOS\"*", "color": "2 7"}
${c1} /\\
/ \\
/ \\
/ \\
/ \\
/ \\
\\ \\
/\\ \\____ \\
/ \\____ \\ \\
/ / \\ \\
/ / \\ ___\\
/ / \\ / ____
/ / \\/ / \\
/ / __________/ \\
/ \\ \\ \\
/ \\ \\ \\
/ / / \\
/___________/ /____________________\\
${c1} /\
/ \
/ \
/ \
/ \
/ \
\ \
/\ \____ \
/ \____ \ \
/ / \ \
/ / \ ___\
/ / \ / ____
/ / \/ / \
/ / __________/ \
/ \ \ \
/ \ \ \
/ / / \
/___________/ /____________________\
@@ -1,10 +1,10 @@
{"match": "\"postmarketos_small\"", "color": "2 7"}
${c1} /\\
/ \\
/ \\
\\__ \\
/\\__ \\ _\\
/ / \\/ __
/ / ____/ \\
/ \\ \\ \\
/_____/ /________\\
${c1} /\
/ \
/ \
\__ \
/\__ \ _\
/ / \/ __
/ / ____/ \
/ \ \ \
/_____/ /________\
+2 -2
View File
@@ -8,7 +8,7 @@ ${c1}
,m,_,' "###) ;,
(###% \#/ ;##mm.
^#/ __ ___ ; (######)
; //.\\ //.\\ ; \####/
_; (#\"// \\"/#) ; ,/
; //.\ //.\ ; \####/
_; (#\"// \"/#) ; ,/
@##\ \##/ = `"=" ,;mm/
`\##>.____,...,____,<####@
+1 -1
View File
@@ -1,7 +1,7 @@
{"match": "\"Raspbian_small\"*", "color": "2 1"}
${c1} .. ,.
:oo: .:oo:
'o\\o o/o:
'o\o o/o:
${c2} :: . :: . ::
:: ::: ::: ::
:' '',.'' ':
+2 -2
View File
@@ -1,8 +1,8 @@
{"match": "\"Refracted Devuan\"* | \"Refracted_Devuan\"*", "color": "8 7"}
${c2} A
VW
VVW\\
.yWWW\\
VVW\
.yWWW\
,;,,u,;yy;;v;uyyyyyyy ,WWWWW^
*WWWWWWWWWWWWWWWW/ $VWWWWw ,
^*%WWWWWWVWWX $WWWW** ,yy
+1 -1
View File
@@ -2,7 +2,7 @@
${c1} ________
/ ______|
| |______
\\______ \\
\______ \
______| |
| |________/
|____________
+4 -4
View File
@@ -1,9 +1,9 @@
{"match": "\"Sulin\"*", "color": "4 7 1"}
${c2}
/\ /\
( \\\\ // )
\ \\\\ // /
\_\\\\||||//_/
( \\ // )
\ \\ // /
\_\\||||//_/
\/ _ _ \
\/|(O)(O)|
\/ | |
@@ -19,4 +19,4 @@ ${c2}
| | | | | ||
| | | | | ||
|_| |_| |_||
\_\ \_\ \_\\
\_\ \_\ \_\
+4 -4
View File
@@ -1,8 +1,8 @@
{"match": "\"void_small\"", "color": "2 8"}
${c1} _______
_ \\______ -
| \\ ___ \\ |
_ \______ -
| \ ___ \ |
| | / \ | |
| | \___/ | |
| \\______ \\_|
-_______\\
| \______ \_|
-_______\
+1 -1
View File
@@ -15,6 +15,6 @@ llllllllllllll lllllllllllllllllll
llllllllllllll lllllllllllllllllll
llllllllllllll lllllllllllllllllll
`'ccllllllllll lllllllllllllllllll
`' \\*:: :ccllllllllllllllll
`' \*:: :ccllllllllllllllll
````''*::cll
``
+1 -1
View File
@@ -8,7 +8,7 @@ ${c3} @r))))@${c1}oooo${c3})))))h)))[
${c3} rr)))j${c1}oooooo${c3}(x${c1}ooooo${c3}$@)
${c3} rrrxr))r/l;${c1},,,${c3}z@{${c1},,,,,${c3}@@
${c3} rr ) ${c2}v${c3} @;@rx
${c3} rrr) ${c2}\\__^__/${c3} ji
${c3} rrr) ${c2}\__^__/${c3} ji
${c3} rj]. . r
${c3}[[${c2}]]${c1}11111111111111111]
${c2}]${c3}[[[${c2}]]][${c1}11111111111111111<
+4
View File
@@ -241,5 +241,9 @@
"haruhi": {
"colors": ["#613D2F", "#F5B422", "#613D2F", "#613D2F", "#57A4B8", "#F20205", "#57A4B8", "#57A4B8", "#FFFFFF", "#FFFFFF", "#FFFFFF", "#57A4B8", "#57A4B8", "#F20205", "#57A4B8", "#613D2F", "#613D2F", "#F5B422", "#613D2F"],
"comment": "Haruhi Suzumiya preset"
},
"queervillain": {
"colors": ["#662D91", "#8DC63F", "#F7941D", "#EC008C"],
"comment": "Sourced from https://distressedegg.fun/qvp"
}
}
+7 -4
View File
@@ -248,19 +248,22 @@ def check_windows_cmd():
# sys.exit(0)
def run_neofetch_cmd(args: str, pipe: bool = False) -> str | None:
def run_neofetch_cmd(args: str | list[str], pipe: bool = False) -> str | None:
"""
Run neofetch command
"""
if isinstance(args, str):
args = shlex.split(args)
if platform.system() != 'Windows':
bash = ['/usr/bin/env', 'bash'] if Path('/usr/bin/env').is_file() else [shutil.which('bash')]
full_cmd = [*bash, get_command_path(), *shlex.split(args)]
full_cmd = [*bash, get_command_path(), *args]
else:
cmd = get_command_path().replace("\\", "/").replace("C:/", "/c/")
args = args.replace('\\', '/').replace('C:/', '/c/')
args = [a.replace('\\', '/').replace('C:/', '/c/') for a in args]
full_cmd = [ensure_git_bash(), cmd, *shlex.split(args)]
full_cmd = [ensure_git_bash(), cmd, *args]
full_cmd = [str(c) for c in full_cmd]
if pipe:
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "neowofetch",
"version": "2.1.0-rc1",
"version": "2.1.0",
"description": "Updated neofetch",
"repository": {
"type": "git",
+2 -2
View File
@@ -40,6 +40,7 @@ Homepage = "https://github.com/hykilpikonna/HyFetch"
"hyfetch.v1" = "hyfetch.__main__:run_py"
"hyfetch.rs" = "hyfetch.__main__:run_rust"
"hyfetch" = "hyfetch.__main__:run_rust"
"neowofetch" = "hyfetch.__main__:run_neofetch"
[tool.hatch.version]
source = "regex"
@@ -49,5 +50,4 @@ regex = 'version = "(?P<version>.+?)"'
[tool.hatch.build]
exclude = ["/tools"]
[tool.hatch.build.targets.wheel.files]
"{py_scripts}/neowofetch" = "hyfetch/scripts/neowofetch"
+4 -4
View File
@@ -48,7 +48,7 @@ cp -r git/ wheel/hyfetch/
# Embed fastfetch binary
echo "> Embedding fastfetch binary"
wget -q "$FASTFETCH_DL/fastfetch-windows-amd64.zip" -O fastfetch-windows.zip
wget "$FASTFETCH_DL/fastfetch-windows-amd64.zip" -O fastfetch-windows.zip
mkdir -p wheel/hyfetch/fastfetch
bsdtar -zxf fastfetch-windows.zip -C wheel/hyfetch/fastfetch
rm -rf fastfetch-windows.zip
@@ -87,7 +87,7 @@ function build_for_platform() {
echo "Building for $ff_platform"
# Download the fastfetch binary
wget -q "$FASTFETCH_DL/fastfetch-$ff_platform.zip" -O "fastfetch-$ff_platform.zip"
wget "$FASTFETCH_DL/fastfetch-$ff_platform.zip" -O "fastfetch-$ff_platform.zip"
# Delete the old fastfetch folder
rm -rf wheel/hyfetch/fastfetch
@@ -127,8 +127,8 @@ build_for_platform "linux-armv7l" "manylinux_2_31_armv7l" "armv7-unknown-linux-m
build_for_platform "musl-amd64" "musllinux_1_1_x86_64" "x86_64-unknown-linux-musl"
# build_for_platform "musl-aarch64" "musllinux_1_1_aarch64"
# The official fastfetch build uses macOS 12.0
build_for_platform "macos-universal" "macosx_11_0_x86_64" "x86_64-apple-darwin"
build_for_platform "macos-universal" "macosx_11_0_arm64" "aarch64-apple-darwin"
build_for_platform "macos-amd64" "macosx_11_0_x86_64" "x86_64-apple-darwin"
build_for_platform "macos-aarch64" "macosx_11_0_arm64" "aarch64-apple-darwin"
# TODO: linux_riscv64 (pypi's platform tag support is not there yet)
# build_for_platform "linux-riscv64" "manylinux_2_31_riscv64"
+18
View File
@@ -0,0 +1,18 @@
FROM python:3.12-slim
WORKDIR /app
# Install dependencies
RUN pip install openai pygithub fastapi uvicorn hypy_utils hatchling
# Copy source code
COPY . .
# Set environment variables
ENV PYTHONUNBUFFERED=true
ENV PYTHONPATH=/app
# The app looks for config at ~/.config/gh_moderator.toml
# We will mount it via compose
CMD ["uvicorn", "tools.gh_moderator:app", "--host", "0.0.0.0", "--port", "8000"]
+7 -3
View File
@@ -5,6 +5,10 @@ webhook_secret = "secret"
gh_token = "token"
gh_repo = "owner/repo"
# AI harm classifier token
harm_classifier_url = "https://example.com/classify"
harm_classifier_token = "token"
[OpenAI]
org = "your-org-id"
key = "your-api-key"
model = "omni-moderation-latest"
threshold = 0.7
+6 -7
View File
@@ -11,13 +11,12 @@ import unicodedata
from datetime import datetime
from pathlib import Path
import openai
from openai 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
@@ -38,14 +37,14 @@ 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']
oa_client = OpenAI(
api_key=config['OpenAI']['key'],
organization=config['OpenAI']['org']
)
openai_model = config['OpenAI']['model']
@@ -112,7 +111,7 @@ async def process_event(event: str, obj: dict, id: str):
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]
res = oa_client.moderations.create(input=content, model=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")