Set the background and remove notification for now

This commit is contained in:
2021-05-10 18:57:38 +01:00
parent 285bf62fce
commit dae9493b22
2 changed files with 3 additions and 2 deletions

View File

@@ -11,8 +11,8 @@ bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg"
trueloc="$(readlink -f "$1")" &&
case "$(file --mime-type -b "$trueloc")" in
image/* ) ln -sf "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." ;;
inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random Wallpaper chosen." ;;
image/* ) ln -sf "$(readlink -f "$1")" "$bgloc" ;;
inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" ;;
*) notify-send "Error" "Not a valid image." ; exit 1;;
esac