diff --git a/home-manager/shared/wayland/default.nix b/home-manager/shared/wayland/default.nix index 276a903..3f15fe0 100644 --- a/home-manager/shared/wayland/default.nix +++ b/home-manager/shared/wayland/default.nix @@ -36,13 +36,6 @@ temperature.day = 6000; temperature.night = 3500; }; - swayidle = { - enable = true; - events = { - "before-sleep" = "${config.programs.swaylock.package}/bin/swaylock"; - "lock" = "${config.programs.swaylock.package}/bin/swaylock"; - }; - }; mako.enable = true; mako.settings = { default-timeout = 5; @@ -62,14 +55,6 @@ } ''; }; - swaylock = { - enable = true; - settings = { - image = "/home/pape"; - daemonize = true; - ignore-empty-password = true; - }; - }; }; xdg = { configFile."mimeapps.list".force = true; diff --git a/home-manager/shared/wayland/hyprland/default.nix b/home-manager/shared/wayland/hyprland/default.nix index 0287231..f6373c8 100644 --- a/home-manager/shared/wayland/hyprland/default.nix +++ b/home-manager/shared/wayland/hyprland/default.nix @@ -87,7 +87,7 @@ "$mod, b, exec, pkill -SIGUSR1 waybar" "$mod, bracketleft, exec, grimshot --notify save area /tmp/scrot-$(date \"+%Y-%m-%d\"T\"%H:%M:%S\").png" "$mod, bracketright, exec, grimshot --notify copy area" - "$mod SHIFT, q, exec, swaylock" + "$mod SHIFT, q, exec, hyprlock" ",XF86MonBrightnessDown, exec, light -U 10" ",XF86MonBrightnessUp, exec, light -A 10" ",XF86AudioRaiseVolume, exec, pactl set-sink-volume @DEFAULT_SINK@ +1%" @@ -126,7 +126,7 @@ let c = (x + 1) / 10; in - builtins.toString (x + 1 - (c * 10)); + toString (x + 1 - (c * 10)); in [ "$mod, ${ws}, focusworkspaceoncurrentmonitor, ${toString (x + 1)}" @@ -169,6 +169,49 @@ splash = false; }; }; + services.hypridle = { + enable = true; + settings = { + general = { + after_sleep_cmd = "hyprctl dispatch dpms on"; + ignore_dbus_inhibit = false; + lock_cmd = "hyprlock"; + }; + listener = [ + { + timeout = 900; + on-timeout = "hyprlock"; + } + { + timeout = 1200; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + ]; + }; + }; + programs.hyprlock = { + enable = true; + settings = { + background = { + monitor = ""; + path = "/home/pape"; + blur_passes = 5; + }; + general = { + ignore_empty_input = true; + }; + input-field = { + monitor = ""; + size = "5%, 5%"; + outline_thickness = 1; + inner_color = "rgba(0, 0, 0, 0.0)"; + hide_input = true; + halign = "center"; + valign = "center"; + }; + }; + }; programs.waybar = { enable = true; systemd.enable = true; diff --git a/nixos/t14/configuration.nix b/nixos/t14/configuration.nix index 94b0ff5..e7eb9a4 100755 --- a/nixos/t14/configuration.nix +++ b/nixos/t14/configuration.nix @@ -57,7 +57,7 @@ in }; }; - security.pam.services.swaylock = { }; + security.pam.services.hyprlock = { }; xdg.portal = { enable = true; xdgOpenUsePortal = false;