Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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:

#!/bin/bash

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
1  
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/tablet.sh'(err) 'Unable to connect to X server' [212.580112] [2321] spawn_wait: '/usr/local/bin/tablet.sh' [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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.