Ubuntu Mate 1.16.2 - Xdotool help

Hi guys,

Since running the latest apt-get update on my Raspberry Pi 3, I’ve lost all ability to run scripts with the commands ‘xdotool key’.

The script manages to open Chrome, and navigates to the desired web page, but it won’t do the tab and clicks I have scripted in anymore.

Has anyone got any info that might explain why this has happened? I’ve seen similar posts online, but no viable solutions really.

I’ve not much experience with Ubuntu, so any help is welcome.

Thanks, Sam.

If you try sending keys to a different program, you can identify if the problem is due to a change in xdotool or in Chrome.

You may have to add some delay between calls or force a window activation to send the keys to the appropiate window.

I don’t have a Raspberry to test it, but I use the following command to activate Chrome and send the [space] key to pause/resume youtube:

 DISPLAY=:0 /usr/bin/xdotool search --onlyvisible --class google-chrome windowactivate search --onlyvisible --class google-chrome key --clearmodifiers space

You can run this from a terminal after opening chrome.
Replace [space] with [tab] or another key and see if this works for you.

Hi Gabdub,

Thanks for your reply! I will try out the command you mentioned.

The more I look into this, the more I start to think the issue is lying with Chrome & not the script.

When its been run, the browser opens up fine, and displaying the website I want. Its all the steps after that which fail. I get a few error messages in the terminal session that runs in the background when the script is on.

ERROR: cert_verify_proc_nss.cc(982) CERT_PKIXVERIFYCERT failed ( Which looks like a cert issue with the webpage, which is fine, I know why that it. Plus, that wouldn’t cause my xdotool function to start

ERROR: sandbox_linux.cc(379) Initialise SandBox called with multiple threads in process gpu-process ( no idea what this is)

ERROR: gpu_process_transport_factory.cc(1007) Lost UI shared context ( this seems like it could be relevant to my issue - I’ve not looked into it properly yet)

With regards to the script content, I have the following

chromium-browser “URL”
xdotool key F11
sleep 5
xdotool key Tab
sleep 10
xdotool type …
xdotool key Tab
sleep 5
xdotool type …
sleep 5
xdotool key Tab
xdotool key Return

Basically all I want is for the script to fill in a username and password field, then tab and return to log in.

I’m going to carry on looking into the issue, and ill try your suggestion. Let me know if you have any more help.

I appreciate the reply,

Thanks, Sam.

1 Like

I agree.

Some time ago I wrote a remote control for my TV PC using apache + xdotool + gnome-pie, you can check the xdotool scripts I use here for some ideas:

A useful option when typing multiple keys in a row is to add a delay between the keys.
For example: –delay 300