[FEAT]: Bind Applications to Specific Default Workspaces (like I3/Sway) #293

Closed
opened 2026-01-05 14:49:32 +01:00 by adam · 3 comments
Owner

Originally created by @imgurbot12 on GitHub (Feb 13, 2024).

Feature

Sway/I3 have configuration options that allow controlling where windows spawn based on a set of criteria.
This plays a big part in my typical workflow and would be huge improvement if Komorebi could support it.

Sway/I3 Example

assign [app_id="^brave-browser$"] $ws2
assign [class="^Signal$"] $wsF1
assign [class="^discord$"] $wsF1
assign [class="^VirtualBox Manager"] $wsF8

Reasoning

Having to move windows manually every time you restart komorebi gets incredibly tedious.
It's nice to have everything exactly where you expect on startup.
Especially when those applications are auto started on boot.

Potential Design

In terms of design, I hope there would be similar configuration controls in komorebi.json. maybe something like:

{
  "app_default_workspaces": [
     {"match":  "app_id", "pattern": "^brave-browser$", "workspace": "2"},
     {"match":  "class", "pattern": "^Signal$", "workspace": "10"},
     {"match":  "class", "pattern": "^discord$", "workspace": "10"},
     {"match":  "class", "pattern": "^VirtualBox Manager$", "workspace": "17"}
  ]
}

I'm not sure how much metadata is available on running applications. perhaps simplifying everything to match a pattern on the window-name would be easier/better.

{"name": "^VirtualBox Manager$", "workspace": "17"}

If its just a mapping of name-patterns to workspaces it could be simplified to:

{
  "app_default_workspaces": [
     "^brave-browser$":  "2",
     "^Signal$": "10"
     "^discord$": "10",
     "workspace": "17"
  ]
}
Originally created by @imgurbot12 on GitHub (Feb 13, 2024). ## Feature Sway/I3 have configuration options that allow controlling where windows spawn based on a set of criteria. This plays a big part in my typical workflow and would be huge improvement if Komorebi could support it. #### Sway/I3 Example ```i3 assign [app_id="^brave-browser$"] $ws2 assign [class="^Signal$"] $wsF1 assign [class="^discord$"] $wsF1 assign [class="^VirtualBox Manager"] $wsF8 ``` #### Reasoning Having to move windows manually every time you restart komorebi gets incredibly tedious. It's nice to have everything exactly where you expect on startup. Especially when those applications are auto started on boot. #### Potential Design In terms of design, I hope there would be similar configuration controls in komorebi.json. maybe something like: ```json { "app_default_workspaces": [ {"match": "app_id", "pattern": "^brave-browser$", "workspace": "2"}, {"match": "class", "pattern": "^Signal$", "workspace": "10"}, {"match": "class", "pattern": "^discord$", "workspace": "10"}, {"match": "class", "pattern": "^VirtualBox Manager$", "workspace": "17"} ] } ``` I'm not sure how much metadata is available on running applications. perhaps simplifying everything to match a pattern on the window-name would be easier/better. ```json {"name": "^VirtualBox Manager$", "workspace": "17"} ``` If its just a mapping of name-patterns to workspaces it could be simplified to: ```json { "app_default_workspaces": [ "^brave-browser$": "2", "^Signal$": "10" "^discord$": "10", "workspace": "17" ] } ```
adam added the enhancement label 2026-01-05 14:49:32 +01:00
adam closed this issue 2026-01-05 14:49:32 +01:00
Author
Owner

@azinsharaf commented on GitHub (Feb 13, 2024):

have you tried workspace_rules and initial_workspace_rules params in the json file?

@azinsharaf commented on GitHub (Feb 13, 2024): have you tried workspace_rules and initial_workspace_rules params in the json file?
Author
Owner

@imgurbot12 commented on GitHub (Feb 13, 2024):

have you tried workspace_rules and initial_workspace_rules params in the json file?

@azinsharaf I can't say I have. I had no idea it even existed, even after a cursory glance through schema.json.
Now that you mention it though initial_workspace_rules is exactly what I needed. Thank you for pointing it out.

That being said, was there any place to find info on that existing feature? I tried looking through all the existing issues and PRs to try and find anything related before submitting an issue myself but couldn't find any resources about configuration beyond a few examples given and the readme.

The only reference to this particular rule is in a random example given without context in the following issue: https://github.com/LGUG2Z/komorebi/issues/427

Regardless, that solves my request. Thanks!

@imgurbot12 commented on GitHub (Feb 13, 2024): > have you tried workspace_rules and initial_workspace_rules params in the json file? @azinsharaf I can't say I have. I had no idea it even existed, even after a cursory glance through `schema.json`. Now that you mention it though `initial_workspace_rules` is exactly what I needed. Thank you for pointing it out. That being said, was there any place to find info on that existing feature? I tried looking through all the existing issues and PRs to try and find anything related before submitting an issue myself but couldn't find any resources about configuration beyond a few examples given and the readme. The only reference to this particular rule is in a random example given without context in the following issue: https://github.com/LGUG2Z/komorebi/issues/427 Regardless, that solves my request. Thanks!
Author
Owner

@LGUG2Z commented on GitHub (Feb 13, 2024):

https://LGUG2Z.github.io/komorebi will be "officially" launching this week 🎉

@LGUG2Z commented on GitHub (Feb 13, 2024): https://LGUG2Z.github.io/komorebi will be "officially" launching this week 🎉
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#293