Created
April 23, 2016 15:15
-
-
Save LordAro/2cb1d8ad3786a2d80e7a48bad8e98bed to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env sh | |
WALL_DIR=${HOME}/Pictures/Backgrounds | |
PORTRAIT="" | |
LANDSCAPE="" | |
for i in ${WALL_DIR}/*; do | |
set -- $(identify -ping -format "%w %h" "$i") | |
if [ "$2" -lt "$1" ]; then | |
LANDSCAPE+="$i " | |
else | |
PORTRAIT+="$i " | |
fi | |
done | |
PORTL=$(echo ${PORTRAIT} | tr ' ' '\n' | shuf -n1) | |
LAND=$(echo ${LANDSCAPE} | tr ' ' '\n' | shuf -n1) | |
PORTR=$(echo ${PORTRAIT} | tr ' ' '\n' | shuf -n1) | |
feh --no-fehbg --bg-fill $LAND $PORTR $PORTL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment