Skip to content

Instantly share code, notes, and snippets.

@Leinnan
Created June 18, 2016 14:24
Show Gist options
  • Save Leinnan/bd85cdd418033f434d537baa4ef5ffc9 to your computer and use it in GitHub Desktop.
Save Leinnan/bd85cdd418033f434d537baa4ef5ffc9 to your computer and use it in GitHub Desktop.
#!/bin/bash
shopt -s nullglob
cd ~/Obrazy/Tapety/
while true; do
files=()
for i in *.jpg *.png; do
[[ -f $i ]] && files+=("$i")
done
range=${#files[@]}
if grep -q "sway" <<< "$XDG_CURRENT_DESKTOP" ; then
output "*" background "${files[RANDOM % range]}" fill
else
((range)) && feh --bg-scale "${files[RANDOM % range]}"
fi
sleep 15m
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment