dynamic wallpapers :3
This commit is contained in:
1
.config/systemd/user/timers.target.wants/wallpaper.timer
Symbolic link
1
.config/systemd/user/timers.target.wants/wallpaper.timer
Symbolic link
@@ -0,0 +1 @@
|
||||
/home/amy/.config/systemd/user/wallpaper.timer
|
||||
6
.config/systemd/user/wallpaper.service
Normal file
6
.config/systemd/user/wallpaper.service
Normal file
@@ -0,0 +1,6 @@
|
||||
[Unit]
|
||||
Description=Time based wallpaper switcher
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=%h/wallpaper/script.sh
|
||||
8
.config/systemd/user/wallpaper.timer
Normal file
8
.config/systemd/user/wallpaper.timer
Normal file
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Run foo weekly and on boot
|
||||
|
||||
[Timer]
|
||||
OnCalendar=minutely
|
||||
Persistent=false
|
||||
[Install]
|
||||
WantedBy=timers.target
|
||||
26
wallpaper/script.sh
Executable file
26
wallpaper/script.sh
Executable 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%%.*}
|
||||
Reference in New Issue
Block a user