Created
April 28, 2020 01:26
-
-
Save mooreniemi/515fa1fda37f20a62ca87672a4ad7932 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
#! /bin/bash | |
# http://unix.stackexchange.com/questions/230238/starting-x-applications-from-the-terminal-and-the-warnings-that-follow | |
export NO_AT_BRIDGE=1 | |
WALLPAPERS="/home/alex/Dropbox/backgrounds" | |
ALIST=( `ls -w1 $WALLPAPERS` ) | |
RANGE=${#ALIST[@]} | |
let "number = $RANDOM" | |
let LASTNUM="`cat $WALLPAPERS/.last` + $number" | |
let "number = $LASTNUM % $RANGE" | |
echo $number > $WALLPAPERS/.last | |
nitrogen --set-scaled --save $WALLPAPERS/${ALIST[$number]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment