diff --git a/home/desktop.nix b/home/desktop.nix index 2c4fa37..1c682f2 100644 --- a/home/desktop.nix +++ b/home/desktop.nix @@ -233,4 +233,8 @@ [urgency_normal] background = "#1e1e2e"; foreground = "#cdd6f4"; timeout = 5 [urgency_critical] background = "#f38ba8"; foreground = "#1e1e2e"; timeout = 0 ''; + # === Wallpaper rotation === + home.file.".local/bin/wallpaper-rotate" = { + source = ./wallpaper-rotate.sh; + }; } diff --git a/home/hyprland.conf b/home/hyprland.conf index 09b7875..0925cc1 100644 --- a/home/hyprland.conf +++ b/home/hyprland.conf @@ -12,6 +12,8 @@ exec-once = dunst exec-once = wl-paste --type text --watch cliphist store exec-once = wl-paste --type image --watch cliphist store exec-once = hypridle +exec-once = awww +exec-once = sleep 1 && ~/.local/bin/wallpaper-rotate input { kb_layout = us diff --git a/home/wallpaper-rotate.sh b/home/wallpaper-rotate.sh new file mode 100644 index 0000000..04d3e31 --- /dev/null +++ b/home/wallpaper-rotate.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +set -o pipefail + +# Wallpapers are in the laptop-config repo +WALLPAPER_DIR="$HOME/laptop-config/wallpapers" +CACHE_FILE="$HOME/.cache/current-wallpaper" + +mapfile -t wallpapers < <(find "$WALLPAPER_DIR" -maxdepth 1 -type f \( -iname "*.png" -o -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.gif" \) | sort) +count="${#wallpapers[@]}" + +if [ "$count" -eq 0 ]; then + echo "No wallpapers found in $WALLPAPER_DIR" + exit 1 +fi + +current=$(cat "$CACHE_FILE" 2>/dev/null || echo "") +chosen="$current" +while [ "$chosen" = "$current" ] && [ "$count" -gt 1 ]; do + chosen="${wallpapers[$((RANDOM % count))]}" +done + +echo "$chosen" > "$CACHE_FILE" +awww img "$chosen" diff --git a/modules/laptop.nix b/modules/laptop.nix index fc43afc..1896d03 100644 --- a/modules/laptop.nix +++ b/modules/laptop.nix @@ -189,12 +189,13 @@ # === Boot === boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; -} - + # === SSH Server === services.openssh = { enable = true; settings.PasswordAuthentication = false; openFirewall = true; }; + +boot.loader.efi.canTouchEfiVariables = true; +} \ No newline at end of file diff --git a/wallpapers/center-cross.png b/wallpapers/center-cross.png new file mode 100644 index 0000000..61c2315 Binary files /dev/null and b/wallpapers/center-cross.png differ diff --git a/wallpapers/great-commission.png b/wallpapers/great-commission.png new file mode 100644 index 0000000..8b8b099 Binary files /dev/null and b/wallpapers/great-commission.png differ diff --git a/wallpapers/offset-cross.png b/wallpapers/offset-cross.png new file mode 100644 index 0000000..6308042 Binary files /dev/null and b/wallpapers/offset-cross.png differ diff --git a/wallpapers/walk-with-god.png b/wallpapers/walk-with-god.png new file mode 100644 index 0000000..5ddbdda Binary files /dev/null and b/wallpapers/walk-with-god.png differ