General: Extend trim_quotes() to the entire script

This commit is contained in:
Dylan Araps 2016-11-16 12:32:55 +11:00
parent e13c9917f7
commit 6cd4584f67
1 changed files with 9 additions and 11 deletions

View File

@ -175,8 +175,7 @@ get_distro() {
[[ -z "${distro// }" ]] && distro="$(awk '/BLAG/ {print $1; exit}' /etc/*ease /usr/lib/*ease)" [[ -z "${distro// }" ]] && distro="$(awk '/BLAG/ {print $1; exit}' /etc/*ease /usr/lib/*ease)"
[[ -z "${distro// }" ]] && distro="$(awk -F'=' '{print $2; exit}' /etc/*ease /usr/lib/*ease)" [[ -z "${distro// }" ]] && distro="$(awk -F'=' '{print $2; exit}' /etc/*ease /usr/lib/*ease)"
fi fi
distro="${distro//\"}" distro="$(trim_quotes "$distro")"
distro="${distro//\'}"
;; ;;
"Mac OS X") "Mac OS X")
@ -529,9 +528,8 @@ get_wm() {
wm="${wm/\"*}" wm="${wm/\"*}"
# Fallback for Wayland wms # Fallback for Wayland wms
case "$wm" in [[ "$wm" == "xwlc" ]] && \
"xwlc") wm="$(ps -e | grep -m 1 -o -F -e "sway" -e "orbment" -e "velox" -e "orbital")" ;; wm="$(ps -e | grep -m 1 -o -F -e "sway" -e "orbment" -e "velox" -e "orbital")"
esac
else else
case "$os" in case "$os" in
@ -660,7 +658,7 @@ get_wm_theme() {
;; ;;
esac esac
wm_theme="${wm_theme//\'}" wm_theme="$(trim_quotes "$wm_theme")"
wm_theme="$(uppercase "$wm_theme")" wm_theme="$(uppercase "$wm_theme")"
} }
@ -981,7 +979,7 @@ get_gpu() {
"FreeBSD"* | "DragonFlyBSD"* | "PacBSD"*) "FreeBSD"* | "DragonFlyBSD"* | "PacBSD"*)
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*= }"
gpu="${gpu//\'}" gpu="$(trim_quotes "$gpu")"
;; ;;
*) *)
@ -1136,7 +1134,7 @@ get_song() {
state="$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 \ state="$(dbus-send --print-reply --dest=org.mpris.MediaPlayer2.rhythmbox /org/mpris/MediaPlayer2 \
org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string: 'PlayBackStatus' |\ org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string: 'PlayBackStatus' |\
awk -F 'string "' '{printf $2}')" awk -F 'string "' '{printf $2}')"
state="${state//\"}" state="$(trim_quotes "$state")"
;; ;;
"banshee"*) "banshee"*)
@ -1283,7 +1281,7 @@ get_style() {
"Gnome"* | "Unity"* | "Budgie"*) "Gnome"* | "Unity"* | "Budgie"*)
if type -p gsettings >/dev/null; then if type -p gsettings >/dev/null; then
gtk3_theme="$(gsettings get org.gnome.desktop.interface "$gsettings")" gtk3_theme="$(gsettings get org.gnome.desktop.interface "$gsettings")"
gtk2_theme="${gtk3_theme}" gtk2_theme="$gtk3_theme"
elif type -p gconftool-2 >/dev/null; then elif type -p gconftool-2 >/dev/null; then
gtk2_theme="$(gconftool-2 -g /desktop/gnome/interface/"$gconf")" gtk2_theme="$(gconftool-2 -g /desktop/gnome/interface/"$gconf")"
@ -1292,7 +1290,7 @@ get_style() {
"Mate"*) "Mate"*)
gtk3_theme="$(gsettings get org.mate.interface "$gsettings")" gtk3_theme="$(gsettings get org.mate.interface "$gsettings")"
gtk2_theme="${gtk3_theme}" gtk2_theme="$gtk3_theme"
;; ;;
"Xfce"*) "Xfce"*)
@ -1966,7 +1964,7 @@ get_wallpaper() {
# Strip quotes etc from the path. # Strip quotes etc from the path.
image="${image/'file://'}" image="${image/'file://'}"
image="${image//\'}" image="$(trim_quotes "$image")"
image="${image//\%20/ }" image="${image//\%20/ }"
fi fi
;; ;;