Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Genius tablet and I need to remap some buttons on it when I connect it to the usb. The remmaping is done by this command:

xinput set-button-map 'Genius EasyPen M610X' 0 0 0 0 0 0 0 1 3 2

and I'm using udev to call a script like this:


sleep 10
/usr/bin/xinput set-button-map 'Genius EasyPen M610X' 0 0 0 0 0 0 0 1 3 2

The script works fine, also the udev calls the script when the device is plugged in however the line with the xinput is not executed. Dmesg and syslog didn't say nothing about error, also using udevadm test device... is passing with no errors. Any ideas? Thanks.

share|improve this question
Can you post the output from udevd --debug-trace --verbose and strace -p pid_of_udevd -f -e trace=open,exec – thisfeller Jul 15 '12 at 14:46
Hi thanks for reply, the output is too long however there were two lines which say about error with the script [212.579522] [2321] spawn_read: '/usr/local/bin/'(err) 'Unable to connect to X server' [212.580112] [2321] spawn_wait: '/usr/local/bin/' [2326] exit with return code 1 – Jan Jul 15 '12 at 15:25
Are you using debian? – thisfeller Jul 15 '12 at 20:03
I'm using debian like distro Linux mint 13 – Jan Jul 24 '12 at 6:59

Most likely the problem is that the script is called with the DISPLAY environment variable unset. This variable tells X programs which display they are supposed to connected to. Try adding the following before calling xinput.

export DISPLAY=:0

For example:

% export DISPLAY=:0
% xinput ...
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .