Created
September 27, 2015 21:37
-
-
Save tmplt/a908ba0496a422dd2fa9 to your computer and use it in GitHub Desktop.
bash script to get get random wallpapers on two screens every 45m
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 | |
WALLPATH_BIG=/home/tmplt/.wallpapers/big/ | |
WALLPATH_SMALL=/home/tmplt/.wallpapers/small/ | |
while true; do | |
# Choose a random wallpaper for the big screen | |
WP_BIG=$(find $WALLPATH_BIG -type f \( -name '*.jpg' -o -name '*.png' \) -print0 | | |
shuf -n1 -z) | |
# .. and the small screen, | |
WP_SMALL=$(find $WALLPATH_SMALL -type f \( -name '*.jpg' -o -name '*.png' \) -print0 | | |
shuf -n1 -z) | |
# My small screen is the first one from left to right. | |
feh --no-fehbg --bg-fill "${WP_SMALL}" --bg-fill "${WP_BIG}" > /dev/null 2>&1 | |
# Throw away all output. | |
sleep 45m | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment