From 43983b7240f4b64b6e8415beb296507a77c52587 Mon Sep 17 00:00:00 2001 From: Guangxiong Lin Date: Thu, 3 Feb 2022 22:01:08 +0800 Subject: Add systemctl related keybind for i3wm --- .config/i3/config | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to '.config/i3') diff --git a/.config/i3/config b/.config/i3/config index 55e6104..007cae0 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -137,8 +137,9 @@ bindsym $mod+Shift+Tab workspace prev # focus the child container bindsym $mod+c focus child -# reload the configuration file -bindsym $mod+Shift+c reload +# # reload the configuration file +# 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) @@ -186,16 +187,23 @@ mode "move" { bindsym $mod+m mode "move" focus floating -# mode "system" { -# bindsym r exec reboot -# bindsym s exec shutdown now -# -# bindsym Return mode "default" -# bindsym Escape mode "default" -# bindsym $mod+s mode "default" -# } -# -# bindsym $mod+s mode "system" +set $Locker slock && sleep 1 + +set $mode_system System (l) lock, (e) logout, (s) suspend, (r) reboot, (Shift+s) shutdown + +mode "$mode_system" { + bindsym --release l exec --no-startup-id $Locker, mode "default" + bindsym e exec --no-startup-id i3-msg exit, mode "default" + bindsym --release s exec --no-startup-id systemctl suspend && $Locker, mode "default" + bindsym r exec --no-startup-id reboot, mode "default" + bindsym Shift+s exec --no-startup-id shutdown now, mode "default" + + bindsym Return mode "default" + bindsym Escape mode "default" + bindsym $mod+Shift+c mode "default" +} + +bindsym $mod+Shift+c mode "$mode_system" bindsym $mod+e layout toggle split bindsym $mod+s layout stacking -- cgit v1.2.3