rice/scripts/wallpaper.sh

24 lines
522 B
Bash
Raw Permalink Normal View History

2021-07-28 23:54:53 -07:00
#!/bin/bash
set -Eeuo pipefail
dir="/usr/share/wallpapers/"
EXT="/contents/images/1920x1080.jpg"
EXT2="/contents/images/"
count=0
# choose a random directory in wallpapers folder
chosen=$(ls /usr/share/wallpapers | shuf -n 1)
# check to make sure it is a directory
if [[ -d $dir$chosen ]]; then
if [[ -f "$dir$chosen$EXT" ]]; then
feh --bg-scale $dir$chosen$EXT
file=$chosen
else
file=$(ls $dir$chosen$EXT2 | shuf -n 1)
2022-01-02 20:19:13 -08:00
feh --bg-scale $dir$chosen$EXT2$file
2021-07-28 23:54:53 -07:00
fi
echo $file
else
echo 'something went wrong'
fi