about summary refs log tree commit diff
path: root/home
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2022-02-03 23:38:30 +0900
committersefidel <contact@sefidel.net>2022-02-03 23:38:30 +0900
commit7085ad2c59ec2355e9efb190c2f141a1ec5bc0f3 (patch)
tree7d3b2fc92ce36343e67efd258133e98d27199d0a /home
parente36b7edf8decbf509894844971b2d8365abc93db (diff)
downloadnixrc-7085ad2c59ec2355e9efb190c2f141a1ec5bc0f3.tar.gz
nixrc-7085ad2c59ec2355e9efb190c2f141a1ec5bc0f3.zip
home/base: add swayidle
Diffstat (limited to 'home')
-rw-r--r--home/profiles/base/default.nix18
1 files changed, 17 insertions, 1 deletions
diff --git a/home/profiles/base/default.nix b/home/profiles/base/default.nix
index ab84648..0761fb8 100644
--- a/home/profiles/base/default.nix
+++ b/home/profiles/base/default.nix
@@ -68,7 +68,6 @@ in
       # Sway
       pkgs.autotiling
       pkgs.swaylock-effects
-      pkgs.swayidle
       pkgs.swaybg
       pkgs.wayland-utils
       pkgs.wl-clipboard
@@ -236,6 +235,23 @@ in
         settings = import ./config/dunst.nix { inherit neotheme; };
       };
 
+      swayidle = {
+        enable = true;
+        events = [
+          { event = "before-sleep"; command = "${pkgs.swaylock-effects}/bin/swaylock -fFc ${neotheme.colors.background} --indicator"; }
+          { event = "lock"; command = "${pkgs.swaylock-effects}/bin/swaylock -fFc ${neotheme.colors.background} --indicator"; }
+        ];
+        timeouts = [
+          { timeout = 230; command = "${pkgs.libnotify}/bin/notify-send -t 30000 'Locking screen in 30 seconds'"; }
+          { timeout = 300; command = "${pkgs.swaylock-effects}/bin/swaylock -fFc ${neotheme.colors.background} --indicator"; }
+          {
+            timeout = 600;
+            command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'";
+            resumeCommand = "${pkgs.sway}/bin/swaymsg 'output * dpms on'";
+          }
+        ];
+      };
+
       wlsunset = {
         enable = true;
         latitude = "36.5";