#Automatically starting apps in workspaces

1 messages · Page 1 of 1 (latest)

strong garden
#

Is there a way to automatically launch workspaces. In particular, if apps already exist before the launch of komorebi, they automatically get slotted into the workspaces they are assigned to. If they don't exist, then komorebi launches them. Is this possible?

#

Automatically starting apps in workspaces

winged lantern
#

I have the same question

winged lantern
#

if not before launch, can we do it after Komorebi and YASB have started?

Opening an application and it automatically launches in specific workspace

#

@somber rose @weak mason adding you this thread

lavish egret
#

You can create a script that starts komorebi and then try to activate every application you want (with komorebi forcing them to the proper workspace), if it fails it is because the application is not running so you can start it and komorebi will force it to the correct workspace...

winged lantern
#

Pls guide a bit more
how can I write that script?
is there any gh repo/gist I can look for example?

lavish egret
#

You can create a powershell script like this:

komorebic start --whkd
$wshell = New-Object -ComObject wscript.shell
if ($wshell.AppActivate('Mozilla Firefox') -eq $False) { start firefox }
if ($wshell.AppActivate('Chrome') -eq $False) { start chrome }

And save this file as something like start.ps1, then you can call this script on a terminal. It will first start komorebi, then it will try to activate an application, if it fails it starts it. You need to have setup the workspace_rules first on your komorebi config. I haven't tested it but it might work...

winged lantern
#

I use YASB and can start the applications using

   apps:
     type: "yasb.applications.ApplicationsWidget"
     options:
       label: "{data}"
       app_list:
         - { icon: "\uf489", launch: "wt" }
         - {
             icon: "\uf1ff",
             launch: "C:\\Users\\amn\\AppData\\Local\\Discord\\Update.exe --processStart Discord.exe",
#

question still remains, how to make them open in respective workspace

lavish egret
#

If you want windows terminal to always be on workspace 1, you add a workspace rule to it like this:

"monitors": [
  {
    "workspaces": [
      {
        "name": "1",
        "layout": "BSP",
        "workspace_rules": [
          {
            "kind": "Exe",
            "id": "WindowsTerminal.exe",
            "matching_strategy": "Equals"
          }
        ]
      },
      {
        "name": "2",
        "layout": "BSP",
        "workspace_rules": [
          {
            "kind": "Exe",
            "id": "firefox.exe",
            "matching_strategy": "Equals"
          }
        ]
      }
    ]
  }
]
#

With the config above every windows terminal will be forced to workspace "1" and every firefox window will be force to workspace "2".

winged lantern
#

Awesome!!!

#

Thanks for linking the docs. and all the help

winged lantern
#

@lavish egret Can I match all the apps I have or I am restricted to the applications.yaml list?

somber rose
#

You can match them all, no restrictions

winged lantern
#

yes boss 🫡

lost merlin
winged lantern
lavish egret
#

In that example I only showed one monitor but you can have multiple... And set the config of each workspace of each monitor as you'd like.