LGUG2Z / komorebi

A tiling window manager for Windows 🍉
https://lgug2z.github.io/komorebi/
Other
9.59k stars 198 forks source link

[FEAT]: Support for switching to the next/previous monitor regardless of an application being open on it #658

Closed dbaxa closed 6 months ago

dbaxa commented 9 months ago

Is your feature request related to a problem? Please describe. As a awesomewm user who is sometimes using windows When I press a shortcut similar to say windows + control + k/j I would like to move to the next/prev monitor (respectively).

Describe the solution you'd like The ability to switch which monitor & application (if an application is currently displayed on the switched to monitor) is currently in focus/use.

Describe alternatives you've considered I tried using a combination of komorebi, yasb, & https://github.com/klesh/JigsawWM (with the following config for hotkeys in JigsawWM

    ([Vk.WIN, Vk.CONTROL, Vk.J], wm.prev_monitor),

). However, this doesn't work very well as keys often get stuck due to competing programs and differing window management implementations.

Additional context I hope that I have provided sufficient information for this request. I do not that the follow focus option could be of assistance with regards to changing monitors. Additionally, by "changing monitors" I mean that the mouse is sent to a next/previous monitor & focus "follows" it.

gazpachoking commented 9 months ago

Does komorebic cycle-monitor next/previous not do that already? You can bind that to whatever hotkey you need with whkd or autohotkey.

dbaxa commented 9 months ago

@gazpachoking I didn't know about komorebic cycle-monitor next/previous . It looks like I need a combination of cycle-monitor and focus - in a direction (usually up). The follow mouse focus doesn't seem to work for this use case.

dbaxa commented 8 months ago

I have this mostly working, there is an issue with regards to WSL applications not playing nice with focus switches between monitors ...

Steps to reproduce

  1. Have multiple monitors plugged in & have the following autohotkey script setup & running
#Requires AutoHotkey v2.0

#^j:: {
    RunWait "komorebic.exe cycle-monitor previous",, "Hide"
    Run "komorebic.exe force-focus",,"Hide"

 }
#^k:: {
    RunWait "komorebic.exe cycle-monitor next",, "Hide"
    Run "komorebic.exe force-focus",, "Hide"

 }
  1. Open a gui application via WSL e.g. gedit on the same monitor that you have another application open at the same time
  2. Have gedit open above / in focus on the monitor
  3. Switch to the next monitor (I have a browser open on the other monitor but it likely doesn't matter if the next monitor has an app open on it or not)
  4. Try to switch back to previous monitor & have gedit in focus
  5. Gedit is hidden and isn't brought into focus

Step 6 should end up with Gedit is back in focus but it ends up being hidden/not in focus.

LGUG2Z commented 8 months ago

WSLg has not been supported for a while (they initially had a decent implementation, then they made a bunch of breaking changes, and now whatever they have results in WSLg windows not responding properly to basic Win32 window positioning API calls).

I suggest using VcXsrv (scoop install vcxsrv), which is fully supported by komorebi and also correctly responds to Win32 window positioning API calls.

Basic setup guide: