[BUG]?: Unable to reliably autostart on windows 11 #218

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

Originally created by @skewballfox on GitHub (Jun 3, 2023).

Describe the bug
This may be user error as I'm pretty new to windows. I'm unable to start komorebi at login either via task scheduler or a batch file in the autostart directory

To Reproduce
via task scheduler
Steps to reproduce the behavior:

  1. Go to Task Scheduler
  2. Create a task with the following parameters:
    • run at login for the user,
    • make hidden
    • for windows 10,
    • run the command "C:/Path/to/komorebic.exe" with params start "--await-configuration" "--ffm"
  3. apply, reboot, login

via autostart:
create a bat file that starts komorebi with the above arguments, or add komorebi to an existing one. I've also tried creating a powershell file and running powershell via task scheduler at login

Expected behavior
komorebi starts and manages windows created after launch
k
Operating System

OS Name:                    Microsoft Windows 11 Pro N for Workstations
OS Version:                 10.0.22621 N/A Build 22621

komorebic check Output

KOMOREBI_CONFIG_HOME detected: C:\Users\joshu\.config\komorebi

Looking for configuration files in C:\Users\joshu\.config\komorebi

Found komorebi.ahk; this file will be autoloaded by komorebi

komorebi state tends to output the following

PS>komorebic state
could not get window title

Additional context
I'm using ahk v2, and I have the files pointed to in the readme in both the default location and ~/.config/komorebi. I've set the environment variables via the windows system gui rather than powershell profile, mainly so they would be detected via task scheduler and the batch file. I don't think this is an issue with the ahk files themselves as I can manually launch komorebic.exe from powershell without issue.

if I open task scheduler, komorebi is running in the background, but AHK is not. here is a log from the lastest

ERROR komorebi::process_command: could not get window title
2023-06-03T20:59:32.916129Z ERROR komorebi::process_command: The parameter is incorrect. (0x80070057)
2023-06-03T20:59:32.975251Z ERROR komorebi::process_command: Invalid window handle. (os error 1400)
2023-06-03T20:59:33.038047Z ERROR komorebi::process_command: Invalid window handle. (os error 1400)
2023-06-03T20:59:33.100457Z  INFO process_command{IdentifyTrayApplication(Class, "CreativeCloudDesktopWindowClass")}: komorebi::process_command: processed
2023-06-03T20:59:33.101520Z ERROR komorebi::process_command: could not get window title
2023-06-03T20:59:33.100457Z  INFO process_command{IdentifyTrayApplication(Class, "CreativeCloudDesktopWindowClass")}: komorebi::process_command: processed
2023-06-03T20:59:33.101520Z ERROR komorebi::process_command: could not get window title
2023-06-03T20:59:33.163590Z  INFO process_command{IdentifyBorderOverflowApplication(Class, "Photoshop")}: komorebi::process_command: processed
2023-06-03T20:59:33.164564Z ERROR komorebi::process_command: could not get window title
...

