Reputation: 41
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
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