-
-
Save mcpcpc/4123dacda12c3a3d300aa421f9f7f10e to your computer and use it in GitHub Desktop.
KISS Linux Background Update and Display
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -f | |
# | |
# POSIX sh background setter | |
img() { | |
[ -d "$1" ] && { | |
set +f | |
set -f -- "$1/"* | |
shift "$(shuf -i "1-$#" -n 1)" | |
} | |
[ -f "${img:=$1}" ] || exit 1 | |
printf '%s\n' "$img" | |
} | |
main() { | |
# mkdir -p "${cache_dir:=${XDG_CACHE_HOME:=${HOME}/.cache}/bud}" | |
img "$1" | |
display \ | |
-page 3200x \ | |
-sample 3200x \ | |
-window root \ | |
"$img" & | |
} | |
main "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment