about summary refs log tree commit diff
path: root/home/profiles/gui/default.nix
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2023-10-07 15:07:32 +0900
committersefidel <contact@sefidel.net>2023-10-07 15:07:32 +0900
commit541b2788a8642e72357d7483737151742ebabc98 (patch)
treefcf03c15988d2e6bfd8a8589b41043ea856d2faa /home/profiles/gui/default.nix
parente234f6924c5998860aa7cc6f937345e1510ac50b (diff)
downloadnixrc-541b2788a8642e72357d7483737151742ebabc98.tar.gz
nixrc-541b2788a8642e72357d7483737151742ebabc98.zip
feat(home/gui): swayidle: suspend early on laptops
Diffstat (limited to 'home/profiles/gui/default.nix')
-rw-r--r--home/profiles/gui/default.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/home/profiles/gui/default.nix b/home/profiles/gui/default.nix
index e9cb343..c8bbd7d 100644
--- a/home/profiles/gui/default.nix
+++ b/home/profiles/gui/default.nix
@@ -197,15 +197,16 @@ in
             { timeout = 270; command = "${pkgs.libnotify}/bin/notify-send -t 30000 'Locking screen in 30 seconds'"; }
             # 5m
             { timeout = 300; command = lockCommand; }
-            # 10m
-            {
+          ] ++ lib.optionals (!cfg.laptop.enable)
+            [{
+              # 10m (desktop only)
               timeout = 600;
               command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'";
               resumeCommand = "${pkgs.sway}/bin/swaymsg 'output * dpms on'";
-            }
-            # 15m
+            }] ++ [
             {
-              timeout = 900;
+              # 10m on laptops, 15m on desktop
+              timeout = if cfg.laptop.enable then 600 else 900;
               command = "${pkgs.systemd}/bin/systemctl suspend";
             }
           ];