Minecat40
Minecat40

Reputation: 41

Xdotool Fails On Raspberry Pi

I'm running retropie on my Raspberry Pi, and I want to figure out a way to use the GPIO to simulate keystrokes. Xdotool seems like my best bet, but it doesn't work locally or over ssh. When I enter xdotool key 'd' I get the error:
Error: Can't open display: (null) Failed creating new xdo instance
Every answer so far claims that to solve this issue I have to do some variation of export DISPLAY=":0" xdotool key 'd' but this doesn't do anything, it just goes to the next line. I'm pretty new to linux, so thanks in advance.

Upvotes: 3

Views: 4734

Answers (1)

ThreepE0
ThreepE0

Reputation: 106

I stumbled across an answer that worked for me. Simply running "xauth" as Pi at the command line told me which file was being used by xauthority (/home/pi/.Xauthority in this case.)

Hope this helps

export XAUTHORITY=/home/pi/.Xauthority; export DISPLAY=:0; xdotool key Return

Upvotes: 6

Related Questions