misc: Fixed substitutions.

This commit is contained in:
Dylan Araps 2018-06-25 07:49:12 +10:00
parent 288036eb26
commit c99fc64b67
1 changed files with 19 additions and 19 deletions

View File

@ -930,7 +930,7 @@ get_distro() {
fi fi
distro="$(trim_quotes "$distro")" distro="$(trim_quotes "$distro")"
distro="${distro/'NAME='}" distro="${distro/NAME=}"
;; ;;
"Mac OS X") "Mac OS X")
@ -1184,7 +1184,7 @@ get_uptime() {
"Mac OS X" | "iPhone OS" | "BSD" | "FreeMiNT") "Mac OS X" | "iPhone OS" | "BSD" | "FreeMiNT")
boot="$(sysctl -n kern.boottime)" boot="$(sysctl -n kern.boottime)"
boot="${boot/'{ sec = '}" boot="${boot/\{ sec = }"
boot="${boot/,*}" boot="${boot/,*}"
# Get current date in seconds. # Get current date in seconds.
@ -1419,7 +1419,7 @@ get_de() {
((wm_run != 1)) && get_wm ((wm_run != 1)) && get_wm
if [[ "$XDG_CURRENT_DESKTOP" ]]; then if [[ "$XDG_CURRENT_DESKTOP" ]]; then
de="${XDG_CURRENT_DESKTOP/'X-'}" de="${XDG_CURRENT_DESKTOP/X\-}"
de="${de/Budgie:GNOME/Budgie}" de="${de/Budgie:GNOME/Budgie}"
de="${de/:Unity7:ubuntu}" de="${de/:Unity7:ubuntu}"
@ -1682,7 +1682,7 @@ get_wm_theme() {
wm_theme="$(awk '/(decoration)/ {gsub(/\[/,"",$1); print $1; exit}' "$kdebugrc")" wm_theme="$(awk '/(decoration)/ {gsub(/\[/,"",$1); print $1; exit}' "$kdebugrc")"
fi fi
wm_theme="${wm_theme/'theme='}" wm_theme="${wm_theme/theme=}"
;; ;;
"Quartz Compositor") "Quartz Compositor")
@ -1713,7 +1713,7 @@ get_wm_theme() {
path="${path//\\/\/}" path="${path//\\/\/}"
wm_theme="$(grep '^session\.styleFile:' "${path/\.exe/.rc}")" wm_theme="$(grep '^session\.styleFile:' "${path/\.exe/.rc}")"
wm_theme="${wm_theme/'session.styleFile: '}" wm_theme="${wm_theme/session\.styleFile: }"
wm_theme="${wm_theme##*\\}" wm_theme="${wm_theme##*\\}"
wm_theme="${wm_theme%.*}" wm_theme="${wm_theme%.*}"
;; ;;
@ -2061,8 +2061,8 @@ get_gpu() {
brand="${brand:-${gpu/*AMD*/AMD}}" brand="${brand:-${gpu/*AMD*/AMD}}"
brand="${brand:-${gpu/*ATI*/ATi}}" brand="${brand:-${gpu/*ATI*/ATi}}"
gpu="${gpu/'[AMD/ATI]' }" gpu="${gpu/\[AMD\/ATI\] }"
gpu="${gpu/'[AMD]' }" gpu="${gpu/\[AMD\] }"
gpu="${gpu/OEM }" gpu="${gpu/OEM }"
gpu="${gpu/Advanced Micro Devices, Inc.}" gpu="${gpu/Advanced Micro Devices, Inc.}"
gpu="${gpu/ \/ *}" gpu="${gpu/ \/ *}"
@ -2079,8 +2079,8 @@ get_gpu() {
*"intel"*) *"intel"*)
gpu="${gpu/*Intel/Intel}" gpu="${gpu/*Intel/Intel}"
gpu="${gpu/'(R)'}" gpu="${gpu/\(R\)}"
gpu="${gpu/'Corporation'}" gpu="${gpu/Corporation}"
gpu="${gpu/ \(*}" gpu="${gpu/ \(*}"
gpu="${gpu/Integrated Graphics Controller}" gpu="${gpu/Integrated Graphics Controller}"
gpu="${gpu/*Xeon*/Intel HD Graphics}" gpu="${gpu/*Xeon*/Intel HD Graphics}"
@ -2112,7 +2112,7 @@ get_gpu() {
else else
gpu="$(system_profiler SPDisplaysDataType |\ gpu="$(system_profiler SPDisplaysDataType |\
awk -F': ' '/^\ *Chipset Model:/ {printf $2 ", "}')" awk -F': ' '/^\ *Chipset Model:/ {printf $2 ", "}')"
gpu="${gpu//'/ $'}" gpu="${gpu//\/ \$}"
gpu="${gpu%,*}" gpu="${gpu%,*}"
cache "gpu" "$gpu" cache "gpu" "$gpu"
@ -2172,7 +2172,7 @@ get_gpu() {
*) *)
gpu="$(glxinfo | grep -F 'OpenGL renderer string')" gpu="$(glxinfo | grep -F 'OpenGL renderer string')"
gpu="${gpu/'OpenGL renderer string: '}" gpu="${gpu/OpenGL renderer string: }"
;; ;;
esac esac
;; ;;
@ -3099,7 +3099,7 @@ get_disk() {
for disk in "${disks[@]}"; do for disk in "${disks[@]}"; do
# Create a second array and make each element split at whitespace this time. # Create a second array and make each element split at whitespace this time.
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"*)
@ -3216,9 +3216,9 @@ 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}" ;;
esac esac
} }
@ -3246,7 +3246,7 @@ get_local_ip() {
"Haiku") "Haiku")
local_ip="$(ifconfig | awk -F ': ' '/Bcast/ {print $2}')" local_ip="$(ifconfig | awk -F ': ' '/Bcast/ {print $2}')"
local_ip="${local_ip/', Bcast'}" local_ip="${local_ip/, Bcast}"
;; ;;
esac esac
} }
@ -3516,7 +3516,7 @@ END
esac esac
# Strip un-needed info from the path. # Strip un-needed info from the path.
image="${image/'file://'}" image="${image/file:\/\/}"
image="$(trim_quotes "$image")" image="$(trim_quotes "$image")"
;; ;;
esac esac
@ -4175,7 +4175,7 @@ get_ppid() {
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}"
;; ;;
"Linux") "Linux")
@ -4196,7 +4196,7 @@ get_process_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}"
name="${name/*\/}" name="${name/*\/}"
;; ;;