How to repeat ctrl+Tab at specified interval

1,841 views
Skip to first unread message

Douglas Banker

unread,
Sep 21, 2016, 1:38:08 AM9/21/16
to xdotool-users
I'm running Raspbian Jessie on a Pi 3.  I want to make an automated dashboard.  I can get chromium-browser to open with 3 tabs but I can't automate the ctrl+Tab.  this works from the command line in an lxterminal:
watch -n 10 'xdotool search --onlyvisible --class "chromium" windowfocus; xdotool key ctrl+Tab' but it doesn't work in the LXDE autostart file or in a bash script.  I've been looking all over the internet with lots of ideas but none seem to work.  If I can get it to work from a command line what am I doing wrong to get it to work in autostart or bash?

Thanks!   Doug

Glen Duncan

unread,
Feb 17, 2017, 6:07:10 PM2/17/17
to xdotool-users


On Wednesday, September 21, 2016 at 1:38:08 AM UTC-4, Douglas Banker wrote:
I'm running Raspbian Jessie on a Pi 3.  I want to make an automated dashboard.  I can get chromium-browser to open with 3 tabs but I can't automate the ctrl+Tab.  this works from the command line in an lxterminal:
watch -n 10 'xdotool search --onlyvisible --class "chromium" windowfocus; xdotool key ctrl+Tab' but it doesn't work in the LXDE autostart file or in a bash script.  I've been looking all over the internet with lots of ideas but none seem to work.  If I can get it to work from a command line what am I doing wrong to get it to work in autostart or bash?

I don't have an answer to your specific problem, but I've been working on making similar dashboards and kiosks. Rather than try and wedge chromium-browser to behave the way you want (hiding window decorations, etc) take a look at gtk-webkit. You can run web content in a window or in the root window without a window manager even installed!

dno...@bacgroup.net

unread,
Apr 5, 2017, 1:44:08 AM4/5/17
to xdotool-users
i had the same problem. run ok from the command line but doesn't works in a bash.

i solved adding a sleep between commands. same like this.. 

sleep 15 &&
xdotool mousemove 200 300 && 
sleep 10 &&
xdotool click 1
sleep 2
xdotool key Tab

Anthony Thyssen

unread,
Apr 12, 2017, 12:12:08 AM4/12/17
to dno...@bacgroup.net, xdotool-users
You can do sleep commands in the same xdotool command.

--
You received this message because you are subscribed to the Google Groups "xdotool-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xdotool-users+unsubscribe@googlegroups.com.
To post to this group, send email to xdotoo...@googlegroups.com.
Visit this group at https://groups.google.com/group/xdotool-users.
For more options, visit https://groups.google.com/d/optout.

Jordan Sissel

unread,
Apr 12, 2017, 1:35:52 AM4/12/17
to dban...@gmail.com, xdotool-users
If you want to repeat a key stroke periodically, check out the --repeat and --repeat-delay settings.

In your case, it looks like you are trying to send ctrl+Tab every 10 seconds, something like this:

xdotool key --repeat 5 --repeat-delay 10000 ctrl+Tab

(repeat 5 times with 10,000 milliseconds between each keystroke)

There's no "repeat forever" right now, but I'm open to adding it if folks need. A 'repeat forever' can be achieved with the following shell

while true; do
  xdotool key ctrl+Tab
  sleep 10
done



--
Reply all
Reply to author
Forward
0 new messages