From 068dd950068dd21baa642bc5072f7e621071fda4 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sat, 28 Jul 2018 14:06:00 +0100 Subject: Better i3 bindings and adding script --- i3/config | 26 +++++++++++++------------- i3/i3exit | 30 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 13 deletions(-) create mode 100755 i3/i3exit diff --git a/i3/config b/i3/config index 09fb289..4755987 100644 --- a/i3/config +++ b/i3/config @@ -43,10 +43,10 @@ bindsym $mod+d exec i3-dmenu-desktop # bindsym $mod+d exec --no-startup-id i3-dmenu-desktop # change focus -bindsym $mod+j focus left -bindsym $mod+k focus down -bindsym $mod+l focus up -bindsym $mod+semicolon focus right +bindsym $mod+h focus left +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right # alternatively, you can use the cursor keys: bindsym $mod+Left focus left @@ -55,10 +55,10 @@ bindsym $mod+Up focus up bindsym $mod+Right focus right # move focused window -bindsym $mod+Shift+j move left -bindsym $mod+Shift+k move down -bindsym $mod+Shift+l move up -bindsym $mod+Shift+semicolon move right +bindsym $mod+Shift+h move left +bindsym $mod+Shift+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right # alternatively, you can use the cursor keys: bindsym $mod+Shift+Left move left @@ -67,7 +67,7 @@ bindsym $mod+Shift+Up move up bindsym $mod+Shift+Right move right # split in horizontal orientation -bindsym $mod+h split h +bindsym $mod+b split h # split in vertical orientation bindsym $mod+v split v @@ -131,10 +131,10 @@ mode "resize" { # Pressing right will grow the window’s width. # Pressing up will shrink the window’s height. # Pressing down will grow the window’s height. - bindsym j resize shrink width 10 px or 10 ppt - bindsym k resize grow height 10 px or 10 ppt - bindsym l resize shrink height 10 px or 10 ppt - bindsym semicolon resize grow width 10 px or 10 ppt + bindsym h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l resize grow width 10 px or 10 ppt # same bindings, but for the arrow keys bindsym Left resize shrink width 10 px or 10 ppt diff --git a/i3/i3exit b/i3/i3exit new file mode 100755 index 0000000..4292234 --- /dev/null +++ b/i3/i3exit @@ -0,0 +1,30 @@ +#!/bin/sh +lock() { + i3lock -c 2f2f2f +} + +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 -- cgit