Skip to content

Commit

Permalink
Merge branch 'main' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
Toni500github committed Oct 25, 2024
2 parents c96d4d0 + cab8498 commit f8ab497
Show file tree
Hide file tree
Showing 125 changed files with 4,629 additions and 4,424 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
sed -i "s#package Debian::Debhelper::Buildsystem::makefile#package Debian::Debhelper::Buildsystem::make#g" Debian/Debhelper/Buildsystem/make.pm
dpkg-buildpackage -us -uc
- name: Install test cufetch
- name: Install test customfetch
run: |
cd /tmp/customfetch-0.9.3.orig
sudo dpkg -i customfetch_0.9.3-1_amd64.deb
cufetch
cufetch --wrap-lines=0
build_ubuntu-latest:

Expand All @@ -45,7 +45,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install Packages
run: sudo apt-get update && sudo apt-get install build-essential cmake neofetch tree libgtk-3-dev pkg-config libgtkmm-3.0-dev libprocps-dev -y
run: sudo apt-get update && sudo apt-get install build-essential cmake neofetch tree libgtk-3-dev pkg-config libgtkmm-3.0-dev -y

- name: Clean
run: make clean
Expand All @@ -66,7 +66,7 @@ jobs:
printf "getting 0x5353 hexcode\n" && grep -nri "5353" /sys/class/ || true
- name: Test customfetch
run: ./build/debug/cufetch
run: ./build/debug/cufetch --wrap-lines=0

build_Arch-AUR:

Expand All @@ -78,7 +78,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install the packages
run: pacman -Syyu git sudo base-devel fakeroot pkgconf tree neofetch libprocps --noconfirm --needed
run: pacman -Syyu git sudo base-devel fakeroot pkgconf tree neofetch --noconfirm --needed

- name: get /etc/sudoers
run: |
Expand All @@ -103,7 +103,7 @@ jobs:
run: neofetch

- name: Test customfetch
run: cufetch
run: cufetch --wrap-lines=0

build_Arch:

Expand All @@ -115,7 +115,7 @@ jobs:
- uses: actions/checkout@v4

- name: Install the packages
run: pacman -Syyu git sudo binutils gdb base-devel fakeroot pkgconf tree neofetch fastfetch libprocps --noconfirm --needed
run: pacman -Syyu git sudo binutils gdb base-devel fakeroot pkgconf tree neofetch fastfetch --noconfirm --needed

- name: get /etc/sudoers
run: |
Expand Down Expand Up @@ -147,4 +147,24 @@ jobs:
printf "/etc/os-release\n" && cat /etc/os-release
- name: Test customfetch
run: ./build/debug/cufetch
run: ./build/debug/cufetch --wrap-lines=0

test-all-ascii-art:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Packages
run: sudo apt-get update && sudo apt-get install build-essential tree pkg-config -y

- name: Clean
run: make clean

- name: Compile
run: sudo make install DEBUG=0 VENDOR_TEST=0 GUI_MODE=0

# yes, i know too long
# the --color arguments are just for adding a missing color to the non done ascii
- name: Test all the ascii art logos
run: for f in assets/ascii/*; do printf "\e[31m%s\e[0m\n" "$f" && cufetch --wrap-lines=0 -s "$f" -D assets --color "c1=!#fff111" --color "c2=!#00ff1a" --color "c3=!#faa311" --color "c4=!#343412" --color "c5=!#fff311" --color "c6=!#faa3aa" && sleep 1; done
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4

- name: tree that thing
run: sudo apt install tree -y && tree
Expand Down
171 changes: 40 additions & 131 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,13 @@ cufetch

## Config (with explanation)

Read the manual `cufetch.1` or the comments in the default generated config for knowing more about the configuration in customfetch.\
This is only a brief explaination and preview.

Here's an example using my config

![image](screenshot.png)

The config:

```toml
[config]

Expand All @@ -116,13 +117,13 @@ layout = [
"${auto}Host: $<system.host>",
"${auto}Kernel: $<os.kernel>",
"${auto}Uptime: $<os.uptime>",
"${auto}Terminal: $<user.term>",
"${auto}Terminal: $<user.terminal>",
"${auto}Shell: $<user.shell>",
"${auto}Packages: $<os.pkgs>",
"${auto}Theme: $<theme-gtk-all.name>",
"${auto}Icons: $<theme-gtk-all.icons>",
"${auto}Font: $<theme-gtk-all.font>",
"${auto}Cursor: $<theme.cursor> ($<theme.cursor_size>px)",
"${auto}Cursor: $<theme.cursor>",
"${auto}WM: $<user.wm_name>",
"${auto}DE: $<user.de_name>",
"${auto}Disk(/): $<disk(/).disk>",
Expand All @@ -134,120 +135,11 @@ layout = [
"$<builtin.colors_light>" # light colors palette
]

# display ascii-art or image/gif (GUI only) near layout
# put "os" for displaying the OS ascii-art
# or the "/path/to/file" for displaying custom files
# or "off" for disabling ascii-art or image displaying
source-path = "os"

# Path to where we'll take all the distros/OSs ascii arts
# note: it MUST contain an "ascii" subdirectory
data-dir = "/usr/share/customfetch"

# The type of ASCII art to apply ("small", "old").
# Basically will add "_<type>" to the logo filename.
# It will return the regular linux ascii art if it doesn't exist.
# Leave empty it for regular.
ascii-logo-type = ""

# A char (or string) to use in $<builtin.title_sep>
title-sep = "-"

# A separator (or string) that when ecountered, will automatically
# reset color, aka. automatically add ${0} (only in layout)
# Make it empty for disabling
sep-reset = ":"

# Should we reset color after or before the separator?
# true = after ("test ->${0} ")
# false = before ("test ${0}-> ")
sep-reset-after = false

# Offset between the ascii art and the layout
offset = 5

# Padding between the start and the ascii art
logo-padding-left = 0

# Padding of the ascii art from the top
logo-padding-top = 0

# Padding of the layout from the top
layout-padding-top = 0

# Colors can be with: hexcodes (#55ff88) and for bold put '!' (!#55ff88)
# OR ANSI escape code colors like "\e[1;34m"
# remember to add ${0} where you want to reset color
black = "\e[1;30m"
red = "\e[1;31m"
green = "\e[1;32m"
yellow = "\e[1;33m"
blue = "\e[1;34m"
magenta = "\e[1;35m"
cyan = "\e[1;36m"
white = "\e[1;37m"

# $<os.uptime> config
[os.uptime]
# how to display the name of the uptime
# e.g: hours = "hrs" -> "Uptime: 3hrs"
days = " days"
hours = " hours"
mins = " mins"
secs = " seconds"

# $<os.pkgs> config
[os.pkgs]
# Ordered list of which packages installed count should be displayed in $<os.pkgs>
# remember to not enter the same name twice, else the world will finish
# Choices: pacman, flatpak, dpkg, apk
#
# Pro-tip: if your package manager isnt listed here, yet,
# use the bash command tag in the layout
# e.g "Packages: $(pacman -Q | wc -l) (pacman)"
pkg-managers = ["pacman", "dpkg", "flatpak"]

# Distros and package manager specific
# package manager paths for getting the packages count from path.
# They are arrayies so you can add multiple paths.
#
# If you don't know what these ares, leave them by default settings
pacman-dirs = ["/var/lib/pacman/local/"]
dpkg-files = ["/var/lib/dpkg/status"]
flatpak-dirs = ["/var/lib/flatpak/app/", "~/.local/share/flatpak/app/"]
apk-files = ["/var/lib/apk/db/installed"]

# GUI options
# note: customfetch needs to be compiled with GUI_MODE=1 (check with "cufetch --version")
[gui]
enable = false

# Font to be used
# syntax must be [FAMILY-LIST] [STYLE-OPTIONS] [SIZE]
# e.g "Liberation Mono Normal 12"
# check https://lazka.github.io/pgi-docs/Pango-1.0/classes/FontDescription.html#Pango.FontDescription for more infos
font = "Liberation Mono Normal 12"

# These are the colors palette you can use in the GUI mode.
# They can overwritte with ANSI escape code colors
# but they don't work with those, only hexcodes
black = "!#000005"
red = "!#ff2000"
green = "!#00ff00"
blue = "!#00aaff"
cyan = "!#00ffff"
yellow = "!#ffff00"
magenta = "!#f881ff"
white = "!#ffffff"

# Path to image as a background.
# put "disable" for disabling and use the theme color as background.
bg-image = "/tmp/idk.png"

```

We use the `config.toml` file, in there we got an array variable called "layout". That's the variable where you customize how the infos should be displayed.\
You have 5 tags:
In the config we got an array variable called "layout". That's the variable where you customize how the infos should be displayed.\
There are 5 tags:
* `$<module.member>` - Used for printing the value of a member of a module.
* `${color}` - Used for displaying text in a specific color.
* `$(bash command)` - Used to execute bash commands and print the output.
Expand All @@ -266,45 +158,62 @@ They can be used in the ascii art text file and layout, but how to use them?
e.g `$(echo \"hello world\" | cut -d' ' -f2)` will only print world

* **The conditional tag (`$[]`)** is used for displaying different outputs based on the comparison.\
Syntax MUST be `$[something,equalToSomethingElse,iftrue,ifalse]` with no spaces between commas.\
Syntax MUST be `$[something,equalToSomethingElse,iftrue,ifalse]` (**note**: putting spaces between commas can change the expected result).\
Each part can have a tag or anything else.\
e.g `$[$<user.name>,$(echo $USER),the name is correct,the name is NOT correct]`\
This is useful when on some terminal or WM the detection can be different than others\
This is useful when on some terminal or WM the detection can be different than others,\
Or maybe even on holidays for printing special texts\

* **The color tag (`${}`)** is used for which color to use for colorizing the text\
e.g `${red}hello world` will indeed print "hello world" in red (or the color you set in the variable).\
* **The color tag (`${}`)** is used for printing the text in a certain color.\
e.g `${red}hello world` will indeed print "hello world" in red (or the color you set in the variable/tag).\
The colors can be: <ins>black</ins>, <ins>red</ins>, <ins>green</ins>, <ins>blue</ins>, <ins>cyan</ins>, <ins>yellow</ins>, <ins>magenta</ins>, <ins>white</ins> and they can be configured in the config file.\
You can put a custom hex color e.g: `${#ff6622}`.\
**ANSI escape colors** can be used, e.g `\e[1;31m` or `\e[38;2;160;223;11m`.\
Alternatively, You can put a custom **hex color** e.g: `#ff6622`.\
You can also use them inside the tag, like `${!#343345}` or `${\e[1;31m}`.\
It's possible to enable multiple options, put these symbols before `#`:\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**Terminal and GUI**\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`b` - for making the color in the background\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`u` - for underline the text\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`u` - to underline the text\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`!` - for making the text bold\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`i` - for making the text italic\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`s` - for strikethrough text\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**GUI Only**\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`o` - for overline\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`a(value)` - for fg alpha (either a percentage value like `50%` or a plain integer between 1 and 65536)\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`L(value)` - for choosing an underline style (`none`, `single`, `double`, `low`, `error`)\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`U(value)` - for choosing the underline color (hexcode without #)\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`B(value)` - for choosing the bg color text (hexcode without #)\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`S(value)` - for choosing the strikethrough color (hexcode without #)\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`O(value)` - for choosing the overline color (hexcode without #)\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`A(value)` - for choosing the bg text alpha (either a percentage value like `50%` or a plain integer between 1 and 65536)\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`w(value)` - for choosing the font weight (`ultralight`, `light`, `normal`, `bold`, `ultrabold`, `heavy`, or a numeric weight)\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;**Terminal Only**\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;`l` - for blinking text\
\
Alternatively, ANSI escape codes can be used, e.g `\\e[1;31m` and `\\e[38;5;160m`\
(NOTE: 256 colors ANSI escape codes, those that have `\e[38` or `\e[48`, can't be used in GUI mode).\
To reset colors, use `${0}` for a normal reset or `${1}` for a bold reset.\
For auto coloring, depending on the ascii logo colors, use `${auto}`.\
They can be used for different colors too. So for getting the 2nd color of the ascii logo,\
use `${auto2}`, for the 4th one use `${auto4}` and so on.
If you're in GUI mode and the source path is an image, all the auto colors will be white
use `${auto2}`, for the 4th one use `${auto4}` and so on.\
If you're in GUI mode and the source path is an image, all the auto colors will be the same colors as distro ascii art.

* **The Percentage tag (`$%%`)** is used for displaying the percentage between 2 numbers.\
It **Must** contain a comma for separating the 2. They can be either be taken from a tag or it put yourself.\
For example: $%10,5%
For inverting colors of bad and great (red and green), before the first `%` a put `!`

Any `$` or brackets can be escaped with a backslash `\`
Any `$` or brackets can be escaped with a backslash `\`. You need to escape backslashes too :(\
**NOTE:** For having compatibility with GUI mode, you need to escape `<` (EXCEPT if you are using in a info tag, like `$<os.name>`) and `&`\
e.g `the number 50 is \< than 100 \& 98`
Won't affect the printing in terminal

# TODOs
* Color all ASCII arts (101/262) will take long ahh time
* Support images on terminal as logo (currently only in kitty)
* idk
* Color all ASCII arts (157/262) will take long ahh time

# Thanks
I would like to thanks:
* my best-friend [BurntRanch](https://github.com/BurntRanch/),\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For helping me initialize this project and motivate me for keep going\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;And also for making my customizability idea come true with the parsing.
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For helping me initialize this project and motivate me to keep going\
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;And also for making my customizability idea come true with the parser.

* the Better C++ [discord server](https://discord.gg/uSzTjkXtAM), \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For helping me improving the codebase and helping me with any issues I got,\
Expand Down
12 changes: 6 additions & 6 deletions assets/ascii/alpine_small.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
${blue} /\ /\
${blue} /${1}/ ${blue}\ \
${blue} /${1}/ ${blue}\ \
${blue}/${1}// ${blue}\ \
${1}// ${blue}\ \
${blue} \
${blue} /\\ /\\
${blue} /${1}/ ${blue}\\ \\
${blue} /${1}/ ${blue}\\ \\
${blue}/${1}// ${blue}\\ \\
${1}// ${blue}\\ \\
${blue} \\
2 changes: 1 addition & 1 deletion assets/ascii/android_small.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
${green} ;, ,;
${green} ';,.-----.,;'
${green} ,' ',
${green} / O O \
${green} / O O \\
${green}| |
${green}'-----------------'
22 changes: 11 additions & 11 deletions assets/ascii/antix.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
${red}
${red} \
${red} , - ~ ^ ~ - \ /
${red} , ' \ ' , /
${red} , \ '/
${red} , \ / ,
${red} ,___, \/ ,
${red} / | _ _ _|_ o /\ ,
${red}|, | / |/ | | | / \ ,
${red} \,_/\_/ | |_/|_/|_/_/ \,
${red} , / ,\
${red} , / , ' \
${red} \\
${red} , - ~ ^ ~ - \\ /
${red} , ' \\ ' , /
${red} , \\ '/
${red} , \\ / ,
${red} ,___, \\/ ,
${red} / | _ _ _|_ o /\\ ,
${red}|, | / |/ | | | / \\ ,
${red} \\,_/\\_/ | |_/|_/|_/_/ \\,
${red} , / ,\\
${red} , / , ' \\
${red} ' - , _ _ _ , '
10 changes: 5 additions & 5 deletions assets/ascii/arch_old.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ ${cyan} IJFDUFHJNXIXCDXDSV,${white} "DEBL
${cyan} [LKDSDJTDU=OUSCSBFLD.${white} '?ZWX,
${cyan} ,LMDSDSWH' `DCBOSI${white} DRDS],
${cyan} SDDFDFH' !YEWD,${white} )HDROD
${cyan} !KMDOCG \&GSU|${white}\_GFHRGO\'
${cyan} HKLSGP'${white} __${cyan}\TKM0${white}\GHRBV)'
${cyan}JSNRVW'${white} __+MNAEC${cyan}\IOI,${white}\BN'
${cyan}HELK['${white} __,=OFFXCBGHC${cyan}\FD)
${cyan}?KGHE ${white}\_-#DASDFLSV='${cyan} 'EF
${cyan} !KMDOCG \&GSU|${white}\\_GFHRGO\\'
${cyan} HKLSGP'${white} __${cyan}\\TKM0${white}\\GHRBV)'
${cyan}JSNRVW'${white} __+MNAEC${cyan}\\IOI,${white}\\BN'
${cyan}HELK['${white} __,=OFFXCBGHC${cyan}\\FD)
${cyan}?KGHE ${white}\\_-#DASDFLSV='${cyan} 'EF
${cyan}'EHTI !H
${cyan} `0F' '!
Loading

0 comments on commit f8ab497

Please sign in to comment.