Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swhkd wont run + XDG_CONFIG_HOME/RUNTIME_DIR issues #203

Open
webbb82 opened this issue Apr 28, 2023 · 4 comments
Open

swhkd wont run + XDG_CONFIG_HOME/RUNTIME_DIR issues #203

webbb82 opened this issue Apr 28, 2023 · 4 comments
Assignees

Comments

@webbb82
Copy link

webbb82 commented Apr 28, 2023

Version Information:
swhkd 1.3.0-dev

  • Distribution Information ( run uname -a )
  • swhkd version ( swhkd -V )
    Linux archlinux 6.2.12-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 20 Apr 2023 16:11:55 +0000 x86_64 GNU/Linux
    Describe the bug:
    Cant get keybinds to work in swhkd. They do work when put in the hyprland config file. When in the terminal i type "swhkswhkd pkexec swhkd" I get this error
    ERROR swhkd] XDG_RUNTIME_DIR has not been set. Running swhkd as root!
    [2023-04-28T01:40:11Z ERROR swhkd] XDG_CONFIG_HOME has not been set

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
Copy link

heyzec commented May 5, 2023

I believe this is the similar to #201

@webbb82
Copy link
Author

webbb82 commented May 5, 2023 via email

@ItsProfessional
Copy link

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
Copy link
Author

webbb82 commented Jun 2, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants