waycrate / swhkd

Sxhkd clone for Wayland (works on TTY and X11 too)
https://git.sr.ht/~shinyzenith/swhkd
BSD 2-Clause "Simplified" License
679 stars 47 forks source link

swhkd wont run + XDG_CONFIG_HOME/RUNTIME_DIR issues #203

Open webbb82 opened 1 year ago

webbb82 commented 1 year ago

Version Information: swhkd 1.3.0-dev

so ok Lets look into this. I looked it up and putting export XDG_RUNTIME_DOR=/run/user/1000 amd export XDG_CONFIG_HOME=/run/user/1000 in the .zshrc file this is suppose to fix that. It didnt. another similar bug report for swhkd said to try and run systemctl --user restart hotkey.service amd O tried that but i get Failed to restart hotkeys.service: Unit hotkeys.service not found.

So now I dont know what else to do. here is my journal log https://pastebin.com/j2qi9w4j Expected behavior: I expected that once installed, and Ran sxgkd and plkexes something that my keybinds on the config file would start to work

Actual behavior: Nothing happened. swhkd did not start nor did my keybinds work To Reproduce: Install swhkd in hyprland and try to start. It never started on its own so I had to try and manually start it

Additional information:

heyzec commented 1 year ago

I believe this is the similar to https://github.com/waycrate/swhkd/issues/201

webbb82 commented 1 year ago

Ok so maybe I tell swhkd and pexec to run in the startup screipt with the c flag after the name and point it toward where the actual config is located ?

On Fri, May 5, 2023, 6:14 AM heyzec @.***> wrote:

I believe this is the similar to #201 https://github.com/waycrate/swhkd/issues/201

— Reply to this email directly, view it on GitHub https://github.com/waycrate/swhkd/issues/203#issuecomment-1536245492, or unsubscribe https://github.com/notifications/unsubscribe-auth/A46AI3F4FHJ7Q5F3Z6WXDK3XET4J3ANCNFSM6AAAAAAXOTSH2E . You are receiving this because you authored the thread.Message ID: @.***>

ItsProfessional commented 1 year ago

This is happening because swhkd tries to use the config in your .config directory if the XDG_CONFIG_HOME environment variable is set, however since pkexec doesn't pass-through all of your environment variables (including XDG_CONFIG_HOME), swhkd falls back to a hardcoded path that is /etc/swhkd/swhkdrc

Pkexec marks this logging message as an expected error instead of a warning, and doesn't mention that it's falling back to a hardcoded path, until you actually look at at the source, which is leading to this confusion

All you have to do is just create the file at /etc/swhkd/swhkdrc. Pkexec will still warn you that the environment variables are not set, but it will not terminate this time since the config file exists at the hardcoded path it falls back to.

webbb82 commented 1 year ago

This is happening because swhkd tries to use the config in your .config directory if the XDG_CONFIG_HOME environment variable is set, however since pkexec doesn't pass-through all of your environment variables (including XDG_CONFIG_HOME), swhkd falls back to a hardcoded path that is /etc/swhkd/swhkdrc

Pkexec marks this logging message as an expected error instead of a warning, and doesn't mention that it's falling back to a hardcoded path, until you actually look at at the source, which is leading to this confusion

All you have to do is just create the file at /etc/swhkd/swhkdrc. Pkexec will still warn you that the environment variables are not set, but it will not terminate this time since the config file exists at the hardcoded path it falls back to.

oh alrigh ill give that a try. thank you very much