mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-01-11 14:40:25 +01:00
[BUG]: enable-autostart runs with CMD not Powershell #414
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 @stereotypicaldev on GitHub (Jun 16, 2024).
Describe the bug
I followed the video guide from Youtube and copied the commands from Common Workflows - KOMOREBI_CONFIG_HOME trying to switch my config folder from the
C:\Users\Username(home folder) toC:\Users\Username\.config\komorebiat minute 4:20 in the video, a change to theapp_specific_configuration_pathis displayed from$Env:USERPROFILE/applications.yamlto$Env:KOMOREBI_CONFIG_HOME.That seems to work when running manually the instance from Powershell, but the enable-autostart command had problems with my configuration. After playing around with it for a bit, I managed to fix the
.inkshortcut, but switching back to the$Env:USERPROFILE/applications.yamlinside my komorebi.json.The execution of this command is now
C:\Users\Username\scoop\apps\komorebi\current\komorebic-no-console.exe start --config C:\Users\Username\.config\komorebi\komorebi.json --ahkthis seems to work for me.In case anyone else has a problem with the autostart, try running the command inside the
.inkusing Command Prompt, if it runs, that means next time you login, chances are it will work. Tinker with your configuration if it doesn't.On the same point, running
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUseror setting it to something likeSet-ExecutionPolicy -ExecutionPolicy Restricted -Scope LocalMachinehad no difference to me, both run the ```.ink`` shortcut perfectly, on my computer startup.To Reproduce
Steps to reproduce the behavior:
$Env:KOMOREBI_CONFIG_HOMEinstead of$Env:USERPROFILE/applications.yaml.C:\Users\Username\scoop\apps\komorebi\current\komorebic-no-console.exe start --config C:\Users\Username\.config\komorebi\komorebi.json --ahk.Expected behavior
I was not sure how to set the
KOMOREBI_CONFIG_HOMEEnvironment variable for Command Prompt, aka the whole Computer, by using the GUI for Environment Variables through Windows, so I am guessing that was my fault.In case someone can provide another way to set an Environment Variable both for Powershell and Command Prompt, without using the
$PROFILEthat would be ideal.Operating System
OS Name: Microsoft Windows 10 Pro N
@SVendittelli commented on GitHub (Sep 9, 2024):
Hey @gzachariadis, maybe this will help you. You can set the
KOMOREBI_CONFIG_HOMEenvironment variable for your user in a number of ways.Firstly, run the following from a PowerShell terminal:
Note: that this will store the expanded form of your user home folder in the variable. This is required because windows (at least on cmd) evaluates environment variables in alphabetical (lexicographical) order. This means that a value like
%USERPROFILE%/.config/komorebiwon't expand correctly becauseKOMOREBI_CONFIG_HOMEcomes beforeUSERPROFILEalphabetically.Secondly, as you mentioned, from the windows GUI. This is not the best solution, as it cannot be scripted easily. Here is an article on how to do it.
Finally, you can use a third party program like Rapid Environment Editor for a different GUI.
Don't forget to restart any terminals after applying those changes.
After doing any of those, you shouldn't need to add the
--configflag to the.lnkin the start folder. I also believe that setting"app_specific_configuration_path": "$Env:KOMOREBI_CONFIG_HOME/applications.yaml"in yourkomorebi.jsonshould also work after doing this.