Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

35 lines
1009 B

#!/bin/sh
if [ "$1" = "-f" ]; then
cached=""
else
cached=$(cat "$XDG_RUNTIME_DIR"/day_cache)
fi
hour=$(date +"%-H")
morning=6
afternoon=12
night=19
if [ "$hour" -le "$morning" ]; then
if [ ! "$cached" = "night" ]; then
feh --no-fehbg --bg-fill "$(find ~/.local/backgrounds/evening | sort -R | tail -1 )"
echo "night" > "$XDG_RUNTIME_DIR/day_cache"
fi
elif [ "$night" -le "$hour" ]; then
if [ ! "$cached" = "night" ]; then
feh --no-fehbg --bg-fill "$(find ~/.local/backgrounds/evening | sort -R | tail -1 )"
echo "night" > "$XDG_RUNTIME_DIR/day_cache"
fi
elif [ "$afternoon" -le "$hour" ]; then
if [ ! "$cached" = "afternoon" ]; then
feh --no-fehbg --bg-fill "$(find ~/.local/backgrounds/afternoon| sort -R | tail -1 )"
echo "afternoon" > "$XDG_RUNTIME_DIR/day_cache"
fi
else
if [ ! "$cached" = "morning" ]; then
feh --no-fehbg --bg-fill "$(find ~/.local/backgrounds/morning | sort -R | tail -1 )"
echo "morning" > "$XDG_RUNTIME_DIR/day_cache"
fi
fi