From d3923731022411af9d9ee824f4b8e42468742489 Mon Sep 17 00:00:00 2001 From: Dylan Date: Fri, 8 Jan 2016 12:59:33 +1100 Subject: [PATCH] Fixed wallpapers with spaces in name not working, Fixed Fedora distro detection --- fetch | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/fetch b/fetch index 58692cc1..7b65e103 100755 --- a/fetch +++ b/fetch @@ -238,7 +238,8 @@ case "$os" in distro="CRUX" else distro="$(grep -h '^NAME=' /etc/*ease)" - distro=${distro#NAME\=\"*} + distro=${distro#NAME\=*} + distro=${distro#\"*} distro=${distro%*\"} fi ;; @@ -599,7 +600,9 @@ getvisualstyle () { ;; "Windows"*) - visualstyle="$(head -n1 /proc/registry/HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Themes/CurrentTheme)" + path="/proc/registry/HKEY_CURRENT_USER/Software/Microsoft" + path+="/Windows/CurrentVersion/Themes/CurrentTheme" + visualstyle="$(head -n1 $path)" visualstyle="${visualstyle##*\\}" visualstyle="${visualstyle%.*}" visualstyle="${visualstyle^}" @@ -621,9 +624,7 @@ getvisualstyle () { getwallpaper () { case "$os" in "Linux") - img=$(awk '/feh/ {printf $3}' "$HOME/.fehbg") - img=${img#\'*} - img=${img%*\'} + img="$(awk -F\' '/feh/ {printf $2}' $HOME/.fehbg)" ;; "Windows")