I want to map some keymap shortcut to restart some services. For instance, typing in my terminal in NixOs:
systemctl restart --user random-background
random-background service correctly and change the background.
To my surprise the same shortcut in my
sxhkd config is ineffective.
"super + b" = "systemctl restart --user random-background";
Playing with other shortcut, my first assemption is that sxhkd does not know who the user is. But adding the following shortcut:
"super + e" = "systemctl --user list-units > /tmp/foo";
Create an empty files, hence suggesting that the service
sxhkd does not have any visibility on other running services and cannot restart them. Also:
"super + e" = "whoami > /tmp/foo";
Does not give any output (I was expecting to output my user). Am I misunderstanding something in my analysis or are these services run as “empty” user and can’t see any other services? How can I let sxhkd run as my user and be able to restart other services?
Thanks in advance for any thoughts!