Files
dotfiles/.i3/scripts/rotate_background.sh

10 lines
304 B
Bash
Executable File

#! /bin/bash
WALLPAPERS="/home/tristan/Pictures/bg_1440p"
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]}