Merge branch 'hykilpikonna:master' into fix-sed

This commit is contained in:
OldWorldOrdr 2023-09-21 19:34:11 -04:00 committed by GitHub
commit c77a05809e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 140 additions and 65 deletions

View file

@ -1,16 +1,35 @@
PREFIX = /usr PREFIX = /usr
MANDIR = $(PREFIX)/share/man MANDIR = $(PREFIX)/share/man
all: all: build
@echo Run \'make install\' to install Neofetch.
build:
python setup.py build
install: install:
python setup.py install --prefix=${PREFIX}
install-doc:
@mkdir -p $(DESTDIR)$(MANDIR)/man1
@cp -p docs/hyfetch.1 $(DESTDIR)$(MANDIR)/man1
@cp -p docs/neofetch.1 $(DESTDIR)$(MANDIR)/man1/neowofetch.1
uninstall:
@rm -rf $(DESTDIR)$(PREFIX)/bin/hyfetch
@rm -rf $(DESTDIR)$(PREFIX)/bin/neowofetch
@rm -rf $(DESTDIR)$(MANDIR)/man1/hyfetch.1*
@rm -rf $(DESTDIR)$(MANDIR)/man1/neowofetch.1*
clean:
rm -rf build/ HyFetch.egg-info
install-neofetch:
@mkdir -p $(DESTDIR)$(PREFIX)/bin @mkdir -p $(DESTDIR)$(PREFIX)/bin
@mkdir -p $(DESTDIR)$(MANDIR)/man1 @mkdir -p $(DESTDIR)$(MANDIR)/man1
@cp -p neofetch $(DESTDIR)$(PREFIX)/bin/neofetch @cp -p neofetch $(DESTDIR)$(PREFIX)/bin/neofetch
@cp -p neofetch.1 $(DESTDIR)$(MANDIR)/man1 @cp -p docs/neofetch.1 $(DESTDIR)$(MANDIR)/man1
@chmod 755 $(DESTDIR)$(PREFIX)/bin/neofetch @chmod 755 $(DESTDIR)$(PREFIX)/bin/neofetch
uninstall: uninstall-neofetch:
@rm -rf $(DESTDIR)$(PREFIX)/bin/neofetch @rm -rf $(DESTDIR)$(PREFIX)/bin/neofetch
@rm -rf $(DESTDIR)$(MANDIR)/man1/neofetch.1* @rm -rf $(DESTDIR)$(MANDIR)/man1/neofetch.1*

73
docs/hyfetch.1 Normal file
View file

@ -0,0 +1,73 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
.TH VERSION "1" "August 2023" "Version is 1.4.10" "User Commands"
.SH NAME
Version \- manual page for Version is 1.4.10
.SH DESCRIPTION
usage: hyfetch [\-h] [\-c] [\-C CONFIG_FILE]
.IP
[\-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,gynesexual,androsexual,gendervoid,voidgirl,voidboy,nonhuman\-unity,beiyang,burger}]
[\-m {8bit,rgb}]
[\-b {qwqfetch,neofetch,fastfetch,fastfetch\-old}] [\-\-args ARGS]
[\-\-c\-scale SCALE] [\-\-c\-set\-l LIGHT] [\-\-c\-overlay] [\-V] [\-\-june]
[\-\-debug] [\-\-distro DISTRO] [\-\-ascii\-file ASCII_FILE]
.PP
hyfetch \- neofetch with flags <3
.SS "options:"
.TP
\fB\-h\fR, \fB\-\-help\fR
show this help message and exit
.TP
\fB\-c\fR, \fB\-\-config\fR
Configure hyfetch
.TP
\fB\-C\fR CONFIG_FILE, \fB\-\-config\-file\fR CONFIG_FILE
Use another config file
.TP
\fB\-p\fR {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,gynesexual,androsexual,gendervoid,voidgirl,voidboy,nonhuman\-unity,beiyang,burger}, \fB\-\-preset\fR {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,gynesexual,androsexual,gendervoid,voidgirl,voidboy,nonhuman\-unity,beiyang,burger}
Use preset
.TP
\fB\-m\fR {8bit,rgb}, \fB\-\-mode\fR {8bit,rgb}
Color mode
.TP
\fB\-b\fR {qwqfetch,neofetch,fastfetch,fastfetch\-old}, \fB\-\-backend\fR {qwqfetch,neofetch,fastfetch,fastfetch\-old}
Choose a *fetch backend
.TP
\fB\-\-args\fR ARGS
Additional arguments pass\-through to backend
.TP
\fB\-\-c\-scale\fR SCALE
Lighten colors by a multiplier
.TP
\fB\-\-c\-set\-l\fR LIGHT
Set lightness value of the colors
.TP
\fB\-\-c\-overlay\fR
Use experimental overlay color adjusting instead of
HSL lightness
.TP
\fB\-V\fR, \fB\-\-version\fR
Check version
.TP
\fB\-\-june\fR
Show pride month easter egg
.TP
\fB\-\-debug\fR
Debug mode
.TP
\fB\-\-distro\fR DISTRO, \fB\-\-test\-distro\fR DISTRO
Test for a specific distro
.TP
\fB\-\-ascii\-file\fR ASCII_FILE
Use a specific file for the ascii art
.SH "SEE ALSO"
The full documentation for
.B Version
is maintained as a Texinfo manual. If the
.B info
and
.B Version
programs are properly installed at your site, the command
.IP
.B info Version
.PP
should give you access to the complete manual.

View file

@ -27,7 +27,7 @@ def check_config(path) -> Config:
""" """
if path.is_file(): if path.is_file():
try: try:
return Config.from_dict(json.loads(CONFIG_PATH.read_text('utf-8'))) return Config.from_dict(json.loads(path.read_text('utf-8')))
except KeyError: except KeyError:
return create_config() return create_config()
@ -401,6 +401,8 @@ def run():
config.mode = args.mode config.mode = args.mode
if args.backend: if args.backend:
config.backend = args.backend config.backend = args.backend
if args.args:
config.args = args.args
# Override global color mode # Override global color mode
GLOBAL_CFG.color_mode = config.mode GLOBAL_CFG.color_mode = config.mode
@ -421,7 +423,7 @@ def run():
try: try:
asc = get_distro_ascii() if not args.ascii_file else Path(args.ascii_file).read_text("utf-8") 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) asc = config.color_align.recolor_ascii(asc, preset)
neofetch_util.run(asc, config.backend, args.args or '') neofetch_util.run(asc, config.backend, config.args or '')
except Exception as e: except Exception as e:
print(f'Error: {e}') print(f'Error: {e}')
traceback.print_exc() traceback.print_exc()

View file

@ -16,6 +16,7 @@ class Config:
lightness: float | None = None lightness: float | None = None
color_align: ColorAlignment = field(default_factory=lambda: ColorAlignment('horizontal')) color_align: ColorAlignment = field(default_factory=lambda: ColorAlignment('horizontal'))
backend: BackendLiteral = "neofetch" backend: BackendLiteral = "neofetch"
args: str | None = None
distro: str | None = None distro: str | None = None
pride_month_shown: list[int] = field(default_factory=list) # This is deprecated, see issue #136 pride_month_shown: list[int] = field(default_factory=list) # This is deprecated, see issue #136
pride_month_disable: bool = False pride_month_disable: bool = False

View file

