diff --git a/home/home.nix b/home/home.nix index 181608f..18977d0 100644 --- a/home/home.nix +++ b/home/home.nix @@ -233,6 +233,12 @@ source = ./scripts/screenshot.sh; executable = true; }; + + # Wallpaper script + home.file.".local/bin/set-wallpaper" = { + source = ./scripts/set-wallpaper.sh; + executable = true; + }; # Flatpaks are managed in system/flatpak.nix diff --git a/home/hyprland.nix b/home/hyprland.nix index fb3aa42..16eabca 100644 --- a/home/hyprland.nix +++ b/home/hyprland.nix @@ -13,12 +13,8 @@ # Autostart applications exec-once = [ - # For GIF/WebP/static images - use swww (works on all monitors): - # "swww-daemon && swww img ~/nix-flake/assets/wallpaper.gif" - - # For MP4 videos - run separate instances per monitor for proper scaling: - "mpvpaper -o 'no-audio loop' DP-2 ~/nix-flake/assets/wallpaper.mp4" - "mpvpaper -o 'no-audio loop' DP-1 ~/nix-flake/assets/wallpaper.mp4" + # Set wallpaper on all monitors automatically + "$HOME/.local/bin/set-wallpaper" "ags run --gtk 4" # Start AGS with colorshell (includes notification daemon) # "dunst" # Disabled - colorshell handles notifications diff --git a/home/scripts/set-wallpaper.sh b/home/scripts/set-wallpaper.sh new file mode 100644 index 0000000..5cfbaad --- /dev/null +++ b/home/scripts/set-wallpaper.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Set wallpaper on all connected monitors using mpvpaper + +WALLPAPER="$HOME/nix-flake/assets/wallpaper.mp4" + +# Kill existing mpvpaper instances +pkill -9 mpvpaper 2>/dev/null + +# Get all connected monitors from Hyprland +MONITORS=$(hyprctl monitors -j | jq -r '.[].name') + +# Start mpvpaper for each monitor +for monitor in $MONITORS; do + mpvpaper -o 'no-audio loop' "$monitor" "$WALLPAPER" & +done