dynamic wallpapers :3

This commit is contained in:
2025-01-09 00:38:14 +01:00
parent 1652581f95
commit 3bdbf51983
4 changed files with 41 additions and 0 deletions

26
wallpaper/script.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
PATHNAME=~/wallpaper/
cd $PATHNAME
printf -v date "%(%H)T"
LAST=-1
FOUND=-1
for filename in $(ls *.png | sort -g)
do
if ((${filename%%.*} >= date && ${FOUND%%.*} == -1));then
echo ${FOUND%%.*}
FOUND=$LAST
if ((${FOUND%%.*}==-1));then
FOUND=-2
fi
fi
LAST=$filename
done
if ((${FOUND%%.*} < 0));then
FOUND=$LAST
fi
hyprctl hyprpaper wallpaper ",$PATHNAME$FOUND"
echo ${FOUND%%.*}