- #!/bin/sh
- bgloc="${XDG_DATA_HOME:-$HOME/.local/share/}/bg.png"
- trueloc="$(readlink -f "$1")" &&
- case "$(file --mime-type -b "$trueloc")" in
- image/* ) ln -sf "$(readlink -f "$1")" "$bgloc" ;;
- inode/directory ) ln -sf "$(find "$trueloc" -iregex '.*.\(jpg\|jpeg\|png\|gif\)' -type f | shuf -n 1)" "$bgloc" ;;
- esac
- xwallpaper --zoom "$bgloc"
|