mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[BUG]: Issues with multiple monitors and komorebi bar #567
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 @JonasKleinebecker on GitHub (Jan 22, 2025).
Summary
I have two issues working with komorebi, komorebibar and whkd that might be connected.
Firstly, the komorebi bar only shows up on my first monitor, even though I specify two komorebi.bar files in my komorebi config with different monitor indexes.
Even if I change the index in the komorebi.bar.monitor0 file to 1 the bar still shows up on the monitor with index 0, however it now displays the workspaces associated with monitor 1.
The monitors seem to be correctly identified by komorebic since
komorebic send-to-monitor 1correctly sends a window to my second monitor.The second issue is that I cannot correctly start applications on my second monitor. If I go to a workspace that is associated with my second monitor such as "Tokyo" via my hotkey alt + 5 and then start up a new application, the new window is added to the last active workspace on my first monitor instead. However once again,
komorebic send-to-named-workspace Tokyocorrectly sends a window to my second monitor. I can then also successfully refocus the Tokyo workspace on my second workspace using alt + 5. Still if I try to start a new application after focusing Tokyo on my second monitor the window is added to the last active worskspace on monitor 0.Is there a config step that I missed?
Version Information
Windows 11 Pro
Version 23H2 (Build 22631.4751)
komorebic 0.1.33
tag:v0.1.33
commit_hash:cc51f62c
build_time:2025-01-11 22:30:30 +00:00
build_env:rustc 1.84.0 (9fc6b4312 2025-01-07),stable-x86_64-pc-windows-msvc
Komorebi Configuration
Hotkey Configuration
.shell powershell
App shortcuts - these require shell to be pwsh / powershell
The apps will be focused if open, or launched if not open
alt + f : if ($wshell.AppActivate('Firefox') -eq $False) { start firefox }
alt + b : if ($wshell.AppActivate('Chrome') -eq $False) { start chrome }
#launch apps
win + 1 : start chrome
win + 2 : start 'C:\Users\jonas\AppData\Roaming\Spotify\Spotify'
win + 3 : start wt
win + 4 : start explorer
win + 5 : start 'C:Users\jonas\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Discord Inc\Discord'
alt + shift + q : komorebic close
alt + shift + m : komorebic toggle-maximize
Focus windows
alt + shift + h : komorebic focus left
alt + shift + j : komorebic focus down
alt + shift + k : komorebic focus up
alt + shift + l : komorebic focus right
Move windows
alt + shift + left : komorebic move left
alt + shift + down : komorebic move down
alt + shift + up : komorebic move up
alt + shift + right : komorebic move right
Resize
alt + shift + oem_plus : komorebic resize-axis horizontal increase
alt + shift + oem_minus : komorebic resize-axis horizontal decrease
Manipulate windows
alt + shift + t : komorebic toggle-tiling
Window manager options
#alt + shift + r : komorebic retile
#alt + p : komorebic toggle-pause
Layouts
#alt + x : komorebic flip-layout horizontal
#alt + y : komorebic flip-layout vertical
Workspaces
alt + 1 : komorebic focus-named-workspace Browser
alt + 2 : komorebic focus-named-workspace Terminal
alt + 3 : komorebic focus-named-workspace Music
alt + 4 : komorebic focus-named-workspace Explorer
alt + 5 : komorebic focus-named-workspace Tokyo
alt + 6 : komorebic focus-named-workspace Paris
alt + 7 : komorebic focus-named-workspace Berlin
alt + 8 : komorebic focus-named-workspace Munich
Move windows across workspaces
alt + shift + 1 : komorebic move-to-named-workspace Browser
alt + shift + 2 : komorebic move-to-named-workspace Terminal
alt + shift + 3 : komorebic move-to-named-workspace Music
alt + shift + 4 : komorebic move-to-named-workspace Explorer
alt + shift + 5 : komorebic move-to-named-workspace Tokyo
alt + shift + 6 : komorebic move-to-named-workspace Paris
alt + shift + 7 : komorebic move-to-named-workspace Berlin
alt + shift + 8 : komorebic move-to-named-workspace Munich
Output of komorebic check
No KOMOREBI_CONFIG_HOME detected, defaulting to C:\Users\jonas
Looking for configuration files in C:\Users\jonas
Found komorebi.json; this file can be passed to the start command with the --config flag
Found C:\Users\jonas.config\whkdrc; key bindings will be loaded from here when whkd is started, and you can start it automatically using the --whkd flag
@LGUG2Z commented on GitHub (Jan 22, 2025):
If the workspaces on your secondary monitor(s) are empty when you try to open apps on them, then this is unfortunately expected behaviour; komorebi does not decide where to spawn applications, the operating system does, and komorebi can only react after the operating system emits a message. The empty desktop is a "special" window in Windows land, which exists across monitors, and when it is focused, a new window will typically be opened on whatever the operating system considers to be the primary monitor.
If you want applications to open on specific workspaces on secondary monitors, you should add
initial_workspace_rulesfor them.@LGUG2Z commented on GitHub (Jan 22, 2025):
@CtByte any ideas on the bar spawning issue here?
@CtByte commented on GitHub (Jan 22, 2025):
@LGUG2Z I've had an issue with my second monitor's bar as well, but only on hot-reload. I would be interested to see if this issue persists in this PR, as my issue is gone when I tested it.
@JonasKleinebecker Just to let you know, if you use the same
themein thekomorebi.jsonandkomorebi.bar.*.jsonconfigs, then you can just delete the theme settings in the bar configs.At first glance, I cannot spot a config error with the bars, but it would be worth trying to start your bars individually to see if the console output gives you any clues.
if you get no errors in the console, then you can perhaps "for now" try to specifically set the
positionof the second barkomorebi.bar.monitor1.json
I say "for now" as the settings are greatly improved in the above mentioned PR.
@JonasKleinebecker commented on GitHub (Jan 22, 2025):
Thank you for the quick feedback!
The bar issue was due to me misspelling the filename of the second bar ...
The hot reload issue @CtByte mentioned explains why changing the monitor index of the first file did not move the bar as I only used hot reload to apply the changes.
After fixing the spelling, the bars now work as expected.
About the issue of spawning applications in workspaces on the second monitor:
Is it possible to atleast achieve this functionality for the applications I spawn with whkd (I am aware of initial_workspace_rules, but it is not quite what I am looking for)?
What I was thinking of is some small script that
This seems like it should be doable but I could not find a command that achieves step 1.
@LGUG2Z commented on GitHub (Jan 22, 2025):
Sounds like an interesting approach, for now you can use the
querycommand to look up the focused monitor and focused workspace index, but I will expand this command to also be able to return the focused workspace name as well: https://lgug2z.github.io/komorebi/cli/query.html?h=query@LGUG2Z commented on GitHub (Jan 23, 2025):
komorebic query focused-workspace-namewill be in the next nightly release