All of my important config files
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

14 lines
341 B

#!/usr/bin/env zsh
set -euo pipefail
DIR="$HOME/Pictures/wallpaper"
TMPLIST="/tmp/wallpaper-list"
if [[ ! -e "$TMPLIST" ]]; then
FILES=$(ls $DIR | shuf)
echo "$FILES" >> "$TMPLIST"
fi
IMG=$(tail -n1 $TMPLIST)
truncate -s "-$(( ${#IMG} + 1 ))" $TMPLIST
feh "$DIR/$IMG" --bg-fill
grep -q '[^[:space:]]' < "$TMPLIST" || rm "$TMPLIST"