diff --git a/.local/bin/setbg b/.local/bin/setbg index 5f70fa54..a3c0c4af 100755 --- a/.local/bin/setbg +++ b/.local/bin/setbg @@ -9,7 +9,8 @@ # Location of link to wallpaper link. bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg" -[ -f "$1" ] && ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." +[ -f "$1" ] && ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." || + { [ -n "$1" ] && xwallpaper --"$1" "$bgloc" && exit 1;} [ -d "$1" ] && ln -sf "$(find "$(readlink -f "$1")" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random Wallpaper chosen."