@ -850,7 +850,7 @@ image_source="auto"
# Flag: --ascii_distro # Flag: --ascii_distro
# #
# NOTE: AIX, AlmaLinux, Alpine, Alter, Amazon, AmogOS, Anarchy, Android, Antergos, antiX, AOSC OS, # NOTE: AIX, AlmaLinux, Alpine, Alter, Amazon, AmogOS, Anarchy, Android, Antergos, antiX, AOSC OS,
# AOSC OS/Retro, Aperio GNU/Linux, Aperture, Apricity, Arch, ArchBox, Archcraft, archcraft_ascii, # Afterglow, Aperio GNU/Linux, Aperture, Apricity, Arch, ArchBox, Archcraft, archcraft_ascii,
# archcraft_minimal, ARCHlabs, ArchMerge, ArchStrike, ArcoLinux, ArseLinux, Artix, Arya, Asahi, # archcraft_minimal, ARCHlabs, ArchMerge, ArchStrike, ArcoLinux, ArseLinux, Artix, Arya, Asahi,
# Aster, AsteroidOS, astOS, Astra Linux, Athena, Bedrock, BigLinux, Bitrig, BlackArch, blackPanther, # Aster, AsteroidOS, astOS, Astra Linux, Athena, Bedrock, BigLinux, Bitrig, BlackArch, blackPanther,
# BLAG, BlankOn, BlueLight, Bodhi, bonsai, BSD, BunsenLabs, CachyOS, Calculate, CalinixOS, Carbs, # BLAG, BlankOn, BlueLight, Bodhi, bonsai, BSD, BunsenLabs, CachyOS, Calculate, CalinixOS, Carbs,
@ -6316,7 +6316,7 @@ ASCII:
--ascii_distro distro Which Distro's ascii art to print --ascii_distro distro Which Distro's ascii art to print
NOTE: AIX, AlmaLinux, Alpine, Alter, Amazon, AmogOS, Anarchy, NOTE: AIX, AlmaLinux, Alpine, Alter, Amazon, AmogOS, Anarchy,
Android, Antergos, antiX, AOSC OS, AOSC OS/Retro, Aperio GNU/Linux, Android, Antergos, antiX, AOSC OS, Afterglow, Aperio GNU/Linux,
Aperture, Apricity, Arch, ArchBox, Archcraft, archcraft_ascii, Aperture, Apricity, Arch, ArchBox, Archcraft, archcraft_ascii,
archcraft_minimal, ARCHlabs, ArchMerge, ArchStrike, ArcoLinux, archcraft_minimal, ARCHlabs, ArchMerge, ArchStrike, ArcoLinux,
ArseLinux, Artix, Arya, Asahi, Aster, AsteroidOS, astOS, Astra ArseLinux, Artix, Arya, Asahi, Aster, AsteroidOS, astOS, Astra
@ -7194,68 +7194,47 @@ ${c1}
EOF EOF
;; ;;
"AOSC OS/Retro"*) "Afterglow"*)
set_colors 4 7 1 3 set_colors 5 1 3 4
read -rd '' ascii_data <<'EOF' read -rd '' ascii_data <<'EOF'
${c2} ......... ${c2} .
................... ${c1}. ${c2}.{!
.....................${c1}################${c2} ${c1}.L! ${c2}J@||*
.............. ....${c1}################${c2} ${c1}gJJJJL` ${c2}g@FFS"
.............. ...${c1}################${c2} ${c1},@FFFJF`${c2}_g@@LLP`
............. ..${c1}****************${c2} ${c1}_@FFFFF`${c2}_@@@@@P` ${c4}.
............ . .${c1}****************${c2} ${c1}J@@@LLF ${c2}_@@@@@P` ${c4}.J!
........... ... ${c1}................${c2} ${c1}g@@@@@" ${c2}_@@@@@P`${c3}. ${c4}.L|||*
.......... ..... ${c1}...............${c2} ${c1}g@@@@M" ${c2}"VP`${c3}.L! ${c4}<@JJJJ`
......... ....... ... ${c1}"@N" ${c3}:||||! ${c4}JFFFFS"
.${c3}...... ${c2}. ${c3}.{JJ||F`${c4}_gFFFF@'
${c3}..... .....${c2}.... ${c4}........... ${c3}.@FJJJF`${c4},@LFFFF`
${c3}.... ......${c2}. ${c4}........... ${c3}_@FFFFF ${c4}VLLLP`
${c3}... ....... ${c4}........... ${c3}J@@LL@" ${c4}`"
${c3}................ ${c4}*********** ${c3}V@@"
${c3}................ ${c4}###########
${c3}****************
${c3}################
EOF
;;
"aoscosretro_small")
set_colors 4 7 1 3
read -rd '' ascii_data <<'EOF'
${c2} _____ ${c1}_____${c2}
-' '-${c1}| |${c2}
/ ___ ${c1}| |${c2}
| / _ \\${c1}|_____|${c2}
' / /_\\ \\
\\ / _____ \\${c4}___
${c3}|${c2}/_/ ${c3}| ${c4}| |
${c3}| | ${c4}|___|
${c3}|_____|
EOF EOF
;; ;;
"AOSC OS"*) "AOSC OS"*)
set_colors 4 7 1 set_colors 4 0 1 3
read -rd '' ascii_data <<'EOF' read -rd '' ascii_data <<'EOF'
${c2} .:+syhhhhys+:. ${c2} __
.ohNMMMMMMMMMMMMMMNho. ${c2}gpBBBBBBBBBP
`+mMMMMMMMMMMmdmNMMMMMMMMm+` ${c2}_gBBBBBBBBBRP
+NMMMMMMMMMMMM/ `./smMMMMMN+ ${c2}4BBBBBBBBRP ${c4},_____
.mMMMMMMMMMMMMMMo -yMMMMMm. ${c2}`"" ${c4}_g@@@@@@@@@@@@@%g>
:NMMMMMMMMMMMMMMMs .hMMMMN: ${c4}__@@@@@@@@@@@@@@@@P" ${c1}___
.NMMMMhmMMMMMMMMMMm+/- oMMMMN. ${c4}_g@@@@@@@@@@@@@@@N"` ${c1}_gN@@@@@N^
dMMMMs ./ymMMMMMMMMMMNy. sMMMMd ${c4}_w@@@@@@@@@@@@@@@@P" ${c1}_g@@@@@@@P"
-MMMMN` oMMMMMMMMMMMN: `NMMMM- ${c4}_g@@@@@@@@@@@@@@@N"` ${c1}VMNN@NNNM^`
/MMMMh NMMMMMMMMMMMMm hMMMM/ ${c4}^MMM@@@@@@@@@@@MP" ${c3},ggppww__
/MMMMh NMMMMMMMMMMMMm hMMMM/ ${c4}`""""" ${c3}_wNNNNNNNNNNNNNNNNNNN
-MMMMN` :MMMMMMMMMMMMy. `NMMMM- ${c3}_gBNNNNNNNNNNNNNNNNNP"
dMMMMs .yNMMMMMMMMMMMNy/. sMMMMd ${c3}_wNNNNNNNNNNNNNNNNNNMP`
.NMMMMo -/+sMMMMMMMMMMMmMMMMN. ${c3}_gBNNNNNNNNNNNNNNNNNP"
:NMMMMh. .MMMMMMMMMMMMMMMN: ${c3}_wNNNNNNNNNNNNNNNNNNNM^
.mMMMMMy- NMMMMMMMMMMMMMm. ${c3}""Y^^MNNNNNNNNNNNNP`
+NMMMMMms/.` mMMMMMMMMMMMN+ ${c3}`"""""""
`+mMMMMMMMMNmddMMMMMMMMMMm+`
.ohNMMMMMMMMMMMMMMNho.
.:+syhhhhys+:.
EOF EOF
;; ;;

View file

@ -92,7 +92,8 @@ def finalize_neofetch():
# 2. Regenerate man page # 2. Regenerate man page
print('Regenerating neofetch man page...') print('Regenerating neofetch man page...')
Path('neofetch.1').write_text(subprocess.check_output(['help2man', './neofetch']).decode()) Path('docs/neofetch.1').write_text(subprocess.check_output(['help2man', './neofetch']).decode())
Path('docs/hyfetch.1').write_text(subprocess.check_output(['help2man', 'python3 -m hyfetch']).decode())
# 3. Reformat readme links # 3. Reformat readme links
print('Reformatting readme links...') print('Reformatting readme links...')