mirror of https://github.com/tiyn/dotfiles
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
599 B
16 lines
599 B
5 years ago
|
#!/bin/sh
|
||
5 years ago
|
|
||
1 year ago
|
# Based on a script by lukesmithxyz, checkout github.com/lukesmithxyz/voidrice
|
||
5 years ago
|
|
||
2 years ago
|
bgloc="${XDG_DATA_HOME:-$HOME/.local/share}/bg"
|
||
5 years ago
|
|
||
|
|
||
2 years ago
|
trueloc="$(readlink -f "$1")" &&
|
||
|
case "$(file --mime-type -b "$trueloc")" in
|
||
|
image/* ) ln -f "$(readlink -f "$1")" "$bgloc" && notify-send -i "$bgloc" "Changing wallpaper..." ;;
|
||
|
inode/directory ) ln -f "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" && notify-send -i "$bgloc" "Random Wallpaper chosen." ;;
|
||
|
*) notify-send "🖼️ Error" "Not a valid image or directory." ; exit 1;;
|
||
|
esac
|
||
|
|
||
|
xwallpaper --zoom "$bgloc"
|