diff --git a/backgrounds/island_1.jpg b/backgrounds/island_1.jpg new file mode 100644 index 0000000..1e33cc1 Binary files /dev/null and b/backgrounds/island_1.jpg differ diff --git a/backgrounds/island_2.jpg b/backgrounds/island_2.jpg new file mode 100644 index 0000000..a66f128 Binary files /dev/null and b/backgrounds/island_2.jpg differ diff --git a/backgrounds/island_3.jpg b/backgrounds/island_3.jpg new file mode 100644 index 0000000..d2855a8 Binary files /dev/null and b/backgrounds/island_3.jpg differ diff --git a/hyperland/default.nix b/hyperland/default.nix index 86185e2..34c34f8 100644 --- a/hyperland/default.nix +++ b/hyperland/default.nix @@ -32,17 +32,32 @@ in networkmanagerapplet grim grimblast + hyprpaper # (pkgs.waybar.overrideAttrs (oldAttrs: { # mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; # })) ]; + services.hyprpaper = { + enable = true; + settings = { + ipc = false; + splash = true; + splash_offset = 5; + splash_color = "rgb(ebdbb8)"; + + preload = [ "$HOME/.nixos-config/backgrounds/island_1.jpg" ]; + wallpaper = [ ",$HOME/.nixos-config/backgrounds/island_1.jpg" ]; + }; + }; + programs.hyprlock = { enable = true; settings = { background = { monitor = ""; # path = screenshot + path = "$HOME/.nixos-config/backgrounds/island_2.jpg"; color = "rgba(152, 179, 166, 0.9)"; blur_passes = 1; @@ -113,6 +128,53 @@ in }; }; + services.hypridle = { + enable = true; + settings = { + general = { + before_sleep_cmd = "loginctl lock-session"; + lock_cmd = "${pkgs.procps}/bin/pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; + # unlock_cmd = "loginctl unlock-session"; + after_sleep_cmd = "hyprctl dispatch dpms on && notify-send \"Back from idle.\" \"Welcome back!\""; + }; + listener = [ + { + timeout = 5; + on-timeout = "pidof hyprlock && hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + { + timeout = 150; # 2.5min. + on-timeout = "light -O && light -S 10"; # set monitor backlight to minimum, avoid 0 on OLED monitor. + on-resume = "light -I"; # monitor backlight restore. + } + { + timeout = 300; + on-timeout = "playerctl pause"; + } + { + timeout = 270; + on-timeout = "notify-send \"Idle\" \"You're idle... locking in 30s.\""; + } + { + timeout = 300; # 5min + on-timeout = "loginctl lock-session"; # lock screen when timeout has passed + } + + { + timeout = 330; # 5.5min + on-timeout = "hyprctl dispatch dpms off"; # screen off when timeout has passed + on-resume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired. + } + + { + timeout = 1800; # 30min + on-timeout = "systemctl suspend"; # suspend pc + } + ]; + }; + }; + wayland.windowManager.hyprland.enable = true; wayland.windowManager.hyprland.settings = { monitor=[ @@ -132,6 +194,8 @@ in "${pkgs.networkmanagerapplet}/bin/nm-applet --sm-disable --indicator" "blueman-applet" "${pkgs.libsForQt5.polkit-kde-agent}/libexec/polkit-kde-authentication-agent-1" + "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" + "systemctl --user start hyprpaper.service" # they are enabled, but don't start because they try to start before WAYLAND_DISPLAY is set ];