diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-08-16 17:14:05 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-08-17 16:18:14 -0700 |
commit | d3f77a81d9887615151194a828f130b565c02a1b (patch) | |
tree | f0447b81dd7e20062ee250cd6d367cec8f166272 /.config | |
parent | 0843a0015279c2d63567dac33236b57e75d0fa3d (diff) | |
download | dotfiles-d3f77a81d9887615151194a828f130b565c02a1b.tar.gz |
try new key binding strategy for Sway/i3
The main reason for doing this is to obtain more ergonomic replacements for
Super+j/k/comma/period, which I type a lot.
It also gains us some uniformity in what modifier keys mean.
Diffstat (limited to '.config')
-rw-r--r-- | .config/i3/config | 114 | ||||
-rw-r--r-- | .config/sway/config | 115 |
2 files changed, 120 insertions, 109 deletions
diff --git a/.config/i3/config b/.config/i3/config index 126c80bb..4ec955ee 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -40,10 +40,21 @@ focus_wrapping workspace mouse_warping output -# Put bindings I don't need to repeat under C-i, so that we have enough keys -# left on the right hand that caps lock can be our only Super modifier, yet we -# do not need any one-handed chording. *Only* bindings I might want to hit more -# than once in a row should be outside of this C-i map +# Key binding strategy: +# +# Use Ctrl+N and Mod1+Ctrl+N, which will never be bound in Emacs, for bindings +# I will often need to type more than once in a row. Otherwise put the +# bindings under the C-i prefix map, which will never be bound by Emacs +# because text terminals typically can't distinguish between C-i and TAB. +# If we need it, we can bind C-i Ctrl+N, C-i Mod1+Ctrl+N to pass the keys +# through, like C-\ \ in tmux. +# +# Previously we used Mod4 modifying a key on the right side of the keyboard +# instead of Ctrl+N and Mod1+Ctrl+N; there are enough of these that we can +# still avoid any one-handed chording with only a single Super key. However, +# this means using the weak little finger to hold down a modifier key for more +# than one keypress with the other hand, which is worth avoiding. + mode "C-i-" { # make a fresh Emacs frame -- typically this gets invoked only on # empty workspaces, as otherwise I use commands under `C-x 5` to get @@ -162,31 +173,31 @@ mode "C-i-" { bindsym semicolon workspace back_and_forth, mode "default" # move focused container to workspace - bindsym Shift+1 move container to workspace 1, mode "default" - bindsym Shift+2 move container to workspace 2, mode "default" - bindsym Shift+3 move container to workspace 3, mode "default" - bindsym Shift+4 move container to workspace 4, mode "default" - bindsym Shift+5 move container to workspace 5, mode "default" - bindsym Shift+6 move container to workspace 6, mode "default" - bindsym Shift+7 move container to workspace 7, mode "default" - bindsym Shift+8 move container to workspace 8, mode "default" - bindsym Shift+9 move container to workspace 9, mode "default" - bindsym Shift+0 move container to workspace 10, mode "default" - bindsym Shift+F1 move container to workspace 11:F1, mode "default" - bindsym Shift+F2 move container to workspace 12:F2, mode "default" - bindsym Shift+F3 move container to workspace 13:F3, mode "default" - bindsym Shift+F4 move container to workspace 14:F4, mode "default" - bindsym Shift+F5 move container to workspace 15:F5, mode "default" - bindsym Shift+F6 move container to workspace 16:F6, mode "default" - bindsym Shift+F7 move container to workspace 17:F7, mode "default" - bindsym Shift+F8 move container to workspace 18:F8, mode "default" - bindsym Shift+F9 move container to workspace 19:F9, mode "default" - bindsym Shift+F10 move container to workspace 20:F10, mode "default" - bindsym Shift+F11 move container to workspace 21:F11, mode "default" - bindsym Shift+F12 move container to workspace 22:F12, mode "default" - bindsym Shift+semicolon move container to workspace back_and_forth, \ + bindsym Mod1+1 move container to workspace 1, mode "default" + bindsym Mod1+2 move container to workspace 2, mode "default" + bindsym Mod1+3 move container to workspace 3, mode "default" + bindsym Mod1+4 move container to workspace 4, mode "default" + bindsym Mod1+5 move container to workspace 5, mode "default" + bindsym Mod1+6 move container to workspace 6, mode "default" + bindsym Mod1+7 move container to workspace 7, mode "default" + bindsym Mod1+8 move container to workspace 8, mode "default" + bindsym Mod1+9 move container to workspace 9, mode "default" + bindsym Mod1+0 move container to workspace 10, mode "default" + bindsym Mod1+F1 move container to workspace 11:F1, mode "default" + bindsym Mod1+F2 move container to workspace 12:F2, mode "default" + bindsym Mod1+F3 move container to workspace 13:F3, mode "default" + bindsym Mod1+F4 move container to workspace 14:F4, mode "default" + bindsym Mod1+F5 move container to workspace 15:F5, mode "default" + bindsym Mod1+F6 move container to workspace 16:F6, mode "default" + bindsym Mod1+F7 move container to workspace 17:F7, mode "default" + bindsym Mod1+F8 move container to workspace 18:F8, mode "default" + bindsym Mod1+F9 move container to workspace 19:F9, mode "default" + bindsym Mod1+F10 move container to workspace 20:F10, mode "default" + bindsym Mod1+F11 move container to workspace 21:F11, mode "default" + bindsym Mod1+F12 move container to workspace 22:F12, mode "default" + bindsym Mod1+semicolon move container to workspace back_and_forth, \ mode "default" - bindsym Shift+Ctrl+semicolon move container to workspace back_and_forth, \ + bindsym Mod1+Ctrl+semicolon move container to workspace back_and_forth, \ workspace back_and_forth, mode "default" # next unused workspace @@ -194,11 +205,11 @@ mode "C-i-" { ~/src/dotfiles/scripts/desktop/fresh-workspace, \ mode "default" # sends window to next unused but doesn't change view - bindsym Shift+j exec --no-startup-id \ + bindsym Mod1+j exec --no-startup-id \ ~/src/dotfiles/scripts/desktop/fresh-workspace --send, \ mode "default" # sends window to next unused and changes view - bindsym Shift+Ctrl+j exec --no-startup-id \ + bindsym Mod1+Ctrl+j exec --no-startup-id \ ~/src/dotfiles/scripts/desktop/fresh-workspace --take, \ mode "default" @@ -233,35 +244,30 @@ mode "C-i-" { bindsym space mode "default" bindsym Ctrl+g mode "default" } -# C-i is perfect for window manager bindings because it will never be -# bound in my Emacs config, as text terminals typically cannot -# distinguish between <tab> and C-i bindsym Ctrl+i mode "C-i-" # change focus -bindsym Mod4+j focus left -bindsym Mod4+k focus right -bindsym Mod4+n focus down -bindsym Mod4+p focus up +bindsym Ctrl+7 focus left +bindsym Ctrl+0 focus right +bindsym Ctrl+8 focus down +bindsym Ctrl+9 focus up # move focused window -bindsym Mod4+Ctrl+j move left -bindsym Mod4+Ctrl+k move right -bindsym Mod4+Ctrl+n move down -bindsym Mod4+Ctrl+p move up - -bindsym Mod4+apostrophe layout toggle split +bindsym Mod1+Ctrl+7 move left +bindsym Mod1+Ctrl+0 move right +bindsym Mod1+Ctrl+8 move down +bindsym Mod1+Ctrl+9 move up bindsym Mod1+Ctrl+i kill -# Cycle through all workspaces on monitor. Unlike C-i j and C-i [0-9]+, these -# move the container *and* switch view to the other workspace, because there -# are more like Mod4+Ctrl+j/k than they are like the C-i bindings -bindsym Mod4+comma workspace prev_on_output -bindsym Mod4+period workspace next_on_output -bindsym Mod4+Ctrl+less move container to workspace prev_on_output, \ +bindsym Ctrl+minus layout toggle split + +# Cycle through all workspaces on monitor. +bindsym Ctrl+3 workspace prev_on_output +bindsym Ctrl+4 workspace next_on_output +bindsym Mod1+Ctrl+3 move container to workspace prev_on_output, \ workspace prev_on_output -bindsym Mod4+Ctrl+greater move container to workspace next_on_output, \ +bindsym Mod1+Ctrl+4 move container to workspace next_on_output, \ workspace next_on_output # # move focus between monitors -- if we have more than one monitor, we @@ -278,10 +284,10 @@ bindsym Mod4+Ctrl+greater move container to workspace next_on_output, \ # bindsym Mod4+Ctrl+Mod2+KP_Right move workspace to output right # bindsym Mod4+Ctrl+KP_6 move workspace to output right -bindsym Mod4+i focus output left -bindsym Mod4+Ctrl+i move workspace to output left -bindsym Mod4+o focus output right -bindsym Mod4+Ctrl+o move workspace to output right +bindsym Ctrl+1 focus output left +bindsym Mod1+Ctrl+1 move workspace to output left +bindsym Ctrl+2 focus output right +bindsym Mod1+Ctrl+2 move workspace to output right # Start i3bar to display a workspace bar (plus the system information i3status # finds out, if available) diff --git a/.config/sway/config b/.config/sway/config index e3b9d9fd..68e2f6cc 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -25,10 +25,21 @@ focus_wrapping workspace mouse_warping output -# Put bindings I don't need to repeat under C-i, so that we have enough keys -# left on the right hand that caps lock can be our only Super modifier, yet we -# do not need any one-handed chording. *Only* bindings I might want to hit more -# than once in a row should be outside of this C-i map +# Key binding strategy: +# +# Use Ctrl+N and Mod1+Ctrl+N, which will never be bound in Emacs, for bindings +# I will often need to type more than once in a row. Otherwise put the +# bindings under the C-i prefix map, which will never be bound by Emacs +# because text terminals typically can't distinguish between C-i and TAB. +# If we need it, we can bind C-i Ctrl+N, C-i Mod1+Ctrl+N to pass the keys +# through, like C-\ \ in tmux. +# +# Previously we used Mod4 modifying a key on the right side of the keyboard +# instead of Ctrl+N and Mod1+Ctrl+N; there are enough of these that we can +# still avoid any one-handed chording with only a single Super key. However, +# this means using the weak little finger to hold down a modifier key for more +# than one keypress with the other hand, which is worth avoiding. + mode "C-i-" { # make a fresh Emacs frame -- typically this gets invoked only on # empty workspaces, as otherwise I use commands under `C-x 5` to get @@ -134,31 +145,31 @@ mode "C-i-" { bindsym semicolon workspace back_and_forth, mode "default" # move focused container to workspace - bindsym Shift+1 move container to workspace 1, mode "default" - bindsym Shift+2 move container to workspace 2, mode "default" - bindsym Shift+3 move container to workspace 3, mode "default" - bindsym Shift+4 move container to workspace 4, mode "default" - bindsym Shift+5 move container to workspace 5, mode "default" - bindsym Shift+6 move container to workspace 6, mode "default" - bindsym Shift+7 move container to workspace 7, mode "default" - bindsym Shift+8 move container to workspace 8, mode "default" - bindsym Shift+9 move container to workspace 9, mode "default" - bindsym Shift+0 move container to workspace 10, mode "default" - bindsym Shift+F1 move container to workspace 11:F1, mode "default" - bindsym Shift+F2 move container to workspace 12:F2, mode "default" - bindsym Shift+F3 move container to workspace 13:F3, mode "default" - bindsym Shift+F4 move container to workspace 14:F4, mode "default" - bindsym Shift+F5 move container to workspace 15:F5, mode "default" - bindsym Shift+F6 move container to workspace 16:F6, mode "default" - bindsym Shift+F7 move container to workspace 17:F7, mode "default" - bindsym Shift+F8 move container to workspace 18:F8, mode "default" - bindsym Shift+F9 move container to workspace 19:F9, mode "default" - bindsym Shift+F10 move container to workspace 20:F10, mode "default" - bindsym Shift+F11 move container to workspace 21:F11, mode "default" - bindsym Shift+F12 move container to workspace 22:F12, mode "default" - bindsym Shift+semicolon move container to workspace back_and_forth, \ + bindsym Mod1+1 move container to workspace 1, mode "default" + bindsym Mod1+2 move container to workspace 2, mode "default" + bindsym Mod1+3 move container to workspace 3, mode "default" + bindsym Mod1+4 move container to workspace 4, mode "default" + bindsym Mod1+5 move container to workspace 5, mode "default" + bindsym Mod1+6 move container to workspace 6, mode "default" + bindsym Mod1+7 move container to workspace 7, mode "default" + bindsym Mod1+8 move container to workspace 8, mode "default" + bindsym Mod1+9 move container to workspace 9, mode "default" + bindsym Mod1+0 move container to workspace 10, mode "default" + bindsym Mod1+F1 move container to workspace 11:F1, mode "default" + bindsym Mod1+F2 move container to workspace 12:F2, mode "default" + bindsym Mod1+F3 move container to workspace 13:F3, mode "default" + bindsym Mod1+F4 move container to workspace 14:F4, mode "default" + bindsym Mod1+F5 move container to workspace 15:F5, mode "default" + bindsym Mod1+F6 move container to workspace 16:F6, mode "default" + bindsym Mod1+F7 move container to workspace 17:F7, mode "default" + bindsym Mod1+F8 move container to workspace 18:F8, mode "default" + bindsym Mod1+F9 move container to workspace 19:F9, mode "default" + bindsym Mod1+F10 move container to workspace 20:F10, mode "default" + bindsym Mod1+F11 move container to workspace 21:F11, mode "default" + bindsym Mod1+F12 move container to workspace 22:F12, mode "default" + bindsym Mod1+semicolon move container to workspace back_and_forth, \ mode "default" - bindsym Shift+Ctrl+semicolon move container to workspace back_and_forth, \ + bindsym Mod1+Ctrl+semicolon move container to workspace back_and_forth, \ workspace back_and_forth, mode "default" # next unused workspace @@ -166,11 +177,11 @@ mode "C-i-" { ~/src/dotfiles/scripts/desktop/fresh-workspace, \ mode "default" # sends window to next unused but doesn't change view - bindsym Shift+j exec \ + bindsym Mod1+j exec \ ~/src/dotfiles/scripts/desktop/fresh-workspace --send, \ mode "default" # sends window to next unused and changes view - bindsym Shift+Ctrl+j exec \ + bindsym Mod1+Ctrl+j exec \ ~/src/dotfiles/scripts/desktop/fresh-workspace --take, \ mode "default" @@ -246,9 +257,6 @@ mode "C-i-" { bindsym --locked Ctrl+g mode "default" } -# C-i is perfect for window manager bindings because it will never be -# bound in my Emacs config, as text terminals typically cannot -# distinguish between <tab> and C-i bindsym --locked Ctrl+i mode "C-i-" for_window [con_mark=caffeinated] inhibit_idle open @@ -257,41 +265,38 @@ for_window [title="ftp-master GNU mc session"] mark mc for_window [title="ftp-master dak command session"] mark dak # change focus -bindsym Mod4+j focus left -bindsym Mod4+k focus right -bindsym Mod4+n focus down -bindsym Mod4+p focus up +bindsym Ctrl+7 focus left +bindsym Ctrl+0 focus right +bindsym Ctrl+8 focus down +bindsym Ctrl+9 focus up # move focused window -bindsym Mod4+Ctrl+j move left -bindsym Mod4+Ctrl+k move right -bindsym Mod4+Ctrl+n move down -bindsym Mod4+Ctrl+p move up - -bindsym Mod4+apostrophe layout toggle split +bindsym Mod1+Ctrl+7 move left +bindsym Mod1+Ctrl+0 move right +bindsym Mod1+Ctrl+8 move down +bindsym Mod1+Ctrl+9 move up bindsym Mod1+Ctrl+i kill -# Cycle through all workspaces on monitor. Unlike C-i j and C-i [0-9]+, these -# move the container *and* switch view to the other workspace, because there -# are more like Mod4+Ctrl+j/k than they are like the C-i bindings. -# +bindsym Ctrl+minus layout toggle split + +# Cycle through all workspaces on monitor. # Warp the cursor to a point on the screen which is hopefully a titlebar. # This means that cycling through workspaces does not abruptly stop because, # e.g., a VNC client has grabbed the keyboard upon entry to the workspace. -bindsym Mod4+comma seat - cursor set 0 0, workspace prev_on_output -bindsym Mod4+period seat - cursor set 0 0, workspace next_on_output -bindsym Mod4+Ctrl+comma seat - cursor set 0 0, \ +bindsym Ctrl+3 seat - cursor set 0 0, workspace prev_on_output +bindsym Ctrl+4 seat - cursor set 0 0, workspace next_on_output +bindsym Mod1+Ctrl+3 seat - cursor set 0 0, \ move container to workspace prev_on_output, \ workspace prev_on_output -bindsym Mod4+Ctrl+period seat - cursor set 0 0, \ +bindsym Mod1+Ctrl+4 seat - cursor set 0 0, \ move container to workspace next_on_output, \ workspace next_on_output -bindsym Mod4+i focus output left -bindsym Mod4+Ctrl+i move workspace to output left -bindsym Mod4+o focus output right -bindsym Mod4+Ctrl+o move workspace to output right +bindsym Ctrl+1 focus output left +bindsym Mod1+Ctrl+1 move workspace to output left +bindsym Ctrl+2 focus output right +bindsym Mod1+Ctrl+2 move workspace to output right # Start swaybar to display a workspace bar (plus the system information # i3status finds out, if available) |