swaywm/swayidle

How to run root level daemons with swayidle?

Redhawk18 opened this issue · 1 comments

Hi, I wanted to ask if it was possible to somehow run root level processes with Swayidle. The reason I wanted to do this is to get idle time mining working with Xmrig, where it needs to be run as root to increase hashrate. However since the Wayland compositor is running as your local user I can't just run Swayidle as root. I've also tried something like this but I run into the same problems

─redhawk💾Mythra─ ~ 
 └$ sudo su redhawk -c swayidle timeout 3 'sudo whoami' resume 'echo resume'
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
2024-05-20 22:02:25 - [Line 1096] Unable to connect to the compositor. If your compositor is running, check or set the WAYLAND_DISPLAY environment variable.