if I try to manually trigger the komorebi.ahk, komorebic starts, AHK starts, then komorebic and komorebi disappear (I'm assuming killed).

I can launch komorebic manually from powershell and it works fine, this behavior seems to occur via the multiple methods I've attempted to have it launched automatically at login

Originally created by @skewballfox on GitHub (Jun 3, 2023). **Describe the bug** This may be user error as I'm pretty new to windows. I'm unable to start komorebi at login either via task scheduler or a batch file in the autostart directory **To Reproduce** via task scheduler Steps to reproduce the behavior: 1. Go to Task Scheduler 2. Create a task with the following parameters: - run at login for the user, - make hidden - for windows 10, - run the command "C:/Path/to/komorebic.exe" with params start "--await-configuration" "--ffm" 3. apply, reboot, login via autostart: create a bat file that starts komorebi with the above arguments, or add komorebi to an existing one. I've also tried creating a powershell file and running powershell via task scheduler at login **Expected behavior** komorebi starts and manages windows created after launch k **Operating System** ``` OS Name: Microsoft Windows 11 Pro N for Workstations OS Version: 10.0.22621 N/A Build 22621 ``` **`komorebic check` Output** ``` KOMOREBI_CONFIG_HOME detected: C:\Users\joshu\.config\komorebi Looking for configuration files in C:\Users\joshu\.config\komorebi Found komorebi.ahk; this file will be autoloaded by komorebi ``` komorebi state tends to output the following ``` PS>komorebic state could not get window title ``` **Additional context** I'm using ahk v2, and I have the files pointed to in the readme in both the default location and ~/.config/komorebi. I've set the environment variables via the windows system gui rather than powershell profile, mainly so they would be detected via task scheduler and the batch file. I don't think this is an issue with the ahk files themselves as I can manually launch komorebic.exe from powershell without issue. if I open task scheduler, komorebi is running in the background, but AHK is not. here is a log from the lastest ```log ERROR komorebi::process_command: could not get window title 2023-06-03T20:59:32.916129Z ERROR komorebi::process_command: The parameter is incorrect. (0x80070057) 2023-06-03T20:59:32.975251Z ERROR komorebi::process_command: Invalid window handle. (os error 1400) 2023-06-03T20:59:33.038047Z ERROR komorebi::process_command: Invalid window handle. (os error 1400) 2023-06-03T20:59:33.100457Z INFO process_command{IdentifyTrayApplication(Class, "CreativeCloudDesktopWindowClass")}: komorebi::process_command: processed 2023-06-03T20:59:33.101520Z ERROR komorebi::process_command: could not get window title 2023-06-03T20:59:33.100457Z INFO process_command{IdentifyTrayApplication(Class, "CreativeCloudDesktopWindowClass")}: komorebi::process_command: processed 2023-06-03T20:59:33.101520Z ERROR komorebi::process_command: could not get window title 2023-06-03T20:59:33.163590Z INFO process_command{IdentifyBorderOverflowApplication(Class, "Photoshop")}: komorebi::process_command: processed 2023-06-03T20:59:33.164564Z ERROR komorebi::process_command: could not get window title ... ``` if I try to manually trigger the komorebi.ahk, komorebic starts, AHK starts, then komorebic and komorebi disappear (I'm assuming killed). I can launch komorebic manually from powershell and it works fine, this behavior seems to occur via the multiple methods I've attempted to have it launched automatically at login
adam added the bug label 2026-01-05 14:49:04 +01:00
adam closed this issue 2026-01-05 14:49:04 +01:00
Author
Owner

@LGUG2Z commented on GitHub (Jun 4, 2023):

Autostarting is not officially supported; some users have their own solutions, which may become more stable after #427 is completed.

@LGUG2Z commented on GitHub (Jun 4, 2023): Autostarting is not officially supported; some users have their own solutions, which may become more stable after #427 is completed.
Author
Owner

@skewballfox commented on GitHub (Jun 6, 2023):

I can make this into a separate issue if you like, but I think I realized part of the issue is unrelated to autostarting. It seems that komorebic, even when launched from the commandline with the env variable KOMOREBI_AHK_EXE set doesn't seem to launch the ahk config file.

I'm using AHK v2, with the script referenced in the readme. I don't have v1 installed, and as mentioned above, it seems komorebi is finding the script just fine.

@skewballfox commented on GitHub (Jun 6, 2023): I can make this into a separate issue if you like, but I think I realized part of the issue is unrelated to autostarting. It seems that komorebic, even when launched from the commandline with the env variable `KOMOREBI_AHK_EXE` set doesn't seem to launch the ahk config file. I'm using AHK v2, with the script referenced in the readme. I don't have v1 installed, and as mentioned above, it seems komorebi is finding the script just fine.
Author
Owner

@LGUG2Z commented on GitHub (Jun 13, 2023):

For those of you that are comfortable reading commit messages and code, please check out: https://github.com/LGUG2Z/komorebi/compare/feature/static-config

You can either compile this branch from source or grab the prebuilt binaries from the GitHub Actions job of the latest commit.

I've started working on the feature which allows komorebi to read in a static JSON configuration file, which can be started as komorebic start -c C:\Users\YourUser\Path\To\config.json

It would be good if people could report back whether or not this improves reliability at startup.

@LGUG2Z commented on GitHub (Jun 13, 2023): For those of you that are comfortable reading commit messages and code, please check out: https://github.com/LGUG2Z/komorebi/compare/feature/static-config You can either compile this branch from source or grab the prebuilt binaries from the GitHub Actions job of the latest commit. I've started working on the feature which allows komorebi to read in a static JSON configuration file, which can be started as `komorebic start -c C:\Users\YourUser\Path\To\config.json` It would be good if people could report back whether or not this improves reliability at startup.
Author
Owner

@mtanda commented on GitHub (Jul 6, 2023):

https://github.com/LGUG2Z/komorebi/pull/483 may fix a part of the issue.

@mtanda commented on GitHub (Jul 6, 2023): https://github.com/LGUG2Z/komorebi/pull/483 may fix a part of the issue.
Author
Owner

@zombie-bear commented on GitHub (Jul 24, 2023):

i have it working at startup whit : "komorebic start -c $Env:USERPROFILE\komorebi.json --whkd"
(no issue so far)

@zombie-bear commented on GitHub (Jul 24, 2023): i have it working at startup whit : "komorebic start -c $Env:USERPROFILE\komorebi.json --whkd" (no issue so far)
Author
Owner

@LGUG2Z commented on GitHub (Jul 24, 2023):

If some other people could confirm this maybe we can add in a komorebic command for the next release that installs a standardized startup hook. 🤞

@LGUG2Z commented on GitHub (Jul 24, 2023): If some other people could confirm this maybe we can add in a komorebic command for the next release that installs a standardized startup hook. 🤞
Author
Owner

@LGUG2Z commented on GitHub (Aug 9, 2023):

I have verified the following method as working on a W11 VM:

  • Win + R to bring up the Run menu, then shell:startup to bring up the Startup folder in Explorer
  • Right click in Explorer, File -> New -> Shortcut
  • Set the location to C:\Users\User\scoop\apps\komorebi\current\komorebic.exe start --config C:\Users\User\komorebi.json --whkd
  • Finish creating the shortcut
  • Restart
  • 🚀

I'll be closing this and related issues, and working towards commands that automate the creation of this shortcut file for autostarting komorebi on boot.

@LGUG2Z commented on GitHub (Aug 9, 2023): I have verified the following method as working on a W11 VM: * Win + R to bring up the Run menu, then `shell:startup` to bring up the Startup folder in Explorer * Right click in Explorer, File -> New -> Shortcut * Set the location to `C:\Users\User\scoop\apps\komorebi\current\komorebic.exe start --config C:\Users\User\komorebi.json --whkd` * Finish creating the shortcut * Restart * 🚀 I'll be closing this and related issues, and working towards commands that automate the creation of this shortcut file for autostarting komorebi on boot.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#218