neofetch: remove unneeded quotes
This commit is contained in:
parent
acdfbe2063
commit
9f25f34fa1
1 changed files with 76 additions and 76 deletions
152
neofetch
152
neofetch
|
@ -1698,7 +1698,7 @@ get_wm_theme() {
|
||||||
((wm_run != 1)) && get_wm
|
((wm_run != 1)) && get_wm
|
||||||
((de_run != 1)) && get_de
|
((de_run != 1)) && get_de
|
||||||
|
|
||||||
case "$wm" in
|
case $wm in
|
||||||
"E16")
|
"E16")
|
||||||
wm_theme="$(awk -F "= " '/theme.name/ {print $2}' "${HOME}/.e16/e_config--0.0.cfg")"
|
wm_theme="$(awk -F "= " '/theme.name/ {print $2}' "${HOME}/.e16/e_config--0.0.cfg")"
|
||||||
;;
|
;;
|
||||||
|
@ -1820,7 +1820,7 @@ get_wm_theme() {
|
||||||
[[ -z "$wm_theme" ]] && \
|
[[ -z "$wm_theme" ]] && \
|
||||||
wm_theme="Light"
|
wm_theme="Light"
|
||||||
|
|
||||||
case "$wm_theme_color" in
|
case $wm_theme_color in
|
||||||
"-1") wm_theme_color="Graphite" ;;
|
"-1") wm_theme_color="Graphite" ;;
|
||||||
"0") wm_theme_color="Red" ;;
|
"0") wm_theme_color="Red" ;;
|
||||||
"1") wm_theme_color="Orange" ;;
|
"1") wm_theme_color="Orange" ;;
|
||||||
|
@ -1858,12 +1858,12 @@ get_wm_theme() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_cpu() {
|
get_cpu() {
|
||||||
case "$os" in
|
case $os in
|
||||||
"Linux" | "MINIX" | "Windows")
|
"Linux" | "MINIX" | "Windows")
|
||||||
# Get CPU name.
|
# Get CPU name.
|
||||||
cpu_file="/proc/cpuinfo"
|
cpu_file="/proc/cpuinfo"
|
||||||
|
|
||||||
case "$kernel_machine" in
|
case $kernel_machine in
|
||||||
"frv" | "hppa" | "m68k" | "openrisc" | "or"* | "powerpc" | "ppc"* | "sparc"*)
|
"frv" | "hppa" | "m68k" | "openrisc" | "or"* | "powerpc" | "ppc"* | "sparc"*)
|
||||||
cpu="$(awk -F':' '/^cpu\t|^CPU/ {printf $2; exit}' "$cpu_file")"
|
cpu="$(awk -F':' '/^cpu\t|^CPU/ {printf $2; exit}' "$cpu_file")"
|
||||||
;;
|
;;
|
||||||
|
@ -1910,7 +1910,7 @@ get_cpu() {
|
||||||
[[ -f "$temp_dir" ]] && deg="$(($(< "$temp_dir") * 100 / 10000))"
|
[[ -f "$temp_dir" ]] && deg="$(($(< "$temp_dir") * 100 / 10000))"
|
||||||
|
|
||||||
# Get CPU cores.
|
# Get CPU cores.
|
||||||
case "$cpu_cores" in
|
case $cpu_cores in
|
||||||
"logical" | "on") cores="$(grep -c "^processor" "$cpu_file")" ;;
|
"logical" | "on") cores="$(grep -c "^processor" "$cpu_file")" ;;
|
||||||
"physical") cores="$(awk '/^core id/&&!a[$0]++{++i} END {print i}' "$cpu_file")" ;;
|
"physical") cores="$(awk '/^core id/&&!a[$0]++{++i} END {print i}' "$cpu_file")" ;;
|
||||||
esac
|
esac
|
||||||
|
@ -1920,14 +1920,14 @@ get_cpu() {
|
||||||
cpu="$(sysctl -n machdep.cpu.brand_string)"
|
cpu="$(sysctl -n machdep.cpu.brand_string)"
|
||||||
|
|
||||||
# Get CPU cores.
|
# Get CPU cores.
|
||||||
case "$cpu_cores" in
|
case $cpu_cores in
|
||||||
"logical" | "on") cores="$(sysctl -n hw.logicalcpu_max)" ;;
|
"logical" | "on") cores="$(sysctl -n hw.logicalcpu_max)" ;;
|
||||||
"physical") cores="$(sysctl -n hw.physicalcpu_max)" ;;
|
"physical") cores="$(sysctl -n hw.physicalcpu_max)" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"iPhone OS")
|
"iPhone OS")
|
||||||
case "$kernel_machine" in
|
case $kernel_machine in
|
||||||
"iPhone1,"[1-2] | "iPod1,1"): "Samsung S5L8900 (1) @ 412MHz" ;;
|
"iPhone1,"[1-2] | "iPod1,1"): "Samsung S5L8900 (1) @ 412MHz" ;;
|
||||||
"iPhone2,1"): "Samsung S5PC100 (1) @ 600MHz" ;;
|
"iPhone2,1"): "Samsung S5PC100 (1) @ 600MHz" ;;
|
||||||
"iPhone3,"[1-3] | "iPod4,1"): "Apple A4 (1) @ 800MHz" ;;
|
"iPhone3,"[1-3] | "iPod4,1"): "Apple A4 (1) @ 800MHz" ;;
|
||||||
|
@ -1976,7 +1976,7 @@ get_cpu() {
|
||||||
cores="$(sysctl -n hw.ncpu)"
|
cores="$(sysctl -n hw.ncpu)"
|
||||||
|
|
||||||
# Get CPU temp.
|
# Get CPU temp.
|
||||||
case "$kernel_name" in
|
case $kernel_name in
|
||||||
"FreeBSD"* | "DragonFly"* | "NetBSD"*)
|
"FreeBSD"* | "DragonFly"* | "NetBSD"*)
|
||||||
deg="$(sysctl -n dev.cpu.0.temperature)"
|
deg="$(sysctl -n dev.cpu.0.temperature)"
|
||||||
deg="${deg/C}"
|
deg="${deg/C}"
|
||||||
|
@ -2001,7 +2001,7 @@ get_cpu() {
|
||||||
speed="$(psrinfo -v | awk '/operates at/ {print $6; exit}')"
|
speed="$(psrinfo -v | awk '/operates at/ {print $6; exit}')"
|
||||||
|
|
||||||
# Get CPU cores.
|
# Get CPU cores.
|
||||||
case "$cpu_cores" in
|
case $cpu_cores in
|
||||||
"logical" | "on") cores="$(kstat -m cpu_info | grep -c -F "chip_id")" ;;
|
"logical" | "on") cores="$(kstat -m cpu_info | grep -c -F "chip_id")" ;;
|
||||||
"physical") cores="$(psrinfo -p)" ;;
|
"physical") cores="$(psrinfo -p)" ;;
|
||||||
esac
|
esac
|
||||||
|
@ -2029,7 +2029,7 @@ get_cpu() {
|
||||||
speed="${speed/MHz}"
|
speed="${speed/MHz}"
|
||||||
|
|
||||||
# Get CPU cores.
|
# Get CPU cores.
|
||||||
case "$cpu_cores" in
|
case $cpu_cores in
|
||||||
"logical" | "on")
|
"logical" | "on")
|
||||||
cores="$(lparstat -i | awk -F':' '/Online Virtual CPUs/ {printf $2}')"
|
cores="$(lparstat -i | awk -F':' '/Online Virtual CPUs/ {printf $2}')"
|
||||||
;;
|
;;
|
||||||
|
@ -2092,7 +2092,7 @@ get_cpu() {
|
||||||
|
|
||||||
# Add CPU cores to the output.
|
# Add CPU cores to the output.
|
||||||
[[ "$cpu_cores" != "off" && "$cores" ]] && \
|
[[ "$cpu_cores" != "off" && "$cores" ]] && \
|
||||||
case "$os" in
|
case $os in
|
||||||
"Mac OS X") cpu="${cpu/@/(${cores}) @}" ;;
|
"Mac OS X") cpu="${cpu/@/(${cores}) @}" ;;
|
||||||
*) cpu="$cpu ($cores)" ;;
|
*) cpu="$cpu ($cores)" ;;
|
||||||
esac
|
esac
|
||||||
|
@ -2122,7 +2122,7 @@ get_cpu() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_cpu_usage() {
|
get_cpu_usage() {
|
||||||
case "$os" in
|
case $os in
|
||||||
"Windows")
|
"Windows")
|
||||||
cpu_usage="$(wmic cpu get loadpercentage)"
|
cpu_usage="$(wmic cpu get loadpercentage)"
|
||||||
cpu_usage="${cpu_usage/LoadPercentage}"
|
cpu_usage="${cpu_usage/LoadPercentage}"
|
||||||
|
@ -2132,7 +2132,7 @@ get_cpu_usage() {
|
||||||
*)
|
*)
|
||||||
# Get CPU cores if unset.
|
# Get CPU cores if unset.
|
||||||
if [[ "$cpu_cores" != "logical" ]]; then
|
if [[ "$cpu_cores" != "logical" ]]; then
|
||||||
case "$os" in
|
case $os in
|
||||||
"Linux" | "MINIX") cores="$(grep -c "^processor" /proc/cpuinfo)" ;;
|
"Linux" | "MINIX") cores="$(grep -c "^processor" /proc/cpuinfo)" ;;
|
||||||
"Mac OS X") cores="$(sysctl -n hw.logicalcpu_max)" ;;
|
"Mac OS X") cores="$(sysctl -n hw.logicalcpu_max)" ;;
|
||||||
"BSD") cores="$(sysctl -n hw.ncpu)" ;;
|
"BSD") cores="$(sysctl -n hw.ncpu)" ;;
|
||||||
|
@ -2154,7 +2154,7 @@ get_cpu_usage() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Print the bar.
|
# Print the bar.
|
||||||
case "$cpu_display" in
|
case $cpu_display in
|
||||||
"bar") cpu_usage="$(bar "$cpu_usage" 100)" ;;
|
"bar") cpu_usage="$(bar "$cpu_usage" 100)" ;;
|
||||||
"infobar") cpu_usage="${cpu_usage}% $(bar "$cpu_usage" 100)" ;;
|
"infobar") cpu_usage="${cpu_usage}% $(bar "$cpu_usage" 100)" ;;
|
||||||
"barinfo") cpu_usage="$(bar "$cpu_usage" 100)${info_color} ${cpu_usage}%" ;;
|
"barinfo") cpu_usage="$(bar "$cpu_usage" 100)${info_color} ${cpu_usage}%" ;;
|
||||||
|
@ -2163,7 +2163,7 @@ get_cpu_usage() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_gpu() {
|
get_gpu() {
|
||||||
case "$os" in
|
case $os in
|
||||||
"Linux")
|
"Linux")
|
||||||
# Read GPUs into array.
|
# Read GPUs into array.
|
||||||
gpu_cmd="$(lspci -mm | awk -F '\"|\" \"|\\(' \
|
gpu_cmd="$(lspci -mm | awk -F '\"|\" \"|\\(' \
|
||||||
|
@ -2186,7 +2186,7 @@ get_gpu() {
|
||||||
[[ "$gpu_type" == "integrated" && ! "$gpu" == *Intel* ]] && \
|
[[ "$gpu_type" == "integrated" && ! "$gpu" == *Intel* ]] && \
|
||||||
{ unset -v gpu; continue; }
|
{ unset -v gpu; continue; }
|
||||||
|
|
||||||
case "$gpu" in
|
case $gpu in
|
||||||
*"advanced"*)
|
*"advanced"*)
|
||||||
brand="${gpu/*AMD*ATI*/AMD ATI}"
|
brand="${gpu/*AMD*ATI*/AMD ATI}"
|
||||||
brand="${brand:-${gpu/*AMD*/AMD}}"
|
brand="${brand:-${gpu/*AMD*/AMD}}"
|
||||||
|
@ -2252,7 +2252,7 @@ get_gpu() {
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"iPhone OS")
|
"iPhone OS")
|
||||||
case "$kernel_machine" in
|
case $kernel_machine in
|
||||||
"iPhone1,"[1-2]): "PowerVR MBX Lite 3D" ;;
|
"iPhone1,"[1-2]): "PowerVR MBX Lite 3D" ;;
|
||||||
"iPhone5,"[1-4]): "PowerVR SGX543MP3" ;;
|
"iPhone5,"[1-4]): "PowerVR SGX543MP3" ;;
|
||||||
"iPhone11,"[2468]): "G11P" ;;
|
"iPhone11,"[2468]): "G11P" ;;
|
||||||
|
@ -2303,7 +2303,7 @@ get_gpu() {
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
case "$kernel_name" in
|
case $kernel_name in
|
||||||
"FreeBSD"* | "DragonFly"*)
|
"FreeBSD"* | "DragonFly"*)
|
||||||
gpu="$(pciconf -lv | grep -B 4 -F "VGA" | grep -F "device")"
|
gpu="$(pciconf -lv | grep -B 4 -F "VGA" | grep -F "device")"
|
||||||
gpu="${gpu/*device*= }"
|
gpu="${gpu/*device*= }"
|
||||||
|
@ -2326,12 +2326,12 @@ get_gpu() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_memory() {
|
get_memory() {
|
||||||
case "$os" in
|
case $os in
|
||||||
"Linux" | "Windows")
|
"Linux" | "Windows")
|
||||||
# MemUsed = Memtotal + Shmem - MemFree - Buffers - Cached - SReclaimable
|
# MemUsed = Memtotal + Shmem - MemFree - Buffers - Cached - SReclaimable
|
||||||
# Source: https://github.com/KittyKatt/screenFetch/issues/386#issuecomment-249312716
|
# Source: https://github.com/KittyKatt/screenFetch/issues/386#issuecomment-249312716
|
||||||
while IFS=":" read -r a b; do
|
while IFS=":" read -r a b; do
|
||||||
case "$a" in
|
case $a in
|
||||||
"MemTotal") ((mem_used+=${b/kB})); mem_total="${b/kB}" ;;
|
"MemTotal") ((mem_used+=${b/kB})); mem_total="${b/kB}" ;;
|
||||||
"Shmem") ((mem_used+=${b/kB})) ;;
|
"Shmem") ((mem_used+=${b/kB})) ;;
|
||||||
"MemFree" | "Buffers" | "Cached" | "SReclaimable")
|
"MemFree" | "Buffers" | "Cached" | "SReclaimable")
|
||||||
|
@ -2355,13 +2355,13 @@ get_memory() {
|
||||||
|
|
||||||
"BSD" | "MINIX")
|
"BSD" | "MINIX")
|
||||||
# Mem total.
|
# Mem total.
|
||||||
case "$kernel_name" in
|
case $kernel_name in
|
||||||
"NetBSD"*) mem_total="$(($(sysctl -n hw.physmem64) / 1024 / 1024))" ;;
|
"NetBSD"*) mem_total="$(($(sysctl -n hw.physmem64) / 1024 / 1024))" ;;
|
||||||
*) mem_total="$(($(sysctl -n hw.physmem) / 1024 / 1024))" ;;
|
*) mem_total="$(($(sysctl -n hw.physmem) / 1024 / 1024))" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Mem free.
|
# Mem free.
|
||||||
case "$kernel_name" in
|
case $kernel_name in
|
||||||
"NetBSD"*)
|
"NetBSD"*)
|
||||||
mem_free="$(($(awk -F ':|kB' '/MemFree:/ {printf $2}' /proc/meminfo) / 1024))"
|
mem_free="$(($(awk -F ':|kB' '/MemFree:/ {printf $2}' /proc/meminfo) / 1024))"
|
||||||
;;
|
;;
|
||||||
|
@ -2384,7 +2384,7 @@ get_memory() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Mem used.
|
# Mem used.
|
||||||
case "$kernel_name" in
|
case $kernel_name in
|
||||||
"OpenBSD"*)
|
"OpenBSD"*)
|
||||||
mem_used="$(vmstat | awk 'END {printf $3}')"
|
mem_used="$(vmstat | awk 'END {printf $3}')"
|
||||||
mem_used="${mem_used/M}"
|
mem_used="${mem_used/M}"
|
||||||
|
@ -2396,7 +2396,7 @@ get_memory() {
|
||||||
|
|
||||||
"Solaris" | "AIX")
|
"Solaris" | "AIX")
|
||||||
hw_pagesize="$(pagesize)"
|
hw_pagesize="$(pagesize)"
|
||||||
case "$os" in
|
case $os in
|
||||||
"Solaris")
|
"Solaris")
|
||||||
pages_total="$(kstat -p unix:0:system_pages:pagestotal | awk '{print $2}')"
|
pages_total="$(kstat -p unix:0:system_pages:pagestotal | awk '{print $2}')"
|
||||||
pages_free="$(kstat -p unix:0:system_pages:pagesfree | awk '{print $2}')"
|
pages_free="$(kstat -p unix:0:system_pages:pagesfree | awk '{print $2}')"
|
||||||
|
@ -2444,7 +2444,7 @@ get_memory() {
|
||||||
memory="${mem_used}${mem_label:-MiB} / ${mem_total}${mem_label:-MiB} ${mem_perc:+(${mem_perc}%)}"
|
memory="${mem_used}${mem_label:-MiB} / ${mem_total}${mem_label:-MiB} ${mem_perc:+(${mem_perc}%)}"
|
||||||
|
|
||||||
# Bars.
|
# Bars.
|
||||||
case "$memory_display" in
|
case $memory_display in
|
||||||
"bar") memory="$(bar "${mem_used}" "${mem_total}")" ;;
|
"bar") memory="$(bar "${mem_used}" "${mem_total}")" ;;
|
||||||
"infobar") memory="${memory} $(bar "${mem_used}" "${mem_total}")" ;;
|
"infobar") memory="${memory} $(bar "${mem_used}" "${mem_total}")" ;;
|
||||||
"barinfo") memory="$(bar "${mem_used}" "${mem_total}")${info_color} ${memory}" ;;
|
"barinfo") memory="$(bar "${mem_used}" "${mem_total}")${info_color} ${memory}" ;;
|
||||||
|
@ -2513,7 +2513,7 @@ get_song() {
|
||||||
)"
|
)"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "${player/*\/}" in
|
case ${player/*\/} in
|
||||||
"mpd"*|"mopidy"*) song="$(mpc -f '%artist%\n%album%\n%title%' current "${mpc_args[@]}")" ;;
|
"mpd"*|"mopidy"*) song="$(mpc -f '%artist%\n%album%\n%title%' current "${mpc_args[@]}")" ;;
|
||||||
"mocp"*) song="$(mocp -Q '%artist\n%album\n%song')" ;;
|
"mocp"*) song="$(mocp -Q '%artist\n%album\n%song')" ;;
|
||||||
"deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist%\\n%album%\\n%title%')" ;;
|
"deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist%\\n%album%\\n%title%')" ;;
|
||||||
|
@ -2561,7 +2561,7 @@ get_song() {
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"spotify"*)
|
"spotify"*)
|
||||||
case "$os" in
|
case $os in
|
||||||
"Linux") get_song_dbus "spotify" ;;
|
"Linux") get_song_dbus "spotify" ;;
|
||||||
|
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
|
@ -2638,7 +2638,7 @@ get_song() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_resolution() {
|
get_resolution() {
|
||||||
case "$os" in
|
case $os in
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
if type -p screenresolution >/dev/null; then
|
if type -p screenresolution >/dev/null; then
|
||||||
resolution="$(screenresolution get 2>&1 | awk '/Display/ {printf $6 "Hz, "}')"
|
resolution="$(screenresolution get 2>&1 | awk '/Display/ {printf $6 "Hz, "}')"
|
||||||
|
@ -2692,7 +2692,7 @@ get_resolution() {
|
||||||
|
|
||||||
*)
|
*)
|
||||||
if type -p xrandr >/dev/null; then
|
if type -p xrandr >/dev/null; then
|
||||||
case "$refresh_rate" in
|
case $refresh_rate in
|
||||||
"on")
|
"on")
|
||||||
resolution="$(xrandr --nograb --current |\
|
resolution="$(xrandr --nograb --current |\
|
||||||
awk 'match($0,/[0-9]*\.[0-9]*\*/) {
|
awk 'match($0,/[0-9]*\.[0-9]*\*/) {
|
||||||
|
@ -2732,7 +2732,7 @@ get_style() {
|
||||||
((de_run != 1)) && get_de
|
((de_run != 1)) && get_de
|
||||||
|
|
||||||
# Check for DE Theme.
|
# Check for DE Theme.
|
||||||
case "$de" in
|
case $de in
|
||||||
"KDE"* | "Plasma"*)
|
"KDE"* | "Plasma"*)
|
||||||
kde_config_dir
|
kde_config_dir
|
||||||
|
|
||||||
|
@ -2895,7 +2895,7 @@ get_term() {
|
||||||
|
|
||||||
# Workaround for macOS systems that
|
# Workaround for macOS systems that
|
||||||
# don't support the block below.
|
# don't support the block below.
|
||||||
case "$TERM_PROGRAM" in
|
case $TERM_PROGRAM in
|
||||||
"iTerm.app") term="iTerm2" ;;
|
"iTerm.app") term="iTerm2" ;;
|
||||||
"Terminal.app") term="Apple Terminal" ;;
|
"Terminal.app") term="Apple Terminal" ;;
|
||||||
"Hyper") term="HyperTerm" ;;
|
"Hyper") term="HyperTerm" ;;
|
||||||
|
@ -2912,7 +2912,7 @@ get_term() {
|
||||||
[[ -z "$parent" ]] && break
|
[[ -z "$parent" ]] && break
|
||||||
name="$(get_process_name "$parent")"
|
name="$(get_process_name "$parent")"
|
||||||
|
|
||||||
case "${name// }" in
|
case ${name// } in
|
||||||
"${SHELL/*\/}"|*"sh"|"screen"|"su"*) ;;
|
"${SHELL/*\/}"|*"sh"|"screen"|"su"*) ;;
|
||||||
|
|
||||||
"login"*|*"Login"*|"init"|"(init)")
|
"login"*|*"Login"*|"init"|"(init)")
|
||||||
|
@ -2950,7 +2950,7 @@ get_term() {
|
||||||
get_term_font() {
|
get_term_font() {
|
||||||
((term_run != 1)) && get_term
|
((term_run != 1)) && get_term
|
||||||
|
|
||||||
case "$term" in
|
case $term in
|
||||||
"alacritty"*)
|
"alacritty"*)
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
confs=({$XDG_CONFIG_HOME,$HOME}/{alacritty,}/{.,}alacritty.ym?)
|
confs=({$XDG_CONFIG_HOME,$HOME}/{alacritty,}/{.,}alacritty.ym?)
|
||||||
|
@ -3204,7 +3204,7 @@ END
|
||||||
|
|
||||||
# Xresources has two different font formats, this checks which
|
# Xresources has two different font formats, this checks which
|
||||||
# one is in use and formats it accordingly.
|
# one is in use and formats it accordingly.
|
||||||
case "$term_font" in
|
case $term_font in
|
||||||
*"xft:"*)
|
*"xft:"*)
|
||||||
term_font="${term_font/xft:}"
|
term_font="${term_font/xft:}"
|
||||||
term_font="${term_font/:*}"
|
term_font="${term_font/:*}"
|
||||||
|
@ -3237,7 +3237,7 @@ get_disk() {
|
||||||
|
|
||||||
df_version="$(df --version 2>&1)"
|
df_version="$(df --version 2>&1)"
|
||||||
|
|
||||||
case "$df_version" in
|
case $df_version in
|
||||||
*"IMitv"*) df_flags=(-P -g) ;; # AIX
|
*"IMitv"*) df_flags=(-P -g) ;; # AIX
|
||||||
*"befhikm"*) df_flags=(-P -k) ;; # IRIX
|
*"befhikm"*) df_flags=(-P -k) ;; # IRIX
|
||||||
*"hiklnP"*) df_flags=(-h) ;; # OpenBSD
|
*"hiklnP"*) df_flags=(-h) ;; # OpenBSD
|
||||||
|
@ -3266,7 +3266,7 @@ get_disk() {
|
||||||
IFS=" " read -ra disk_info <<< "$disk"
|
IFS=" " read -ra disk_info <<< "$disk"
|
||||||
disk_perc="${disk_info[4]/\%}"
|
disk_perc="${disk_info[4]/\%}"
|
||||||
|
|
||||||
case "$df_version" in
|
case $df_version in
|
||||||
*"befhikm"*)
|
*"befhikm"*)
|
||||||
disk="$((disk_info[2]/1024/1024))G / $((disk_info[1]/1024/1024))G (${disk_perc}%)"
|
disk="$((disk_info[2]/1024/1024))G / $((disk_info[1]/1024/1024))G (${disk_perc}%)"
|
||||||
;;
|
;;
|
||||||
|
@ -3277,7 +3277,7 @@ get_disk() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Subtitle.
|
# Subtitle.
|
||||||
case "$disk_subtitle" in
|
case $disk_subtitle in
|
||||||
"name")
|
"name")
|
||||||
disk_sub="${disk_info[0]}"
|
disk_sub="${disk_info[0]}"
|
||||||
;;
|
;;
|
||||||
|
@ -3293,7 +3293,7 @@ get_disk() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Bar.
|
# Bar.
|
||||||
case "$disk_display" in
|
case $disk_display in
|
||||||
"bar") disk="$(bar "$disk_perc" "100")" ;;
|
"bar") disk="$(bar "$disk_perc" "100")" ;;
|
||||||
"infobar") disk+=" $(bar "$disk_perc" "100")" ;;
|
"infobar") disk+=" $(bar "$disk_perc" "100")" ;;
|
||||||
"barinfo") disk="$(bar "$disk_perc" "100")${info_color} $disk" ;;
|
"barinfo") disk="$(bar "$disk_perc" "100")${info_color} $disk" ;;
|
||||||
|
@ -3310,7 +3310,7 @@ get_disk() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_battery() {
|
get_battery() {
|
||||||
case "$os" in
|
case $os in
|
||||||
"Linux")
|
"Linux")
|
||||||
# We use 'prin' here so that we can do multi battery support
|
# We use 'prin' here so that we can do multi battery support
|
||||||
# with a single battery per line.
|
# with a single battery per line.
|
||||||
|
@ -3321,7 +3321,7 @@ get_battery() {
|
||||||
if [[ "$capacity" ]]; then
|
if [[ "$capacity" ]]; then
|
||||||
battery="${capacity}% [${status}]"
|
battery="${capacity}% [${status}]"
|
||||||
|
|
||||||
case "$battery_display" in
|
case $battery_display in
|
||||||
"bar") battery="$(bar "$capacity" 100)" ;;
|
"bar") battery="$(bar "$capacity" 100)" ;;
|
||||||
"infobar") battery+=" $(bar "$capacity" 100)" ;;
|
"infobar") battery+=" $(bar "$capacity" 100)" ;;
|
||||||
"barinfo") battery="$(bar "$capacity" 100)${info_color} ${battery}" ;;
|
"barinfo") battery="$(bar "$capacity" 100)${info_color} ${battery}" ;;
|
||||||
|
@ -3335,7 +3335,7 @@ get_battery() {
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"BSD")
|
"BSD")
|
||||||
case "$kernel_name" in
|
case $kernel_name in
|
||||||
"FreeBSD"* | "DragonFly"*)
|
"FreeBSD"* | "DragonFly"*)
|
||||||
battery="$(acpiconf -i 0 | awk -F ':\t' '/Remaining capacity/ {print $2}')"
|
battery="$(acpiconf -i 0 | awk -F ':\t' '/Remaining capacity/ {print $2}')"
|
||||||
battery_state="$(acpiconf -i 0 | awk -F ':\t\t\t' '/State/ {print $2}')"
|
battery_state="$(acpiconf -i 0 | awk -F ':\t\t\t' '/State/ {print $2}')"
|
||||||
|
@ -3387,7 +3387,7 @@ get_battery() {
|
||||||
|
|
||||||
[[ "$battery_state" ]] && battery+=" Charging"
|
[[ "$battery_state" ]] && battery+=" Charging"
|
||||||
|
|
||||||
case "$battery_display" in
|
case $battery_display in
|
||||||
"bar") battery="$(bar "${battery/\%*}" 100)" ;;
|
"bar") battery="$(bar "${battery/\%*}" 100)" ;;
|
||||||
"infobar") battery="${battery} $(bar "${battery/\%*}" 100)" ;;
|
"infobar") battery="${battery} $(bar "${battery/\%*}" 100)" ;;
|
||||||
"barinfo") battery="$(bar "${battery/\%*}" 100)${info_color} ${battery}" ;;
|
"barinfo") battery="$(bar "${battery/\%*}" 100)${info_color} ${battery}" ;;
|
||||||
|
@ -3395,7 +3395,7 @@ get_battery() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_local_ip() {
|
get_local_ip() {
|
||||||
case "$os" in
|
case $os in
|
||||||
"Linux" | "BSD" | "Solaris" | "AIX" | "IRIX")
|
"Linux" | "BSD" | "Solaris" | "AIX" | "IRIX")
|
||||||
local_ip="$(ip route get 1 | awk -F'src' '{print $2; exit}')"
|
local_ip="$(ip route get 1 | awk -F'src' '{print $2; exit}')"
|
||||||
local_ip="${local_ip/uid*}"
|
local_ip="${local_ip/uid*}"
|
||||||
|
@ -3453,7 +3453,7 @@ get_locale() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_gpu_driver() {
|
get_gpu_driver() {
|
||||||
case "$os" in
|
case $os in
|
||||||
"Linux")
|
"Linux")
|
||||||
gpu_driver="$(lspci -nnk | awk -F ': ' \
|
gpu_driver="$(lspci -nnk | awk -F ': ' \
|
||||||
'/Display|3D|VGA/{nr[NR+2]}; NR in nr {printf $2 ", "}')"
|
'/Display|3D|VGA/{nr[NR+2]}; NR in nr {printf $2 ", "}')"
|
||||||
|
@ -3485,7 +3485,7 @@ get_cols() {
|
||||||
|
|
||||||
# Generate the string.
|
# Generate the string.
|
||||||
for ((block_range[0]; block_range[0]<=block_range[1]; block_range[0]++)); do
|
for ((block_range[0]; block_range[0]<=block_range[1]; block_range[0]++)); do
|
||||||
case "${block_range[0]}" in
|
case ${block_range[0]} in
|
||||||
[0-7])
|
[0-7])
|
||||||
printf -v blocks '%b\e[3%bm\e[4%bm%b' \
|
printf -v blocks '%b\e[3%bm\e[4%bm%b' \
|
||||||
"$blocks" "${block_range[0]}" "${block_range[0]}" "$block_width"
|
"$blocks" "${block_range[0]}" "${block_range[0]}" "$block_width"
|
||||||
|
@ -3531,7 +3531,7 @@ image_backend() {
|
||||||
[[ "$image_backend" != "off" ]] && ! type -p convert &>/dev/null && \
|
[[ "$image_backend" != "off" ]] && ! type -p convert &>/dev/null && \
|
||||||
{ image_backend="ascii"; err "Image: Imagemagick not found, falling back to ascii mode."; }
|
{ image_backend="ascii"; err "Image: Imagemagick not found, falling back to ascii mode."; }
|
||||||
|
|
||||||
case "${image_backend:-off}" in
|
case ${image_backend:-off} in
|
||||||
"ascii") print_ascii ;;
|
"ascii") print_ascii ;;
|
||||||
"off") image_backend="off" ;;
|
"off") image_backend="off" ;;
|
||||||
|
|
||||||
|
@ -3606,7 +3606,7 @@ print_ascii() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_image_source() {
|
get_image_source() {
|
||||||
case "$image_source" in
|
case $image_source in
|
||||||
"auto" | "wall" | "wallpaper")
|
"auto" | "wall" | "wallpaper")
|
||||||
get_wallpaper
|
get_wallpaper
|
||||||
;;
|
;;
|
||||||
|
@ -3631,7 +3631,7 @@ get_image_source() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_wallpaper() {
|
get_wallpaper() {
|
||||||
case "$os" in
|
case $os in
|
||||||
"Mac OS X")
|
"Mac OS X")
|
||||||
image="$(osascript <<END
|
image="$(osascript <<END
|
||||||
tell application "System Events" to picture of current desktop
|
tell application "System Events" to picture of current desktop
|
||||||
|
@ -3640,7 +3640,7 @@ END
|
||||||
;;
|
;;
|
||||||
|
|
||||||
"Windows")
|
"Windows")
|
||||||
case "$distro" in
|
case $distro in
|
||||||
"Windows XP")
|
"Windows XP")
|
||||||
image="/c/Documents and Settings/${USER}"
|
image="/c/Documents and Settings/${USER}"
|
||||||
image+="/Local Settings/Application Data/Microsoft/Wallpaper1.bmp"
|
image+="/Local Settings/Application Data/Microsoft/Wallpaper1.bmp"
|
||||||
|
@ -3661,7 +3661,7 @@ END
|
||||||
type -p wal >/dev/null && [[ -f "${HOME}/.cache/wal/wal" ]] && \
|
type -p wal >/dev/null && [[ -f "${HOME}/.cache/wal/wal" ]] && \
|
||||||
{ image="$(< "${HOME}/.cache/wal/wal")"; return; }
|
{ image="$(< "${HOME}/.cache/wal/wal")"; return; }
|
||||||
|
|
||||||
case "$de" in
|
case $de in
|
||||||
"MATE"*)
|
"MATE"*)
|
||||||
image="$(gsettings get org.mate.background picture-filename)"
|
image="$(gsettings get org.mate.background picture-filename)"
|
||||||
;;
|
;;
|
||||||
|
@ -3739,7 +3739,7 @@ get_window_size() {
|
||||||
printf '%b' '\e}qs\000'
|
printf '%b' '\e}qs\000'
|
||||||
|
|
||||||
elif [[ -z $VTE_VERSION ]]; then
|
elif [[ -z $VTE_VERSION ]]; then
|
||||||
case "${TMUX:-null}" in
|
case ${TMUX:-null} in
|
||||||
"null") printf '%b' '\e[14t' ;;
|
"null") printf '%b' '\e[14t' ;;
|
||||||
*) printf '%b' '\ePtmux;\e\e[14t\e\\ ' ;;
|
*) printf '%b' '\ePtmux;\e\e[14t\e\\ ' ;;
|
||||||
esac
|
esac
|
||||||
|
@ -3749,7 +3749,7 @@ get_window_size() {
|
||||||
# user input so we have to use read to store the out
|
# user input so we have to use read to store the out
|
||||||
# -put as a variable.
|
# -put as a variable.
|
||||||
# The 1 second timeout is required for older bash
|
# The 1 second timeout is required for older bash
|
||||||
case "${BASH_VERSINFO[0]}" in
|
case ${BASH_VERSINFO[0]} in
|
||||||
4|5) IFS=';t' read -d t -t 0.05 -sra term_size ;;
|
4|5) IFS=';t' read -d t -t 0.05 -sra term_size ;;
|
||||||
*) IFS=';t' read -d t -t 1 -sra term_size ;;
|
*) IFS=';t' read -d t -t 1 -sra term_size ;;
|
||||||
esac
|
esac
|
||||||
|
@ -3819,7 +3819,7 @@ get_image_size() {
|
||||||
# This functions determines the size to make the thumbnail image.
|
# This functions determines the size to make the thumbnail image.
|
||||||
get_term_size
|
get_term_size
|
||||||
|
|
||||||
case "$image_size" in
|
case $image_size in
|
||||||
"auto")
|
"auto")
|
||||||
image_size="$((columns * font_width / 2))"
|
image_size="$((columns * font_width / 2))"
|
||||||
term_height="$((term_height - term_height / 4))"
|
term_height="$((term_height - term_height / 4))"
|
||||||
|
@ -3864,7 +3864,7 @@ make_thumbnail() {
|
||||||
image_name="${crop_mode}-${crop_offset}-${width}-${height}-${image//\/}"
|
image_name="${crop_mode}-${crop_offset}-${width}-${height}-${image//\/}"
|
||||||
|
|
||||||
# Handle file extensions.
|
# Handle file extensions.
|
||||||
case "${image##*.}" in
|
case ${image##*.} in
|
||||||
"eps"|"pdf"|"svg"|"gif"|"png")
|
"eps"|"pdf"|"svg"|"gif"|"png")
|
||||||
image_name+=".png" ;;
|
image_name+=".png" ;;
|
||||||
*) image_name+=".jpg" ;;
|
*) image_name+=".jpg" ;;
|
||||||
|
@ -3880,7 +3880,7 @@ make_thumbnail() {
|
||||||
((og_height > og_width)) && size="$og_width" || size="$og_height"
|
((og_height > og_width)) && size="$og_width" || size="$og_height"
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$crop_mode" in
|
case $crop_mode in
|
||||||
"fit")
|
"fit")
|
||||||
c="$(convert "$image" \
|
c="$(convert "$image" \
|
||||||
-colorspace srgb \
|
-colorspace srgb \
|
||||||
|
@ -3929,7 +3929,7 @@ make_thumbnail() {
|
||||||
}
|
}
|
||||||
|
|
||||||
display_image() {
|
display_image() {
|
||||||
case "$image_backend" in
|
case $image_backend in
|
||||||
"caca")
|
"caca")
|
||||||
img2txt \
|
img2txt \
|
||||||
-W "$((width / font_width))" \
|
-W "$((width / font_width))" \
|
||||||
|
@ -4096,12 +4096,12 @@ get_underline() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_bold() {
|
get_bold() {
|
||||||
case "$ascii_bold" in
|
case $ascii_bold in
|
||||||
"on") ascii_bold='\e[1m' ;;
|
"on") ascii_bold='\e[1m' ;;
|
||||||
"off") ascii_bold="" ;;
|
"off") ascii_bold="" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case "$bold" in
|
case $bold in
|
||||||
"on") bold='\e[1m' ;;
|
"on") bold='\e[1m' ;;
|
||||||
"off") bold="" ;;
|
"off") bold="" ;;
|
||||||
esac
|
esac
|
||||||
|
@ -4177,15 +4177,15 @@ set_text_colors() {
|
||||||
bar_color_elapsed="$(color "$bar_color_elapsed")"
|
bar_color_elapsed="$(color "$bar_color_elapsed")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$bar_color_total $1" in
|
case ${bar_color_total}${1} in
|
||||||
"distro "[736]) bar_color_total="$(color "$1")" ;;
|
distro[736]) bar_color_total=$(color "$1") ;;
|
||||||
"distro "[0-9]) bar_color_total="$(color "$2")" ;;
|
distro[0-9]) bar_color_total=$(color "$2") ;;
|
||||||
*) bar_color_total="$(color "$bar_color_total")" ;;
|
*) bar_color_total=$(color "$bar_color_total") ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
color() {
|
color() {
|
||||||
case "$1" in
|
case $1 in
|
||||||
[0-6]) printf '%b\e[3%sm' "$reset" "$1" ;;
|
[0-6]) printf '%b\e[3%sm' "$reset" "$1" ;;
|
||||||
7 | "fg") printf '\e[37m%b' "$reset" ;;
|
7 | "fg") printf '\e[37m%b' "$reset" ;;
|
||||||
*) printf '\e[38;5;%bm' "$1" ;;
|
*) printf '\e[38;5;%bm' "$1" ;;
|
||||||
|
@ -4285,7 +4285,7 @@ cache() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_cache_dir() {
|
get_cache_dir() {
|
||||||
case "$os" in
|
case $os in
|
||||||
"Mac OS X") cache_dir="/Library/Caches" ;;
|
"Mac OS X") cache_dir="/Library/Caches" ;;
|
||||||
*) cache_dir="/tmp" ;;
|
*) cache_dir="/tmp" ;;
|
||||||
esac
|
esac
|
||||||
|
@ -4320,7 +4320,7 @@ term_padding() {
|
||||||
# Get terminal padding to properly align cursor.
|
# Get terminal padding to properly align cursor.
|
||||||
[[ -z "$term" ]] && get_term
|
[[ -z "$term" ]] && get_term
|
||||||
|
|
||||||
case "$term" in
|
case $term in
|
||||||
urxvt*|"rxvt-unicode")
|
urxvt*|"rxvt-unicode")
|
||||||
[[ -z "$xrdb" ]] &&
|
[[ -z "$xrdb" ]] &&
|
||||||
xrdb="$(xrdb -query)"
|
xrdb="$(xrdb -query)"
|
||||||
|
@ -4373,7 +4373,7 @@ cache_uname() {
|
||||||
|
|
||||||
get_ppid() {
|
get_ppid() {
|
||||||
# Get parent process ID of PID.
|
# Get parent process ID of PID.
|
||||||
case "$os" in
|
case $os in
|
||||||
"Windows")
|
"Windows")
|
||||||
ppid="$(ps -p "${1:-$PPID}" | awk '{printf $2}')"
|
ppid="$(ps -p "${1:-$PPID}" | awk '{printf $2}')"
|
||||||
ppid="${ppid/PPID}"
|
ppid="${ppid/PPID}"
|
||||||
|
@ -4394,7 +4394,7 @@ get_ppid() {
|
||||||
|
|
||||||
get_process_name() {
|
get_process_name() {
|
||||||
# Get PID name.
|
# Get PID name.
|
||||||
case "$os" in
|
case $os in
|
||||||
"Windows")
|
"Windows")
|
||||||
name="$(ps -p "${1:-$PPID}" | awk '{printf $8}')"
|
name="$(ps -p "${1:-$PPID}" | awk '{printf $8}')"
|
||||||
name="${name/COMMAND}"
|
name="${name/COMMAND}"
|
||||||
|
@ -4654,7 +4654,7 @@ get_args() {
|
||||||
[[ "$*" != *--config* && "$*" != *--no_config* ]] && get_user_config
|
[[ "$*" != *--config* && "$*" != *--no_config* ]] && get_user_config
|
||||||
|
|
||||||
while [[ "$1" ]]; do
|
while [[ "$1" ]]; do
|
||||||
case "$1" in
|
case $1 in
|
||||||
# Info
|
# Info
|
||||||
"--package_managers") package_managers="$2" ;;
|
"--package_managers") package_managers="$2" ;;
|
||||||
"--os_arch") os_arch="$2" ;;
|
"--os_arch") os_arch="$2" ;;
|
||||||
|
@ -4689,7 +4689,7 @@ get_args() {
|
||||||
"--disk_show")
|
"--disk_show")
|
||||||
unset disk_show
|
unset disk_show
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
case "$arg" in
|
case $arg in
|
||||||
"--disk_show") ;;
|
"--disk_show") ;;
|
||||||
"-"*) break ;;
|
"-"*) break ;;
|
||||||
*) disk_show+=("$arg") ;;
|
*) disk_show+=("$arg") ;;
|
||||||
|
@ -4699,7 +4699,7 @@ get_args() {
|
||||||
|
|
||||||
"--disable")
|
"--disable")
|
||||||
for func in "$@"; do
|
for func in "$@"; do
|
||||||
case "$func" in
|
case $func in
|
||||||
"--disable") continue ;;
|
"--disable") continue ;;
|
||||||
"-"*) break ;;
|
"-"*) break ;;
|
||||||
*)
|
*)
|
||||||
|
@ -4714,7 +4714,7 @@ get_args() {
|
||||||
"--colors")
|
"--colors")
|
||||||
unset colors
|
unset colors
|
||||||
for arg in "$2" "$3" "$4" "$5" "$6" "$7"; do
|
for arg in "$2" "$3" "$4" "$5" "$6" "$7"; do
|
||||||
case "$arg" in
|
case $arg in
|
||||||
"-"*) break ;;
|
"-"*) break ;;
|
||||||
*) colors+=("$arg") ;;
|
*) colors+=("$arg") ;;
|
||||||
esac
|
esac
|
||||||
|
@ -4758,7 +4758,7 @@ get_args() {
|
||||||
"--ascii" | "--caca" | "--chafa" | "--jp2a" | "--iterm2" | "--off" | "--pixterm" |\
|
"--ascii" | "--caca" | "--chafa" | "--jp2a" | "--iterm2" | "--off" | "--pixterm" |\
|
||||||
"--sixel" | "--termpix" | "--tycat" | "--w3m" | "--kitty")
|
"--sixel" | "--termpix" | "--tycat" | "--w3m" | "--kitty")
|
||||||
image_backend="${1/--}"
|
image_backend="${1/--}"
|
||||||
case "$2" in
|
case $2 in
|
||||||
"-"* | "") ;;
|
"-"* | "") ;;
|
||||||
*) image_source="$2" ;;
|
*) image_source="$2" ;;
|
||||||
esac
|
esac
|
||||||
|
@ -4783,7 +4783,7 @@ get_args() {
|
||||||
"--ascii_colors")
|
"--ascii_colors")
|
||||||
unset ascii_colors
|
unset ascii_colors
|
||||||
for arg in "$2" "$3" "$4" "$5" "$6" "$7"; do
|
for arg in "$2" "$3" "$4" "$5" "$6" "$7"; do
|
||||||
case "$arg" in
|
case $arg in
|
||||||
"-"*) break ;;
|
"-"*) break ;;
|
||||||
*) ascii_colors+=("$arg")
|
*) ascii_colors+=("$arg")
|
||||||
esac
|
esac
|
||||||
|
@ -4804,7 +4804,7 @@ get_args() {
|
||||||
|
|
||||||
# Other
|
# Other
|
||||||
"--config")
|
"--config")
|
||||||
case "$2" in
|
case $2 in
|
||||||
"none" | "off" | "") ;;
|
"none" | "off" | "") ;;
|
||||||
*)
|
*)
|
||||||
config_file="$(get_full_path "$2")"
|
config_file="$(get_full_path "$2")"
|
||||||
|
@ -4922,7 +4922,7 @@ get_distro_ascii() {
|
||||||
# This function gets the distro ascii art and colors.
|
# This function gets the distro ascii art and colors.
|
||||||
#
|
#
|
||||||
# $ascii_distro is the same as $distro.
|
# $ascii_distro is the same as $distro.
|
||||||
case "$(trim "$ascii_distro")" in
|
case $(trim "$ascii_distro") in
|
||||||
"AIX"*)
|
"AIX"*)
|
||||||
set_colors 2 7
|
set_colors 2 7
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
@ -9400,7 +9400,7 @@ EOF
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
case "$kernel_name" in
|
case $kernel_name in
|
||||||
*"BSD")
|
*"BSD")
|
||||||
set_colors 1 7 4 3 6
|
set_colors 1 7 4 3 6
|
||||||
read -rd '' ascii_data <<'EOF'
|
read -rd '' ascii_data <<'EOF'
|
||||||
|
|
Loading…
Reference in a new issue