From 99061b65dae2d8017a7d21f044bf6a1030089add Mon Sep 17 00:00:00 2001 From: alejandro-angulo Date: Sat, 4 Apr 2026 18:26:57 -0700 Subject: [PATCH] Fixed sleep when plugged in --- modules/home/services/hypridle/default.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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