hyprland: handle locked dpsm with swayidle

This commit is contained in:
NullBite 2024-03-31 02:46:20 -04:00
parent f1b07c85f2
commit efaeab06be
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
2 changed files with 10 additions and 6 deletions

View File

@ -63,11 +63,11 @@ in
onTimeout = cfg.commands.dpms-off;
onResume = cfg.commands.dpms-on;
}
{
timeout = cfg.timeouts.locked-dpms;
onTimeout = "${lock-dpms}";
onResume = cfg.commands.dpms-on;
}
# {
# timeout = cfg.timeouts.locked-dpms;
# onTimeout = "${lock-dpms}";
# onResume = cfg.commands.dpms-on;
# }
{
timeout = cfg.timeouts.lock;
onTimeout = "${lock}";

View File

@ -33,7 +33,11 @@ let
# idle-cmd = "${swayidle} -w timeout 315 '${lock-cmd}' timeout 300 '${hyprctl} dispatch dpms off' resume '${hyprctl} dispatch dpms on' before-sleep '${lock-cmd}' lock '${lock-cmd}' unlock '${pkill} -USR1 -x swaylock'";
# idle-cmd = "${swayidle} -w timeout 300 '${hyprctl} dispatch dpms off' resume '${hyprctl} dispatch dpms on'";
# idle-cmd = "${hypridle}";
idle-cmd = "${pkgs.coreutils}/bin/true";
# idle-cmd = "${pkgs.coreutils}/bin/true";
idle-cmd = pkgs.writeShellScript "idle-dpms-lock" ''
${swayidle} timeout 10 'pgrep -x swaylock > /dev/null && hyprctl dispatch dpms off' \
resume 'hyprctl dispatch dpms on'
'';
hypr-dispatcher-package = pkgs.callPackage ./dispatcher { hyprland = hyprland-pkg; };
hypr-dispatcher = "${hypr-dispatcher-package}/bin/hypr-dispatcher";