actually fix locking and idle, fr this time

This commit is contained in:
Reid 2024-04-25 23:46:42 -07:00
parent 085d68b27d
commit 2aa9e86a5d
2 changed files with 13 additions and 10 deletions

View file

@ -14,16 +14,18 @@ in {
};
config = mkIf cfg.enable {
hm.services.hypridle = {
hm.services.hypridle = let
hyprctl = "${config.modules.desktop.hyprland.package}/bin/hyprctl";
in {
enable = true;
package = cfg.package;
lockCmd = "${pkgs.procps}/bin/pidof hyprlock || ${config.modules.desktop.hyprland.package}/bin/hyprctl dispatch exec ${lib.getExe config.modules.desktop.hyprlock.package}";
lockCmd = "${pkgs.procps}/bin/pidof hyprlock || ${hyprctl} dispatch exec ${lib.getExe config.modules.desktop.hyprlock.package}";
unlockCmd = "${pkgs.procps}/bin/pkill -USR1 hyprlock";
listeners = let
hyprctl = "${config.modules.desktop.hyprland.package}/bin/hyprctl";
in [
beforeSleepCmd = "${pkgs.systemd}/bin/loginctl lock-session";
listeners = [
{
timeout = 90; # 1.5 min
onTimeout = "${hyprctl} dispatch dpms off"; # turn off screen
@ -31,11 +33,11 @@ in {
}
{
timeout = 60 * 2; # 2 min
onTimeout = "loginctl lock-session"; # lock computer
onTimeout = "${pkgs.systemd}/bin/loginctl lock-session"; # lock computer
}
{
timeout = 60 * 30; # 30 min
onTimeout = "systemctl suspend"; # sleep/suspend
onTimeout = "${pkgs.systemd}/bin/systemctl suspend"; # sleep/suspend
}
];
};