mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[FEAT]: Open programs on specific monitors #603
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 @Skyppex on GitHub (Apr 22, 2025).
Eligibility
Individual Commercial Use License
Suggestion
I'd like to configure komorebi to open certain applications, such as Spotify, Slack, my browser, my code editor, and my terminal on specific monitors.
By using the display_index_preferences and some new config stuff i'd like to do this in my komorebi.json:
additionally it would be great if a specific monitor automatically stacked programs. that feels like a different feature request though, but i'll mention it here in case thats already possible and i haven't found out how :)
Alternatives Considered
i've tried using the initial_named_workspace_rules.
i configured each monitor to have a single, unique workspace associated with it, but when launching the app, it opens in the focues monitor and gets hidden so that didn't really work as intended
@github-actions[bot] commented on GitHub (Apr 22, 2025):
Feature requests on this repository are only open to current GitHub sponsors on the $5/month tier and above, people with a valid individual commercial use license, and approved contributors.
This issue has been automatically closed until one of those pre-requisites can be validated.
@Skyppex commented on GitHub (Apr 22, 2025):
just to keep track of everything, i was given a solution in the discord:
transcription:
does this actually cover my use case? if so, what would this config look like?
@CtByte commented on GitHub (Apr 22, 2025):
You choose a workspace for the app to open on, then add the workspace rules.
workspace_ruleswill not let you move the app to another workspace, whileinitial_workspace_ruleswill let you.(Might be important to note that Komorebi cannot spawn a window on a workspace/monitor, it will move it after it was spawned. Sometimes the bar cannot keep up with this and the app might appear on the wrong workspace first. Or if you are on the
Personalworkspace and open Chrome, it might just look like it did not open, however it was moved to theWorkworkspace).@Skyppex commented on GitHub (Apr 22, 2025):
@CtByte
Your config seems to work, but i'ts not exactly my use case.
I'm trying to just have a single workspace per monitor and assign specific apps to these workspaces.
I put Spotify.exe on the workspace for monitor 2:
Focus monitor 0, and open Spotify, it quickly flashes on monitor 0 and vanishes. The layout on monitor 0 has not changed which is expected.
The layout on monitor two changes as soon as its focused showing that Spotify should be on the right half of the screen (using the VerticalStack layout), and the left half is what was there before. The right half is, however, blank; just showing my desktop background.
When i use Alt+Tab to focus spotify it appears on monitor 0 instead of monitor 2 and changes that layout (also VerticalStack) so that is appears on the right half and the rest is pushed to the left half.
Note:
While writing this comment, it has started working as i want for spotify most of the time.
It seems to be a little unstable though as it doesn't work every single time.
I'm noticing some other issues along with this where the app is moved, but ends up being too large and bleeds from the
Left Monitorto theCenter Monitor.I can submit a separate bug report for that though :)
@CtByte commented on GitHub (Apr 22, 2025):
@Skyppex As I mentioned, Komorebi moves a window after it opened. If you are on
Center Monitorand open Spotify, this is what happens:Center Monitoror whereever it decides to open itCenter Monitorworkspace using the layoutsendsSpotify from theCenter MonitortoLeft Monitor<= This is where you see the flashretileshould solve the issueCenter Monitor@LGUG2Z when Komorebi sends the window to another workspace it does not seem to apply workspace layout, right? So that is why the window is not resized and can "bleed through" monitors?
@Skyppex commented on GitHub (Apr 22, 2025):
I just tried running
komorebic retile. It seems to just update the layout on theLeft Monitorwithout showing Spotify itself. It just ends up looking like the screenshot i attached, but without me having to move focus to theLeft Monitorworkspace.EDIT:
I focused spotify after doing the retile, it then appeared on the
Center Monitor.I then did another
komorebic retilewhich actually moved it to theLeft Monitor.@CtByte commented on GitHub (Apr 22, 2025):
does it get fixed if you change focus from monitor to monitor?
EDIT:
I am not sure about the inner workings if how Komorebi manages windows, I did try to use these rules before (many of them) and I gave up as it did not work as I wanted.
I think this comes down to Windows having a closed api and this might be the best we are allowed :(
@Skyppex commented on GitHub (Apr 22, 2025):
it does not. the window remain hidden, but based on some context clues (i was able to press space to play/pause music), it seems it becomes active somehow.
@CtByte commented on GitHub (Apr 22, 2025):
then it might be a hidden window
try running
komorebic visible-windowsto see if that is a managed hidden windowhttps://lgug2z.github.io/komorebi/common-workflows/ignore-windows.html
@Skyppex commented on GitHub (Apr 22, 2025):
Yeah, spotify appears there when it is not actually visible on my screen xD
@CtByte commented on GitHub (Apr 22, 2025):
you can post the output here, I am not sure if spotify has 2 windows, one on the
Center(hidden) and the other on theLeft(main)@Skyppex commented on GitHub (Apr 22, 2025):
hold on, spotify just started working. I'll use wezterm-gui.exe instead.
The other here ended up being equivalent to:
Left-Right-Centerfyi.@CtByte commented on GitHub (Apr 22, 2025):
and you are saying that on the
Leftyour windows only take up half the monitor?@Skyppex commented on GitHub (Apr 22, 2025):
precisely. the other half seems to be an invisible wezterm. i can navigate to the empty space and write stuff in the prompt xD
@CtByte commented on GitHub (Apr 22, 2025):
ok, then I would say, you need an ignore rule added to your komorebi.json file
@Skyppex commented on GitHub (Apr 22, 2025):
well now wezterm is not managed, which i want it to be.
@LGUG2Z commented on GitHub (Apr 22, 2025):
Quick bit from me: Spotify's app is a PITA, there is a setting somewhere in the preferences which makes it default to starting up minimized, but it registers itself as a visible window although it is minimized. Try digging out that option and turning it off, but otherwise whenever you see a Spotify ghost tile you can alt-tab it to the foreground
@CtByte commented on GitHub (Apr 22, 2025):
you can then make a more specific ignore rule using the Title or the Class
@Skyppex commented on GitHub (Apr 22, 2025):
this issue actually disappears when i use the
"window_hiding_behaviour": "Cloak"for me it's usually set to
Minimizebecause then FlowLauncher can identify running apps even if komorebi hides them.i often use FlowLauncher to change focus to an app that isn't visible on screen, therefor i never switched to
Cloaksince it disabled that function for me.it will be a little annoying, but i think i can just bite the bullet here and switch to
Cloakfinally. there are a few other things that don't seem to work very well withMinimize@LGUG2Z commented on GitHub (Apr 22, 2025):
Let's open up an issue to track in FlowLauncher for this; Cloaked apps are part of the system and should be enumerated and identified ^
@alex-ds13 commented on GitHub (Apr 22, 2025):
@Skyppex @CtByte You don't want to add the rule to ignore wezterm. Since you actually want it to be managed. The issue is precisely that you are using
Minimizeas hiding behavior. The minimize hiding behavior hasn't been touched/updated in a while, so it probably has some bugs. TheCloakhiding behavior is the best one. You can however try to useHideto see if it works better than minimize, since from my experience minimize is really slow and doesn't work very well!@Skyppex commented on GitHub (Apr 22, 2025):
Its one of the old Wox plugins i think so its a lost cause, but i can check it out, see if its being maintained still :)
Closing this since its technically working now :)
Thanks for the help, all :)
@LGUG2Z commented on GitHub (Apr 22, 2025):
Maybe @pro470 who maintains the komorebi plugin for flow launcher might be able to add something which enables identifying cloaked apps using the state? 🤔
@pro470 commented on GitHub (Apr 22, 2025):
If I understand the issue correctly, it is that when you use the cloak feature, you can't switch to applications that are cloaked and not minimized with flow launcher. This is already fixed in Komoflow by using the state and the eager-focus command built in komorebi. If you do not want to use the kc keyword, just make the keyword field in the Komoflow settings blank. This allows you to just type in the executable name. I had the same issue with the minimize feature, so I implemented it in Komoflow a long time ago.
@pro470 commented on GitHub (Apr 22, 2025):
It is not working for floating windows, but I can fix that for the next release. I just forgot about them when I created the feature. Maybe I should work on Komoflow when I have time, because of the new features in komorebi. I think its about time.
@LGUG2Z commented on GitHub (Apr 22, 2025):
Thanks @pro470! If you also have time to do a little write-up that a dummy like me can follow, I can also make a YouTube video showcasing the plugin 🚀
@Skyppex commented on GitHub (Apr 23, 2025):
The plugin for that is called Window Walker, they had an open PR for this already which was merged yesterday. Now it works for cloaked windows too :)