Skip to content

Commit

Permalink
remove system sleep on idle
Browse files Browse the repository at this point in the history
  • Loading branch information
ecarlson94 committed Mar 17, 2024
1 parent 530dec2 commit 8aebcee
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions modules/home/desktop/hyprland/hypridle.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
{ lib, config, pkgs, ... }:
{ lib, config, ... }:
with lib;
let
cfg = config.modules.desktop.hypridle;

suspendScript = pkgs.writeShellScript "suspend-script" ''
${pkgs.pipewire}/bin/pw-cli i all | ${pkgs.ripgrep}/bin/rg running
# only suspend if audio isn't running
if [ $? == 1 ]; then
systemctl suspend
fi
'';
in
{
options.modules.desktop.hypridle = { enable = mkEnableOption "hypridle"; };
Expand All @@ -31,10 +23,6 @@ in
onTimeout = "hyprctl dispatch dpms off"; # screen off after timeout
onResume = "hyprctl dispatch dpms on"; # screen on when activity is detected after timeout has fired
}
{
timeout = 1800; # 30 minutes
onTimeout = suspendScript.outPath; # suspend pc
}
];
};
};
Expand Down

0 comments on commit 8aebcee

Please sign in to comment.