waycrate / swhkd

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

Swhks stops after login #253

Open Canious opened 4 months ago

Canious commented 4 months ago

Version Information:

Describe the bug: I have found that swhks stops after logging in, although I have checked that swhkd is still running. I followed the systemd step and checked if it works by adding an additional autostart command to my hyprland configuration, but no luck, it doesn't work. Expected behavior: Swhks should works with swhkd after login

Actual behavior:

To Reproduce:

Additional information: I think it might be the window manager startup issue that intercepted the process, but I can't tell which one it is. And my log seems to be normal,

● hotkeys.service - swhkd hotkey daemon
     Loaded: loaded (/etc/xdg/systemd/user/hotkeys.service; enabled; preset: enabled)
     Active: active (running) since Tue 2024-03-05 22:47:38 CET; 12s ago
   Main PID: 599 (bash)
      Tasks: 20 (limit: 38173)
     Memory: 6.8M (peak: 20.5M)
        CPU: 182ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/hotkeys.service
             ├─599 bash /home/swer/.config/swhkd/hotkeys.sh
             ├─609 /usr/bin/swhkd
             └─932 swhks

Mar 05 22:47:38 berserk systemd[589]: Started swhkd hotkey daemon.
Mar 05 22:47:38 berserk hotkeys.sh[608]: [2024-03-05T21:47:38Z WARN  swhks::environ] XDG_DATA_HOME Variable is not set, falling back on hardcoded path.
Mar 05 22:47:38 berserk pkexec[609]: pam_unix(polkit-1:session): session opened for user root(uid=0) by swer(uid=1000)
newtoallofthis123 commented 4 months ago

Hey @Canious! I have put up a proposal for this an enhancement that would fix this issue! Check it out here #251 and feel free to let me know what you think about it. Work is being done on this :)

Canious commented 4 months ago

I have seen this but how can we achieve that, I am totally a rookie. However, I saw this #144, is that what you mean @newtoallofthis123

newtoallofthis123 commented 4 months ago

Not per se @Canious....I mean that if swhkd detects that swhks is not running, it tries it's best to start the process as a daemon. I am still figuring out how to exactly start the daemon in itself without adding too much to the dependency graph.

Canious commented 4 months ago

How does swhkd detect if swhks is working, I am totally new to this repository, got no idea what to do about it

newtoallofthis123 commented 4 months ago

As far I understand, swhks saves a file called swhks.pid in the XDR_RUNTIME_DIR that can be read to get the pid of the server if it is running. If it isn't we just spawn it... The spawn mechanics is something that I am trying to figure out currently