diff --git a/dotfiles/config/systemd/user/wallpaper.service b/dotfiles/config/systemd/user/wallpaper.service new file mode 100644 index 00000000..f9994215 --- /dev/null +++ b/dotfiles/config/systemd/user/wallpaper.service @@ -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 diff --git a/dotfiles/lib/bin/wallpaper.sh b/dotfiles/lib/bin/wallpaper.sh new file mode 100755 index 00000000..a560bc3e --- /dev/null +++ b/dotfiles/lib/bin/wallpaper.sh @@ -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