-
-
Save lesliesrussell/68b733fad3df14aeea5a6342ab82b61a to your computer and use it in GitHub Desktop.
A simple bash script using feh and date to enjoy a different background every day!
This file contains hidden or 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/bash | |
NIGHT_PAPERS=~/Pictures/wallpaper/blue/* | |
DAY_PAPERS=~/Pictures/wallpaper/amber/* | |
if [ $(( $(date --date=now +10#%H) )) -gt 6 ] && [ $(( $(date --date=now +10#%H) )) -lt 19 ] | |
then | |
WALLPAPER_DIR=$DAY_PAPERS | |
else | |
WALLPAPER_DIR=$NIGHT_PAPERS | |
fi | |
# ARRAY=$(ls $WALLPAPER_DIR |sed 's/ /\n/g') | |
# cd $WALLPAPER_DIR | |
ARRAY=($WALLPAPER_DIR) | |
N1=$((RANDOM % $(ls -l $WALLPAPER_DIR | grep -v ^d | wc -l))) | |
WALLPAPER=${ARRAY[$N1]} | |
wal -i $WALLPAPER && killall -USR1 compton /dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I drop this script in an i3bar block running at an interval. Changes wallpaper based on time of day. Still testing.