Created
November 7, 2019 23:55
-
-
Save ricardoalcantara/22f0dace28c1f68603bb83f29ed00ff6 to your computer and use it in GitHub Desktop.
i3wm shutdown config - https://faq.i3wm.org/question/239/how-do-i-suspendlockscreen-and-logout.1.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
lock() { | |
i3lock | |
} | |
case "$1" in | |
lock) | |
lock | |
;; | |
logout) | |
i3-msg exit | |
;; | |
suspend) | |
lock && systemctl suspend | |
;; | |
hibernate) | |
lock && systemctl hibernate | |
;; | |
reboot) | |
systemctl reboot | |
;; | |
shutdown) | |
systemctl poweroff | |
;; | |
*) | |
echo "Usage: $0 {lock|logout|suspend|hibernate|reboot|shutdown}" | |
exit 2 | |
esac | |
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 i3exit lock, mode "default" | |
bindsym e exec --no-startup-id i3exit logout, mode "default" | |
bindsym s exec --no-startup-id i3exit suspend, mode "default" | |
bindsym h exec --no-startup-id i3exit hibernate, mode "default" | |
bindsym r exec --no-startup-id i3exit reboot, mode "default" | |
bindsym Shift+s exec --no-startup-id i3exit shutdown, mode "default" | |
# back to normal: Enter or Escape | |
bindsym Return mode "default" | |
bindsym Escape mode "default" | |
} | |
bindsym $mod+Pause mode "$mode_system" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment