I am trying to run some X11 commands (xmodmap, xrandr) from devd as ordinary user but it doesn't work.
Running same command as root works.
logger action works but not xmodmap:
Running
Same results when trying to run command as root but from
Running same command as root works.
Code:
notify 101 {
match "system" "USB";
match "subsystem" "!usbus[0-9]+";
match "vendor" "0x0416";
match "product" "0xa0f8";
match "type" "attach";
action "su -l user -c 'DISPLAY=unix:0.0 xmodmap ~/.xmodmap'";
action "logger USB keyboard attached, running xmodmap as user";
};
logger action works but not xmodmap:
Code:
grep xmodmap /var/log/messages
Jul 14 09:12:17 hostname user[22373]: USB keyboard attached, running xmodmap as user
Jul 14 09:12:17 hostname user[22376]: USB keyboard attached, running xmodmap as user
Jul 14 09:12:17 hostname user[22379]: USB keyboard attached, running xmodmap as user
Running
su -l user -c 'DISPLAY=unix:0.0 xmodmap ~/.xmodmap'
as root works as intended. devd
is run as root:
Code:
ps aux | grep devd
root 90594 0.0 0.0 10572 1444 - Ss 18:39 2:27.65 /sbin/devd
Same results when trying to run command as root but from
/bin/sh
or changing '~' to '$HOME' or using absolute path.