diff --git a/Makefile b/Makefile index 6c4a8dd..7133fd8 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,9 @@ PREFIX ?= /usr MANPREFIX ?= $(PREFIX)/share/man APPPREFIX ?= $(PREFIX)/share/applications VARS ?= -GUI_MODE ?= 0 -DEBUG ?= 1 +DEBUG ?= 0 +GUI_MODE ?= 0 VENDOR_TEST ?= 0 DEVICE_TEST ?= 0 # https://stackoverflow.com/a/1079861 diff --git a/assets/config-examples/config_cool.toml b/assets/config-examples/config_cool.toml index 834dcdf..2c39d7f 100644 --- a/assets/config-examples/config_cool.toml +++ b/assets/config-examples/config_cool.toml @@ -3,51 +3,60 @@ # here is how it works: # the variable "layout" is used for showing the infos # as like as the user want, no limitation. -# inside here there are 4 "tags": $<> $() ${} $[] +# inside here there are 5 "tags": $<> $() ${} $[] $%% -# $<> lets you access a member of a module +# The Info tag $<> lets you print the value of a member of a module. # e.g $ will print the username, $ will print the kernel version and so on. -# run "cufetch -l" for a list of builti-in modules +# All the modules and their members are listed in the `--list-modules` argument -# $() let's you execute bash commands -# e.g $(echo \"hello world\") will indeed echo out Hello world. +# The Bash command tag $() will execute bash commands and print the output. +# e.g $(echo \"hello world\") will indeed echo out hello world. # you can even use pipes # e.g $(echo \"hello world\" | cut -d' ' -f2) will only print world -# $[] is used for equal conditional check -# syntax MUST be $[something,equalToSomethingElse,iftrue,ifalse] with no spaces between commas ',' +# The Conditional tag $[] is used to display different outputs based on the comparison. +# syntax MUST be $[something,equalToSomethingElse,iftrue,ifalse] +# note: putting spaces between commas, could change the expected result +# # Each part can have a tag or anything else. # e.g $[$,$(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 -# ${} is used for which color to use for colorizing the text +# The Color tag ${} is used for printing the text of a certain color. # e.g "${red}hello world" will indeed print "hello world" in red (or the color you set in the variable) -# you can even put a custom hex color e.g: ${#ff6622} +# The colors can be predefined such as: black, red, green, blue, cyan, yellow, magenta, white. +# They can be configured in the config file. +# +# They can have hexcodes colors (e.g "#5522dd"). +# You can apply special effects to colors by using the following symbols before the '#' in hex codes: +# * b for background color. +# * u for underline the text +# * ! for bold text +# * i for italic text # -# It's possible to enable multiple options, put these symbols before '#': -# * b, for making the color in the background -# * u, for underline the text -# * !, for making the text bold -# * i, for making the text italic +# Alternatively, ANSI escape codes can be used, e.g ${\e[1;32m} or ${\e[0;34m}. +# NOTE: 256-color ANSI escape codes (those that starts with \\[38 or \\[48) cannot be used in GUI mode. # -# OR bash escape code colors e.g ${\e[1;32m} or ${\e[0;34m}. -# 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. +# To reset colors, use ${0} for a full reset or ${1} for a bold reset. +# +# To use the colors that the ascii art logo uses, use ${auto} for getting the 1st color, ${auto4} for the 4th one and so on. +# If you're using GUI mode and wants to display a custom source that's an image, all the auto colors will be the same colors as the distro ones -# Little FAQ -# Q: "but then if I want to make only some words/chars in a color and the rest normal?" -# A: there is ${0}. e.g "${red}hello ${0}world, yet again" will only print "hello" in red, and then "world, yet again" normal -# Or, if you want to reset color and make it bold, use ${1} +# 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: $%50,100% +# For inverting colors of bad and great (red and green), before the last '%' put '!' +# without quotes ofc +# Little FAQ # Q: "Why when I use something like "$ <- Kernel" it won't work on GUI mode?" # A: replace "<-" with "\\<-". It won't affect the printing in terminal # Old pipelines screensavers inspired layout # This is really system depedent layout = [ - "${red}$${0}@${cyan}$", - "$", + "$", + "$", "${red}$ ${cyan} $${cyan} \\<- Arch ", "${red} ^ ${green} $ \\<━━━┓", "${red} | ${green}┃", @@ -74,10 +83,9 @@ layout = [ " ┃ ${!#03ff93}RAM usage -> $ ┃", " ┃ ┃", " ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛", - - "", - "${\e[40m} ${\e[41m} ${\e[42m} ${\e[43m} ${\e[44m} ${\e[45m} ${\e[46m} ${\e[47m} ", # normal colors - "${\e[100m} ${\e[101m} ${\e[102m} ${\e[103m} ${\e[104m} ${\e[105m} ${\e[106m} ${\e[107m} " # light colors + "", + "$", # normal colors + "$" # light colors ] # display ascii-art or image/gif (GUI only) near layout @@ -121,9 +129,7 @@ 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 +# Colors black = "\e[1;30m" red = "\e[1;31m" green = "\e[1;32m" @@ -174,9 +180,9 @@ enable = false # 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 +# These are the colors you can use in the GUI mode. +# They overwrite the normal colors from above, +# but they can only have hexcodes colors black = "!#000005" red = "!#ff2000" green = "!#00ff00" diff --git a/assets/config-examples/config_modified.toml b/assets/config-examples/config_modified.toml deleted file mode 100644 index 819926e..0000000 --- a/assets/config-examples/config_modified.toml +++ /dev/null @@ -1,178 +0,0 @@ -[config] -# customfetch is designed with customizability in mind -# here is how it works: -# the variable "layout" is used for showing the infos -# as like as the user want, no limitation. -# inside here there are 4 "tags": $<> $() ${} $[] - -# $<> lets you access a member of a module -# e.g $ will print the username, $ will print the kernel version and so on. -# run "cufetch -l" for a list of builti-in modules - -# $() let's you execute bash commands -# e.g $(echo \"hello world\") will indeed echo out Hello world. -# you can even use pipes -# e.g $(echo \"hello world\" | cut -d' ' -f2) will only print world - -# $[] is used for equal conditional check -# syntax MUST be $[something,equalToSomethingElse,iftrue,ifalse] with no spaces between commas ',' -# Each part can have a tag or anything else. -# e.g $[$,$(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 - -# ${} 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) -# you can even put a custom hex color e.g: ${#ff6622} -# -# It's possible to enable multiple options, put these symbols before '#': -# * b, for making the color in the background -# * u, for underline the text -# * !, for making the text bold -# * i, for making the text italic -# -# OR bash escape code colors e.g ${\e[1;32m} or ${\e[0;34m}. -# 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. - -# Little FAQ -# Q: "but then if I want to make only some words/chars in a color and the rest normal?" -# A: there is ${0}. e.g "${red}hello ${0}world, yet again" will only print "hello" in red, and then "world, yet again" normal -# Or, if you want to reset color and make it bold, use ${1} - -# Q: "Why when I use something like "$ <- Kernel" it won't work on GUI mode?" -# A: replace "<-" with "\\<-". It won't affect the printing in terminal - -layout = [ - "${red}$${0}@${cyan}$", - "$", - "${red}OS -> $ $", - "${yellow}Host -> $", - "${!#33ffa1}Init -> $", - "${green}Kernel -> $", - "${cyan}Uptime -> $", - "${!#fff220}Terminal -> $", - "${cyan}Shell -> $", - "${cyan}Packages -> $", - "${!#448aa4}Disk (/) -> $", - "${!#34affd}Theme -> $", - "${!#34afff}Icons -> $", - "${!#fff1ba}WM -> $", - "${!#ffff2a}DE -> $", - "${magenta}CPU -> $", - "${blue}GPU -> $", - "${!#03ff93}RAM usage -> $", - "", - "${\e[40m} ${\e[41m} ${\e[42m} ${\e[43m} ${\e[44m} ${\e[45m} ${\e[46m} ${\e[47m} ", # normal colors - "${\e[100m} ${\e[101m} ${\e[102m} ${\e[103m} ${\e[104m} ${\e[105m} ${\e[106m} ${\e[107m} " # light colors -] - -# 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 "_" 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 $ -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" - -# $ 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" - -# $ config -[os.pkgs] -# Ordered list of which packages installed count should be displayed in $ -# 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 (which is enabled by default) -[gui] -enable = false - -# Font to be used (Strongly reccomend family "Liberation Mono") -# 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 Light 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 = "disable" diff --git a/assets/config-examples/config_simple.toml b/assets/config-examples/config_simple.toml index d498fd4..6e7cd3b 100644 --- a/assets/config-examples/config_simple.toml +++ b/assets/config-examples/config_simple.toml @@ -3,59 +3,67 @@ # here is how it works: # the variable "layout" is used for showing the infos # as like as the user want, no limitation. -# inside here there are 4 "tags": $<> $() ${} $[] +# inside here there are 5 "tags": $<> $() ${} $[] $%% -# $<> lets you access a member of a module +# The Info tag $<> lets you print the value of a member of a module. # e.g $ will print the username, $ will print the kernel version and so on. -# run "cufetch -l" for a list of builti-in modules +# All the modules and their members are listed in the `--list-modules` argument -# $() let's you execute bash commands -# e.g $(echo \"hello world\") will indeed echo out Hello world. +# The Bash command tag $() will execute bash commands and print the output. +# e.g $(echo \"hello world\") will indeed echo out hello world. # you can even use pipes # e.g $(echo \"hello world\" | cut -d' ' -f2) will only print world -# $[] is used for equal conditional check -# syntax MUST be $[something,equalToSomethingElse,iftrue,ifalse] with no spaces between commas ',' +# The Conditional tag $[] is used to display different outputs based on the comparison. +# syntax MUST be $[something,equalToSomethingElse,iftrue,ifalse] +# note: putting spaces between commas, could change the expected result +# # Each part can have a tag or anything else. # e.g $[$,$(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 -# ${} is used for which color to use for colorizing the text +# The Color tag ${} is used for printing the text of a certain color. # e.g "${red}hello world" will indeed print "hello world" in red (or the color you set in the variable) -# you can even put a custom hex color e.g: ${#ff6622} +# The colors can be predefined such as: black, red, green, blue, cyan, yellow, magenta, white. +# They can be configured in the config file. +# +# They can have hexcodes colors (e.g "#5522dd"). +# You can apply special effects to colors by using the following symbols before the '#' in hex codes: +# * b for background color. +# * u for underline the text +# * ! for bold text +# * i for italic text +# +# Alternatively, ANSI escape codes can be used, e.g ${\e[1;32m} or ${\e[0;34m}. +# NOTE: 256-color ANSI escape codes (those that starts with \\[38 or \\[48) cannot be used in GUI mode. # -# It's possible to enable multiple options, put these symbols before '#': -# * b, for making the color in the background -# * u, for underline the text -# * !, for making the text bold -# * i, for making the text italic +# To reset colors, use ${0} for a full reset or ${1} for a bold reset. # -# OR bash escape code colors e.g ${\e[1;32m} or ${\e[0;34m}. -# 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. +# To use the colors that the ascii art logo uses, use ${auto} for getting the 1st color, ${auto4} for the 4th one and so on. +# If you're using GUI mode and wants to display a custom source that's an image, all the auto colors will be the same colors as the distro ones -# Little FAQ -# Q: "but then if I want to make only some words/chars in a color and the rest normal?" -# A: there is ${0}. e.g "${red}hello ${0}world, yet again" will only print "hello" in red, and then "world, yet again" normal -# Or, if you want to reset color and make it bold, use ${1} +# 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: $%50,100% +# For inverting colors of bad and great (red and green), before the last '%' put '!' +# without quotes ofc +# Little FAQ # Q: "Why when I use something like "$ <- Kernel" it won't work on GUI mode?" # A: replace "<-" with "\\<-". It won't affect the printing in terminal layout = [ -# "${red}$${0}@${cyan}$", - "${\e[1m}┌────────── Hardware Information ──────────┐", + "${1}┌────────── Hardware Information ──────────┐", "${yellow} 󰌢  $", "${magenta} 󰍛  $", "${blue} 󰘚  $", "${!#03ff93}   $", - "${\e[1m}├────────── Software Information ──────────┤", + "${1}├────────── Software Information ──────────┤", "${red}   $ $", "${cyan} 󰊠  $", - "${cyan}   $ $", - "${\e[1m}└──────────────────────────────────────────┘", - " ${\e[30m}  ${\e[31m}  ${\e[32m}  ${\e[33m}  ${\e[34m}  ${\e[35m}  ${\e[36m}  ${\e[37m}  ", # normal colors + "${cyan}   $", + "${1}└──────────────────────────────────────────┘", + "$" ] # display ascii-art or image/gif (GUI only) near layout @@ -80,7 +88,7 @@ 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 = ":" +sep-reset = "" # Should we reset color after or before the separator? # true = after ("test ->${0} ") @@ -99,9 +107,7 @@ 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 +# Colors black = "\e[1;30m" red = "\e[1;31m" green = "\e[1;32m" @@ -152,17 +158,17 @@ enable = false # check https://lazka.github.io/pgi-docs/Pango-1.0/classes/FontDescription.html#Pango.FontDescription for more infos font = "Liberation Mono Normal Light 12" -# These are the colors palette you can use in the GUI mode. -# They can overwritte with ANSI escape code colors -# in the layout variable or ascii-art -black = "!#000005" -red = "!#ff2000" -green = "!#00ff00" -blue = "!#00aaff" -cyan = "!#00ffff" -yellow = "!#ffff00" +# These are the colors you can use in the GUI mode. +# They overwrite the normal colors from above, +# but they can only have hexcodes colors +black = "!#000005" +red = "!#ff2000" +green = "!#00ff00" +blue = "!#00aaff" +cyan = "!#00ffff" +yellow = "!#ffff00" magenta = "!#f881ff" -white = "!#ffffff" +white = "!#ffffff" # Path to image as a background. # put "disable" for disabling and use the theme color as background. diff --git a/assets/config-examples/nitch_like_config.toml b/assets/config-examples/nitch_like_config.toml index 392f039..7a0aab5 100644 --- a/assets/config-examples/nitch_like_config.toml +++ b/assets/config-examples/nitch_like_config.toml @@ -3,43 +3,52 @@ # here is how it works: # the variable "layout" is used for showing the infos # as like as the user want, no limitation. -# inside here there are 4 "tags": $<> $() ${} $[] +# inside here there are 5 "tags": $<> $() ${} $[] $%% -# $<> lets you access a member of a module +# The Info tag $<> lets you print the value of a member of a module. # e.g $ will print the username, $ will print the kernel version and so on. -# run "cufetch -l" for a list of builti-in modules +# All the modules and their members are listed in the `--list-modules` argument -# $() let's you execute bash commands -# e.g $(echo \"hello world\") will indeed echo out Hello world. +# The Bash command tag $() will execute bash commands and print the output. +# e.g $(echo \"hello world\") will indeed echo out hello world. # you can even use pipes # e.g $(echo \"hello world\" | cut -d' ' -f2) will only print world -# $[] is used for equal conditional check -# syntax MUST be $[something,equalToSomethingElse,iftrue,ifalse] with no spaces between commas ',' +# The Conditional tag $[] is used to display different outputs based on the comparison. +# syntax MUST be $[something,equalToSomethingElse,iftrue,ifalse] +# note: putting spaces between commas, could change the expected result +# # Each part can have a tag or anything else. # e.g $[$,$(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 -# ${} is used for which color to use for colorizing the text +# The Color tag ${} is used for printing the text of a certain color. # e.g "${red}hello world" will indeed print "hello world" in red (or the color you set in the variable) -# you can even put a custom hex color e.g: ${#ff6622} +# The colors can be predefined such as: black, red, green, blue, cyan, yellow, magenta, white. +# They can be configured in the config file. +# +# They can have hexcodes colors (e.g "#5522dd"). +# You can apply special effects to colors by using the following symbols before the '#' in hex codes: +# * b for background color. +# * u for underline the text +# * ! for bold text +# * i for italic text +# +# Alternatively, ANSI escape codes can be used, e.g ${\e[1;32m} or ${\e[0;34m}. +# NOTE: 256-color ANSI escape codes (those that starts with \\[38 or \\[48) cannot be used in GUI mode. # -# It's possible to enable multiple options, put these symbols before '#': -# * b, for making the color in the background -# * u, for underline the text -# * !, for making the text bold -# * i, for making the text italic +# To reset colors, use ${0} for a full reset or ${1} for a bold reset. # -# OR bash escape code colors e.g ${\e[1;32m} or ${\e[0;34m}. -# 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. +# To use the colors that the ascii art logo uses, use ${auto} for getting the 1st color, ${auto4} for the 4th one and so on. +# If you're using GUI mode and wants to display a custom source that's an image, all the auto colors will be the same colors as the distro ones -# Little FAQ -# Q: "but then if I want to make only some words/chars in a color and the rest normal?" -# A: there is ${0}. e.g "${red}hello ${0}world, yet again" will only print "hello" in red, and then "world, yet again" normal -# Or, if you want to reset color and make it bold, use ${1} +# 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: $%50,100% +# For inverting colors of bad and great (red and green), before the last '%' put '!' +# without quotes ofc +# Little FAQ # Q: "Why when I use something like "$ <- Kernel" it won't work on GUI mode?" # A: replace "<-" with "\\<-". It won't affect the printing in terminal @@ -58,7 +67,7 @@ layout = [ "│${green}  ${0} GPU │ ${green} $", "│${magenta} 󰍛 ${0} memory │ ${magenta} $", "├───────────┤", - "│ 󰏘 colors │ ${\e[30m}  ${\e[31m}  ${\e[32m}  ${\e[33m}  ${\e[34m}  ${\e[35m}  ${\e[36m}  ${\e[37m}  ", + "│ 󰏘 colors │ $", "╰───────────╯" ] @@ -84,7 +93,7 @@ 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 = ":" +sep-reset = "" # Should we reset color after or before the separator? # true = after ("test ->${0} ") @@ -103,9 +112,7 @@ 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 +# Colors black = "\e[1;30m" red = "\e[1;31m" green = "\e[1;32m" @@ -156,17 +163,17 @@ enable = false # 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" +# These are the colors you can use in the GUI mode. +# They overwrite the normal colors from above, +# but they can only have hexcodes colors +black = "!#000005" +red = "!#ff2000" +green = "!#00ff00" +blue = "!#00aaff" +cyan = "!#00ffff" +yellow = "!#ffff00" magenta = "!#f881ff" -white = "!#ffffff" +white = "!#ffffff" # Path to image as a background. # put "disable" for disabling and use the theme color as background. diff --git a/cufetch.1 b/cufetch.1 index e85b807..4b5efb9 100644 --- a/cufetch.1 +++ b/cufetch.1 @@ -12,7 +12,7 @@ How does it work? .PP We use the \fBconfig.toml\fR file, in there we got an array variable called "layout". That's the variable where you customize how the infos should be displayed. .PP -You have 4 tags: +You have 5 tags: .br * \fB$\fR - Used for printing the value of a member of a module. .br @@ -21,6 +21,8 @@ You have 4 tags: * \fB$(bash command)\fR - Used to execute bash commands and print the output. .br * \fB$[something,equalToSomething,ifTrue,ifFalse]\fR - Conditional tag to display different outputs based on the comparison. +.br +* \fB$%n1,n2%\fR - Used to print the percentage and print with colors .PP They can be used in the ascii art text file and layout, but how to use them? .br @@ -28,61 +30,69 @@ Here's a simple bare-minimal example: .br layout = [ .br - "My OS is $, and username is $", + "My OS is $, and username is $", +.br + "The color of the following text will be ${red}red", +.br + "This is a $(echo \\"bash command\\")", .br - "The color of the following text will be ${red}red", + "Check if \\\\$ is correct: $[$,toni,indeed,it's not toni but $(echo $USER)]", .br - "And this is a $(echo \\"bash command\\")" + "The discount between 50$ and 100$ is $%50,100%" .br ] .PP -The \fBInfo tag $<>\fR will prints a member of a module. All the modules and their members are listed in the `--list-modules` argument +* The \fBInfo tag $<>\fR will prints the value of a member of a module. +.br + All the modules and their members are listed in the `--list-modules` argument .PP -The \fBColor tag ${}\fR is used for printing the text of a certain color. +* The \fBColor tag ${}\fR is used for printing the text of a certain color. .br -The colors can be predefined such as: \fIblack\fR, \fIred\fR, \fIgreen\fR, \fIblue\fR, \fIcyan\fR, \fIyellow\fR, \fImagenta\fR, \fIwhite\fR and they can be configured in the config file. + The colors can be predefined such as: \fIblack\fR, \fIred\fR, \fIgreen\fR, \fIblue\fR, \fIcyan\fR, \fIyellow\fR, \fImagenta\fR, \fIwhite\fR and they can be configured in the config file. .br -They can have hexcodes colors (e.g "#5522dd"). + They can have hexcodes colors (e.g "#5522dd"). .br -You can apply special effects to colors by using the following symbols before the '#' in hex codes: + You can apply special effects to colors by using the following symbols before the '#' in hex codes: .br -* \fBb\fR for background color. + * \fBb\fR for background color. .br -* \fBu\fR for underlining the text. + * \fBu\fR for underlining the text. .br -* \fB!\fR for bold text. + * \fB!\fR for bold text. .br -* \fBi\fR for italic text. + * \fBi\fR for italic text. .PP -Alternatively, ANSI escape codes can be used, e.g "\\e[1;31m" and "\\e[38;5;160m", but \fBnote\fR that 256-color ANSI escape codes (those that starts with \\[38 or \\[48) cannot be used in GUI mode. -.br -You can also use them inside the tag, like \fB${!#343345}\fR or \fB${\\e[1;31m}\fR. -.br -To reset colors, use \fB${0}\fR for a full reset or \fB${1}\fR for a bold reset. -.br -To use the colors that the ascii art logo uses, use \fB${auto}\fR for getting the 1st color, \fB${auto4}\fR for the 4th one and so on. + Alternatively, ANSI escape codes can be used, e.g "\\e[1;31m" and "\\e[38;5;160m", but \fBnote\fR that 256-color ANSI escape codes (those that starts with \\[38 or \\[48) cannot be used in GUI mode. +.PP + You can also use them inside the tag, like \fB${!#343345}\fR or \fB${\\e[1;31m}\fR. +.PP + To reset colors, use \fB${0}\fR for a normal reset or \fB${1}\fR for a bold reset. +.PP + To use the colors that the ascii art logo uses, use \fB${auto}\fR for getting the 1st color, \fB${auto4}\fR for the 4th one and so on. .br -If you're using GUI mode, all the \fB${auto}\fR colors are going to be ${white} + If you're using GUI mode and wants to display a custom source that's an image, all the auto colors will be the same colors as the distro ones .PP -The \fBConditional tag $[]\fR is used to display different outputs based on the comparison. +* The \fBConditional tag $[]\fR is used to display different outputs based on the comparison. .br -The syntax \fBMUST\fR be: $[something,equalToSomethingElse,ifTrue,ifFalse] with no spaces between commas + The syntax \fBMUST\fR be: $[something,equalToSomethingElse,ifTrue,ifFalse] \fBnote:\fR putting spaces could change the expected result .br -Each part can have a tag or anything else. + Each part can have a tag or anything else. .PP -For example: $[$,$(echo $USER),correct,NOT correct] + For example: $[$,$(echo $USER),correct,NOT correct] .br -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 .PP -The \fBBash command tag $()\fR speaks for itself. It can execute normal bash commands. +* The \fBBash command tag $()\fR speaks for itself. +.br + It can execute normal bash commands and print the output of it. .PP -The \fBPercentage tag $%%\fR is used for displaying the percentage between 2 numbers. +* The \fBPercentage tag $%%\fR is used for displaying the percentage between 2 numbers. .br -It \fBMust\fR contain a comma for separating the 2. They can be either be taken from a tag or it put yourself. + It \fBMust\fR contain a comma for separating the 2. They can be either be taken from a tag or it put yourself. .br -For example: $%10,5% + For example: $%50,100% .br -For inverting colors of bad and great (red and green), before the last '%' a put '!' without quotes + For inverting colors of bad and great (red and green), before the last '%' put '!' (without quotes ofc) .PP To escape any $ or bracket, just use \\ .SH OPTIONS diff --git a/include/config.hpp b/include/config.hpp index 1800aec..25b33fa 100644 --- a/include/config.hpp +++ b/include/config.hpp @@ -100,42 +100,44 @@ inline constexpr std::string_view AUTOCONFIG = R"#([config] # e.g $ will print the username, $ will print the kernel version and so on. # All the modules and their members are listed in the `--list-modules` argument -# The Bash command tag $() let's you execute bash commands. -# e.g $(echo \"hello world\") will indeed echo out Hello world. +# The Bash command tag $() will execute bash commands and print the output. +# e.g $(echo \"hello world\") will indeed echo out hello world. # you can even use pipes # e.g $(echo \"hello world\" | cut -d' ' -f2) will only print world # The Conditional tag $[] is used to display 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, could change the expected result +# # Each part can have a tag or anything else. # e.g $[$,$(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 # The Color tag ${} is used for printing the text of a certain color. # e.g "${red}hello world" will indeed print "hello world" in red (or the color you set in the variable) -# you can even put a custom hex color e.g: ${#ff6622} -# It's possible to enable multiple options, put these symbols before '#': -# * b, for making the color in the background -# * u, for underline the text -# * !, for making the text bold -# * i, for making the text italic +# The colors can be predefined such as: black, red, green, blue, cyan, yellow, magenta, white. +# They can be configured in the config file. +# +# They can have hexcodes colors (e.g "#5522dd"). +# You can apply special effects to colors by using the following symbols before the '#' in hex codes: +# * b for background color. +# * u for underline the text +# * ! for bold text +# * i for italic text # # Alternatively, ANSI escape codes can be used, e.g ${\e[1;32m} or ${\e[0;34m}. # NOTE: 256-color ANSI escape codes (those that starts with \\[38 or \\[48) cannot be used in GUI mode. # # To reset colors, use ${0} for a full 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 using GUI mode, all the \fB${auto}\fR colors are going to be ${white} +# To use the colors that the ascii art logo uses, use ${auto} for getting the 1st color, ${auto4} for the 4th one and so on. +# If you're using GUI mode and wants to display a custom source that's an image, all the auto colors will be the same colors as the distro ones # 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 last '%' a put '!' -# without quotes +# For example: $%50,100% +# For inverting colors of bad and great (red and green), before the last '%' put '!' +# without quotes ofc # Little FAQ # Q: "Why when I use something like "$ <- Kernel" it won't work on GUI mode?" @@ -208,9 +210,7 @@ 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 +# Colors black = "\e[1;30m" red = "\e[1;31m" green = "\e[1;32m" @@ -261,9 +261,9 @@ enable = false # 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 +# These are the colors you can use in the GUI mode. +# They overwrite the normal colors from above, +# but they can only have hexcodes colors black = "!#000005" red = "!#ff2000" green = "!#00ff00"