You are not logged in.
[Originally I posted this to the mailing list but got no response]
Hello all,
My new keyboard does not have an audio "Play/Pause" key. However I've found a way to emulate it with this command:
xdotool key XF86AudioPlay
Works great from the command line. Now all I need to do is bind the above command to a keyboard shortcut. I go to Xfce Settings Manager -> Keyboard -> Application Shortcuts and setup a binding. It does not work. I've proven that Xfce is executing my xdotool command but for some reason it has no effect. It's as if the execution context is different when Xfce executes it.
Any thoughts?
Thanks
- Cruxic
(XUbuntu 10.04)
Offline
I don't use xdotool but if you want to debug why it doesn't work, try to embed your command in a script. Something like this :
#!/bin/bash
env > /tmp/log
pwd >> /tmp/log
xdotool key XF86AudioPlay &> /tmp/log
Run the script in a Terminal then run it by the Xfce Keyboard shortcut and compare the 2 log files.
Xfce is NOT Xubuntu. Bugs in Xubuntu don't mean that Xfce is buggy ...
Offline
Good idea, angstrom. When XFCE executes the script there appear to be very few differences. $USER is still me. $PATH is different but still able to find the xdotool command. $DISPLAY is the same. In both cases xdotool exits with zero/success. The only interesting difference I see is the lack of the $WINDOWID variable when XFCE executes it.
Thoughts? I tried artificially exporting $WINDOWID in the script but it had no effect.
Last edited by cruxic (2011-09-19 17:58:57)
Offline
Uhm ... Maybe some conflict between the key stroke sent by xdotool and the key stroke that are currently active/down as use xfce keyboard shortcut. Have you try to ask developper of xdotool ? What happen when you run xdotool AND there are key on keyboard that are active ? Try to put a sleep command in the script ?
Xfce is NOT Xubuntu. Bugs in Xubuntu don't mean that Xfce is buggy ...
Offline
Brilliant! The sleep command did it. Apparently xdotool (or perhaps X itself) has trouble sending keystrokes if a real key is already down. Thanks a bunch, angstrom!
Offline
You're welcome :-)
Xfce is NOT Xubuntu. Bugs in Xubuntu don't mean that Xfce is buggy ...
Offline
[ Generated in 0.013 seconds, 7 queries executed - Memory usage: 533.05 KiB (Peak: 533.68 KiB) ]