I'm using evrouter to simulate keypresses from my mouses extra buttons. It works great but I need to run the command with sudo to make it work so I can't just use my DE to handle autostart.
I considered init.d but from what I've heard this only works for different stages of boot, and I need this to run as root after login.
$ cat .evrouterrc "Logitech G500" "/dev/input/event4" any key/277 "XKey/0" "Logitech G500" "/dev/input/event4" any key/280 "XKey/9" "Logitech G500" "/dev/input/event4" any key/281 "XKey/8" $ sudo evrouter /dev/input/event4
Edit: Alrighty, it looks like I can use lightdm.conf's
session-setup-script option to run a script as root. The script I have is below, but as expected when run as root the
id -u no longer equals 1000 and the if statement never executes. Is there an argument or variable I can use to get the user name or id?