about summary refs log tree commit diff
path: root/home/profiles/base
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2023-07-23 23:15:54 +0900
committersefidel <contact@sefidel.net>2023-07-23 23:15:54 +0900
commita8d5376491185f123fea10d925fe45520d6238a4 (patch)
treedadc51c595c6af7ed995ec66a2e774d0745cda76 /home/profiles/base
parent04ae3f2ab554801d99dd58bbcdfa416df3c11eb5 (diff)
downloadnixrc-a8d5376491185f123fea10d925fe45520d6238a4.tar.gz
nixrc-a8d5376491185f123fea10d925fe45520d6238a4.zip
feat(home/base): nag before poweroff
* apparently HHKB supports sending XF86PowerOff with Fn+Esc, and I've triggered it 3 times today.
Diffstat (limited to 'home/profiles/base')
-rw-r--r--home/profiles/base/config/sway.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/home/profiles/base/config/sway.nix b/home/profiles/base/config/sway.nix
index be98600..5e4de04 100644
--- a/home/profiles/base/config/sway.nix
+++ b/home/profiles/base/config/sway.nix
@@ -3,6 +3,9 @@
 with neotheme.colors;
 
 ''
+  # disable power key
+  exec systemd-inhibit --what=handle-power-key --who="sway" --why="Sway manages power key behaviour" sleep infinity
+
   exec autotiling
 
   # set modifiers
@@ -156,6 +159,9 @@ with neotheme.colors;
   # Exit
   bindsym $mod+Shift+q exec swaynag -t warning -m 'Do you really want to exit sway?' -b 'Yes, exit sway' 'swaymsg exit'
 
+  # Power
+  bindsym XF86PowerOff   exec swaynag -t error -m 'Confirm poweroff?' -b 'Confirm' 'shutdown now'
+
   # Aesthetics
   default_border pixel 3
   hide_edge_borders --i3 smart