Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xdotool doesn't work via SSH

Tags:

ssh

xdotool

I want to use xdotool via SSH but get the following error:

Error: Can't open display: (default)

I found this solution:

export DISPLAY='0:0'

Still get nearly the same error :(. I also tried:

export DISPLAY=:0; or: export DISPLAY="0:0", ...

Always a error like that:

Error: Can't open display: (0:0)

Is thera a alternative (working) solution for xdotool?

I don' know whether It work lokal. I've only got a SSH-connection.

like image 367
Franklin84 Avatar asked Jun 28 '14 06:06

Franklin84


2 Answers

export DISPLAY=:0.0 && xdotool key a

Try this =)

like image 187
funivan Avatar answered Sep 20 '22 11:09

funivan


You did the right thing export DISPLAY='0:0'
But you should also set XAUTHORITY like this:
export XAUTHORITY="/home/username/.Xauthority"

Ofcourse the username is an account which has logged in via gnome.

Don't forget to change username with your right account name.

like image 24
Arash Avatar answered Sep 21 '22 11:09

Arash