pfetch: de and editor support

This commit is contained in:
Dylan Araps 2019-09-30 23:53:25 +03:00
parent 6c2ffdd07e
commit 29b09c8622
2 changed files with 18 additions and 5 deletions

View File

@ -88,7 +88,7 @@ _/\ __)/_) pkgs 130
# Default: first example below # Default: first example below
# Valid: space separated string # Valid: space separated string
# #
# OFF by default: shell palette # OFF by default: shell editor de palette
PF_INFO="ascii title os host kernel uptime pkgs memory" PF_INFO="ascii title os host kernel uptime pkgs memory"
# Example: Only ASCII. # Example: Only ASCII.

21
pfetch
View File

@ -277,10 +277,6 @@ get_kernel() {
esac esac
} }
get_shell() {
log shell "${SHELL##*/}" >&6
}
get_host() { get_host() {
case $os in case $os in
Linux*) Linux*)
@ -672,6 +668,23 @@ get_memory() {
log memory "${mem_used:-?}M / ${mem_full:-?}M" >&6 log memory "${mem_used:-?}M / ${mem_full:-?}M" >&6
} }
get_shell() {
# Display the basename of the '$SHELL' environment variable.
log shell "${SHELL##*/}" >&6
}
get_editor() {
# Display the value of '$VISUAL', if it's empty, display the
# value of '$EDITOR'.
log editor "${VISUAL:-$EDITOR}" >&6
}
get_de() {
# Display the value of '$XDG_CURRENT_DESKTOP', if it's empty,
# display the value of '$DESKTOP_SESSION'.
log de "${XDG_CURRENT_DESKTOP:-$DESKTOP_SESSION}" >&6
}
get_palette() { get_palette() {
# Print the first 8 terminal colors. This uses the existing # Print the first 8 terminal colors. This uses the existing
# sequences to change text color with a sequence prepended # sequences to change text color with a sequence prepended