From 1cc47ac7df21838ce963ffe30773d7740cc9fce0 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 16 Sep 2024 20:11:56 +0200 Subject: [PATCH 1/3] river: Add passhthrough mode to disable river keys `super+F11` enters passthrough mode (displayed on waybar) which disables all normal keybinds that river listens to and - surprise - passes them through to whatever application is running. The same binding exits the mode. --- desktop/.config/river/init | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/desktop/.config/river/init b/desktop/.config/river/init index debf7fc..6f93d12 100755 --- a/desktop/.config/river/init +++ b/desktop/.config/river/init @@ -161,6 +161,13 @@ riverctl map interact_float None J send-layout-cmd $layout "main-count +1" riverctl map interact_float None K send-layout-cmd $layout "main-count -1" ### End resize and moving mode +## Passthrough mode which disables all other mappings and only retains the single +# mapping to return to normal mode. Useful for some full screen applications +# which should capture everything, or for testing nested wayland compositors. +riverctl declare-mode passthrough +riverctl map normal $mod F11 enter-mode passthrough +riverctl map passthrough $mod F11 enter-mode normal + # focus the next/previous output riverctl map normal $mod Period focus-output next riverctl map normal $mod Comma focus-output previous From 19bafa910e649fca3e376fb944d2d0cffacff335 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 16 Sep 2024 20:29:55 +0200 Subject: [PATCH 2/3] river: Improve floating mode mappings Simplify the system of mappings in floating: - HJKL for moving a floating window around. - C-HJKL for quickly snapping to screen edges (as before) - Mod-HJKL for resizing the floating window. - Mod-Shift-HJKL for changing the tag's setting: - HL to change size ratio of main/side pane - JK to change amount of windows in main pane --- desktop/.config/river/init | 40 ++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/desktop/.config/river/init b/desktop/.config/river/init index 6f93d12..5e29d4b 100755 --- a/desktop/.config/river/init +++ b/desktop/.config/river/init @@ -132,8 +132,6 @@ riverctl map normal $mod+Shift M spawn 'for i in $(wlopm | wc -l); do riverctl s riverctl map normal $mod+Shift F10 spawn "riverctl send-layout-cmd $layout '--tags all --output all view-padding 0'" riverctl map normal $mod F10 spawn "riverctl send-layout-cmd $layout '--tags all --output all view-padding 6'" -# toggle float -riverctl map normal $mod+Shift v toggle-float # Mod + Left Mouse Button to move views riverctl map-pointer normal $mod BTN_LEFT move-view # Mod + Right Mouse Button to resize views @@ -143,22 +141,30 @@ riverctl map-pointer normal $mod BTN_RIGHT resize-view riverctl declare-mode interact_float riverctl map normal $modemod R enter-mode interact_float riverctl map interact_float $modemod R enter-mode normal -# resize views on screen -riverctl map interact_float $mod H resize horizontal -100 -riverctl map interact_float $mod J resize vertical 100 -riverctl map interact_float $mod K resize vertical -100 -riverctl map interact_float $mod L resize horizontal 100 +riverctl map interact_float None Escape enter-mode normal +# toggle float +riverctl map interact_float $mod+Shift v toggle-float # move views around screen -riverctl map interact_float $mod+Shift H move left 100 -riverctl map interact_float $mod+Shift J move down 100 -riverctl map interact_float $mod+Shift K move up 100 -riverctl map interact_float $mod+Shift L move right 100 +riverctl map -repeat interact_float None H move left 100 +riverctl map -repeat interact_float None J move down 100 +riverctl map -repeat interact_float None K move up 100 +riverctl map -repeat interact_float None L move right 100 +# resize views on screen +riverctl map -repeat interact_float $mod H resize horizontal -100 +riverctl map -repeat interact_float $mod J resize vertical 100 +riverctl map -repeat interact_float $mod K resize vertical -100 +riverctl map -repeat interact_float $mod L resize horizontal 100 # decrease/increase the main ratio of layout -riverctl map interact_float None H send-layout-cmd $layout "main-ratio -0.05" -riverctl map interact_float None L send-layout-cmd $layout "main-ratio +0.05" +riverctl map interact_float $mod+Shift H send-layout-cmd $layout "main-ratio -0.05" +riverctl map interact_float $mod+Shift L send-layout-cmd $layout "main-ratio +0.05" # increment/decrement the main layout -riverctl map interact_float None J send-layout-cmd $layout "main-count +1" -riverctl map interact_float None K send-layout-cmd $layout "main-count -1" +riverctl map interact_float $mod+Shift J send-layout-cmd $layout "main-count +1" +riverctl map interact_float $mod+Shift K send-layout-cmd $layout "main-count -1" +# snap views to screen edges +riverctl map interact_float $mod+Control H snap left +riverctl map interact_float $mod+Control J snap down +riverctl map interact_float $mod+Control K snap up +riverctl map interact_float $mod+Control L snap right ### End resize and moving mode ## Passthrough mode which disables all other mappings and only retains the single @@ -224,9 +230,9 @@ done # The scratchpad will live on an unused tag. Which tags are used depends on your # config, but rivers default uses the first 9 tags. scratch_tag=$((1 << 20)) -# Toggle the scratchpad with Super+P +# Toggle showing the scratchpad riverctl map normal $mod grave toggle-focused-tags ${scratch_tag} -# Send windows to the scratchpad with Super+Shift+P +# Send windows to the scratchpad riverctl map normal $mod+Shift grave set-view-tags ${scratch_tag} # Set spawn tagmask to ensure new windows don't have the scratchpad tag unless # explicitly set. From 5dff1db3dbed4378ac0fbd42fdd331ea6696318b Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 16 Sep 2024 20:33:17 +0200 Subject: [PATCH 3/3] river: Add monocle mapping if running filtile layout When using filtile layout it also gives the option of using 'monocle' mode which is similar to fullscreen in that it only shows one window at a time (which also occupies the full screen, except for the statusbar) but you can cycle between the windows shown as you would usually between the different views in a tag. You can imagine the windows 'stacked' on top of each other and cycling which one is on top or on the bottom. Toggled with `Mod+Shift+F`, shifting up from fullscreen mode. TODO: Ideally, it would be accompanied by an indicator in the statusbar but I have no time to create one currently. Without one, it is sometimes hard to remember that other windows exist on the tag after a while. --- desktop/.config/river/init | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/desktop/.config/river/init b/desktop/.config/river/init index 5e29d4b..8a2bbf5 100755 --- a/desktop/.config/river/init +++ b/desktop/.config/river/init @@ -124,6 +124,12 @@ riverctl map normal $mod+Control L snap right # Mod+F to toggle fullscreen riverctl map normal $mod F toggle-fullscreen +# if we are running filtile we also have access to monocle mode +if [ "$layout" = "filtile" ]; then + riverctl map normal $mod+Shift F spawn "riverctl send-layout-cmd $layout monocle" +fi + +riverctl map normal $mod+Shift v toggle-float # shellcheck disable=SC2016 # Make all connected outputs show the desktop and no windows at all