Created
October 15, 2016 12:25
-
-
Save LordAro/6849b98d9329a41f58cc2b8f091acd59 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