Last active
August 29, 2015 14:17
-
-
Save j1cs/1cd98a43f9d14fe4d264 to your computer and use it in GitHub Desktop.
Random wallpaper
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/bash | |
# Reads a given directory and set a random | |
# wallpaper using the images on that dir. | |
# fluxbox wm | |
WALLPAPERDIR="$HOME/wallpapers" | |
if [[ -d "${WALLPAPERDIR}" ]] | |
then | |
while(true) | |
do | |
files=$(ls "${WALLPAPERDIR}") | |
file_matrix=($files) | |
num_files=${#file_matrix[*]} | |
#feh --bg-scale | |
fbsetbg "${WALLPAPERDIR}/${file_matrix[$((RANDOM%num_files))]}" | |
sleep 5m | |
#sleep 5s | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment