summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmin Bandali <me@aminb.org>2015-01-04 14:28:02 -0500
committerAmin Bandali <me@aminb.org>2015-01-04 14:28:02 -0500
commitdb49043c1e958f8af433e2adbd3347838975393c (patch)
tree2b2390b4bd6985ff68b7c6b528c32ca0d2aad9e0
parentfa74ff232d9b7e39a43b8be101aebac1a8912bbd (diff)
downloadconfigs-db49043c1e958f8af433e2adbd3347838975393c.tar.gz
configs-db49043c1e958f8af433e2adbd3347838975393c.tar.xz
configs-db49043c1e958f8af433e2adbd3347838975393c.zip
i3exit
Diffstat (limited to '')
-rw-r--r--i3/.i3/config15
-rwxr-xr-xi3/.local/bin/i3exit24
2 files changed, 38 insertions, 1 deletions
diff --git a/i3/.i3/config b/i3/.i3/config
index 5075095..77905fa 100644
--- a/i3/.i3/config
+++ b/i3/.i3/config
@@ -147,7 +147,7 @@ bindsym $mod+Shift+c reload
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
bindsym $mod+Shift+r restart
# exit i3 (logs you out of your X session)
-bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
+# bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'"
# resize window (you can also use the mouse for that)
mode "resize" {
@@ -250,6 +250,19 @@ bar {
}
}
+set $mode_system System (l) lock, (e) logout, (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 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+Shift+e mode "$mode_system"
+
exec --no-startup-id nm-applet
exec --no-startup-id "pulseaudio --start"
diff --git a/i3/.local/bin/i3exit b/i3/.local/bin/i3exit
new file mode 100755
index 0000000..047edbf
--- /dev/null
+++ b/i3/.local/bin/i3exit
@@ -0,0 +1,24 @@
+#!/bin/sh
+lock() {
+ i3lock-wrapper && sleep 1
+}
+
+case "$1" in
+ lock)
+ lock
+ ;;
+ logout)
+ i3-msg exit
+ ;;
+ reboot)
+ systemctl reboot
+ ;;
+ shutdown)
+ systemctl poweroff
+ ;;
+ *)
+ echo "Usage: $0 {lock|logout|reboot|shutdown}"
+ exit 2
+esac
+
+exit 0