I made a script to rotate my Wacom Bamboo tablet 180 degrees. It works fine when I execute it as myself (user) or root, but when started from udev (i.e. when plugging the tablet into a usb port) it won't work.Udev rules:SUBSYSTEMS==usb, ATTRS{idVendor}==056a, ATTRS{idProduct}==00d1, ATTRS{manufacturer}==Wacom Co.,Ltd., RUN+=/usr/local/bin/red-wacom-bamboo.shWacom script /usr/local/bin/red-wacom-bamboo.sh:#!/usr/bin/env bashexec > /tmp/red-wacom.logexec 2>&1# I had to do this otherwise xsetwacom would say:# Failed to open Display .# Is there a way to do this without using my username?export XAUTHORITY=/home/redsandro/.Xauthorityexport DISPLAY=:0/usr/bin/xsetwacom set Wacom Bamboo 2FG 4x5 Pen stylus Rotate half/usr/bin/xsetwacom set Wacom Bamboo 2FG 4x5 Finger touch Rotate halfResult in /tmp/red-wacom.log:Cannot find device 'Wacom Bamboo 2FG 4x5 Pen stylus'.Cannot find device 'Wacom Bamboo 2FG 4x5 Finger touch'.(Note that the error in the log means the udev rule itself is not the problem.)I tried setting a sleep in the script, maybe it needs a few ms. But that doesn't help.Why doesn't this script work when called directly from udev?How do I fix this?Can I call a script from udev as a specific user? (e.g. sync /home to external backup drive - /home/ is only visible to it's user)
Why doesn't xsetwacom work from udev?
xorg;devices;udev
There is a fairly easy workaround, you can add something like this to your xorg.conf (or a file in xorg.conf.d, as I've done):anthony@Watt:/etc/X11/xorg.conf.d$ cat 55-local-wacom.conf Section InputClass       Identifier Wacom Left Handed       MatchDriver wacom       Option Rotate halfEndSectionCheck the wacom(4) manpage for details of all the options you can set.(In theory, you can use MatchProduct to individually configure the touchpad, pen, eraser, etc., but when I tried that a while back, it caused Xorg to segfault. Same if I tried to float them. But you're not doing any of that... and maybe the bug is fixed now.)