lock on suspend + manual

This commit is contained in:
Odweta
2026-01-11 20:17:24 +01:00
parent 5f6db95c9a
commit bc1c93759c
3 changed files with 24 additions and 3 deletions
+1
View File
@@ -23,6 +23,7 @@
./fonts.nix
./hardware-configuration.nix
./hyprland-system.nix
./lock-suspend.nix
./networking.nix
./nix-settings.nix
./opengl.nix
+4 -3
View File
@@ -69,8 +69,9 @@
};
"$mod" = "SUPER";
"$term" = "kitty";
"$menu" = "wofi --show run";
"$term" = "${pkgs.kitty}/bin/kitty";
"$menu" = "${pkgs.wofi}/bin/wofi --show run";
"$lock" = "${pkgs.hyprlock}/bin/hyprlock -n";
bind = [
"$mod SHIFT, RETURN, exec, $term"
@@ -78,7 +79,7 @@
"$mod SHIFT, Q, exit"
"$mod, P, exec, $menu"
"$mod, mouse:272, movewindow"
"$mod, L, exec, $lock"
"$mod, H, movefocus, l"
"$mod, J, movefocus, r"
+19
View File
@@ -0,0 +1,19 @@
{ config, pkgs, ... }:
{
services.logind = {
lidSwitch = "suspend"; # suspend on lid close
handleLidSwitch = "suspend"; # explicit
};
systemd.services.hyprlock-pre-suspend = {
description = "Lock screen before suspend";
serviceConfig = {
Type = "oneshot";
# Run as your user
ExecStart = "${pkgs.hyprlock}/bin/hyprlock -n";
};
install.wantedBy = [ "sleep.target" ];
};
}