added random local wallpaper via hyprpaper

This commit is contained in:
Carlos Sousa 2025-03-08 23:17:45 +01:00
parent 1a172f2e5f
commit a21694b1c6
6 changed files with 40 additions and 0 deletions

View File

@ -23,3 +23,4 @@ exec-once = syncthing --no-browser &
# Wallpaper
exec-once = hyprpaper
exec-once = systemctl --user start random_hyprpaper.timer

View File

View File

@ -0,0 +1,4 @@
# Example for Wallpaper Directories
# All sub directories are included
#WALLPAPER_DIR="/mnt/data/Zebra/Photos/Edited"

View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
# Source the config file from the same directory as the script
SCRIPT_DIR=$(dirname "$0")
source "$SCRIPT_DIR/config"
CURRENT_WALL=$(hyprctl hyprpaper listloaded)
# Get a random wallpaper that is not the current one
WALLPAPER=$(find "$WALLPAPER_DIR" -type f ! -name "$(basename "$CURRENT_WALL")" | shuf -n 1)
# Apply the selected wallpaper
hyprctl hyprpaper reload ,"$WALLPAPER"

View File

@ -0,0 +1,6 @@
[Unit]
Description=Set a random wallpaper with waypaper
[Service]
Type=oneshot
ExecStart=%h/.config/hypr/scripts/random_hyprpaper.sh

View File

@ -0,0 +1,16 @@
[Unit]
Description=Set a random wallpaper every minute
[Timer]
Persistent=true
# Every Minute
#OnCalendar=*:0/1
# Every 30 Minutes
OnCalendar=*:0/30
# Every Hour
#OnCalendar=*:00
[Install]
WantedBy=timers.target