summary refs log tree commit diff stats
path: root/i3
diff options
context:
space:
mode:
authorAlan Pearce2017-09-04 12:42:07 +0200
committerAlan Pearce2017-09-04 12:42:07 +0200
commitb9a7843d481f03ff4539b9adfebcc6620890d0b1 (patch)
treebebf7d9cebe3611f28a13f901471140b14b2a926 /i3
parent96f8281882885dce53bc61298933578ce2ce0c99 (diff)
downloaddotfiles-b9a7843d481f03ff4539b9adfebcc6620890d0b1.tar.lz
dotfiles-b9a7843d481f03ff4539b9adfebcc6620890d0b1.tar.zst
dotfiles-b9a7843d481f03ff4539b9adfebcc6620890d0b1.zip
i3: Add mode for power commands
Diffstat (limited to 'i3')
-rw-r--r--i3/.config/i3/config16
1 files changed, 16 insertions, 0 deletions
diff --git a/i3/.config/i3/config b/i3/.config/i3/config
index f5dbd1d..85c828d 100644
--- a/i3/.config/i3/config
+++ b/i3/.config/i3/config
@@ -189,6 +189,22 @@ mode "resize" {
 
 bindsym $mod+Shift+r mode "resize"
 
+set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
+mode "$mode_system" {
+    bindsym l exec --no-startup-id $Locker, mode "default"
+    bindsym e exec --no-startup-id i3-msg exit, mode "default"
+    bindsym s exec --no-startup-id $Locker && systemctl suspend, mode "default"
+    bindsym h exec --no-startup-id $Locker && systemctl hibernate, mode "default"
+    bindsym r exec --no-startup-id systemctl reboot, mode "default"
+    bindsym Shift+s exec --no-startup-id systemctl poweroff -i, mode "default"
+
+    # back to normal: Enter or Escape
+    bindsym Return mode "default"
+    bindsym Escape mode "default"
+}
+
+bindsym $mod+Pause mode "$mode_system"
+
 # Start i3bar to display a workspace bar (plus the system information i3status
 # finds out, if available)
 bar {