mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
Using the same shortcut for 'focus right window' and 'focus next workspace' if there is no right window to focus to #450
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vitusli on GitHub (Aug 18, 2024).
Hello there! Throughout Windows, MacOS and Linux I want to have similiar shortcuts, less of them (context sensitive) and a coherent user experience. The following scenario is inspired by paperWM on Gnome:
Scenario 1
alt - land it is focussed. Now the active window is the right one.alt-lagain to focus it. So the workspace should change from 1 to 2 and the opened (third) window on workspace 2 should be focussed.On Mac OS in Yabai I achived that with this shortcut:
alt - l : yabai -m window --focus east || yabai -m space --focus nextWhen the first command fails (because there is no right/east window) it will execute the second command.
My solution I tried for this in Komorebi is:
alt + l : if (!(komorebic focus right)) { komorebic cycle-workspace next }It works - with the next workspace (to the right) flashing up very short each time I focus left or right within the current workspace. I don't know how to get this fluent.
Scenario 2:
Also I want to achieve to move the active window to the workspace to the right if there is no window to the right in the current workspace.
In Yabai I simply achive this with:
alt + shift - l: yabai -m window --swap east || yabai -m window --space nextBut in Komorebi this does not work using the same principle like in scenario 1:
alt + shift + l : if (!(komorebic move right)) { komorebic.exe cycle-move-to-workspace previous }This simply moves the active window to the next workspace although there is a window to its right which should be swapped with at first. I only want the active window to be moved to the next space if there is no window to its right.
I am very new to coding but very enthusiastic and curious. I would be very happy about practical tips and input. Thank you very much for all your gorgeous work.
@LGUG2Z commented on GitHub (Aug 18, 2024):
Interesting ideas. Handling directions from a screen edge has typically always defaulted to trying to direct the user to another monitor in that direction in most twms. I like this idea of a user being able to opt-in to a behaviour where if you're on the left or right screen edge, triggering an action in a direction crosses the workspace boundaries instead of the monitor boundaries.
I'm not a big fan of how yabai and others require scripting to achieve this. I think this should be a first class configuration option that users can just turn on and off. I'll look into implementing something like this for v0.1.30.
@vitusli commented on GitHub (Aug 18, 2024):
Thanks a lot for the quick answer! Also in Yabai when I reach the top or bottom screen edge I switch Monitor because my laptop is always in front of me "under" my monitor. I am very excited to use your solution.