diff --git a/modules/home/services/hypridle/default.nix b/modules/home/services/hypridle/default.nix index 6e7dfe9..6b082a9 100644 --- a/modules/home/services/hypridle/default.nix +++ b/modules/home/services/hypridle/default.nix @@ -16,12 +16,8 @@ let cfg = config.${namespace}.services.hypridle; # Script that suspends only when on battery power. - # When plugged in, uses systemd-inhibit to block suspend. suspendScript = pkgs.writeShellScript "hypridle-suspend" '' - if [ "$(${pkgs.coreutils}/bin/cat /sys/class/power_supply/AC/online)" = "1" ]; then - # Plugged in - inhibit suspend - ${pkgs.systemd}/bin/systemd-inhibit --what=sleep --who=hypridle --why="AC power connected" --mode=block ${pkgs.coreutils}/bin/sleep infinity & - else + if [ "$(${pkgs.coreutils}/bin/cat /sys/class/power_supply/AC/online)" != "1" ]; then # On battery - suspend ${pkgs.systemd}/bin/systemctl suspend fi