[Linux] Add wallpaper service

This commit is contained in:
Ivan Malison 2016-09-27 15:08:35 -07:00
parent 0c9f2371a0
commit bbebb5bc4d
No known key found for this signature in database
GPG Key ID: 62530EFBE99DC2F8
2 changed files with 26 additions and 0 deletions

View 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
View 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