forked from colonelpanic/dotfiles
[Linux] Add wallpaper service
This commit is contained in:
parent
0c9f2371a0
commit
bbebb5bc4d
10
dotfiles/config/systemd/user/wallpaper.service
Normal file
10
dotfiles/config/systemd/user/wallpaper.service
Normal file
@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=wallpaper
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/bash "wallpaper.sh"
|
||||
ExecStop=/usr/bin/pkill wallpaper.sh
|
||||
|
||||
[Install]
|
||||
WantedBy=wm.target
|
16
dotfiles/lib/bin/wallpaper.sh
Executable file
16
dotfiles/lib/bin/wallpaper.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
WALLPAPER_DIR="$HOME/Pictures/wallpaper/"
|
||||
|
||||
random_paper() {
|
||||
find "$WALLPAPER_DIR"use -type f | shuf -n1
|
||||
}
|
||||
|
||||
wallpaper() {
|
||||
while true; do
|
||||
feh --bg-center $(random_paper) --bg-scale "$WALLPAPER_DIR"transparent1x1.png
|
||||
sleep 1m
|
||||
done
|
||||
}
|
||||
|
||||
wallpaper
|
Loading…
Reference in New Issue
Block a user