You are not logged in.

#1 2015-12-22 21:49:51

dsulli99
Member
Registered: 2010-11-18
Posts: 31

[Solved]xdotool new tab with Chromium or Firefox

Hi,

I am using xmonad as a window manager and I'm trying to use xdotool to open a new browser tab in either Firefox or Chromium.  For some reason I cannot get this working.  I know I am selecting the window properly because I can type arbitrary characters into the window, or reload the page using F5 for example.  It seems like whenever I try to use the cntrl key the key is not registering in the Window.  I feel like I must be doing something stupid.  This command works fine to reload the page

xdotool search --onlyvisible --class "firefox" windowfocus key 'F5'

Although neither of these (or similar permutations) do:

xdotool search --onlyvisible --class "firefox" windowfocus key 'ctrl+t'
xdotool search --onlyvisible --class "firefox" windowfocus key --delay=1000 'ctrl+t'
xdotool search --onlyvisible --class "firefox" windowfocus key --clearmodifiers --delay=1000 't'
xdotool search --onlyvisible --class "firefox" windowfocus key 'Control_L+t'

Am I missing something?  I would appreciate it if somebody could help me with this.

Dan

Last edited by dsulli99 (2015-12-24 13:28:33)

Offline

#2 2015-12-23 01:15:38

toz
Member
Registered: 2011-10-28
Posts: 513

Re: [Solved]xdotool new tab with Chromium or Firefox

Looks like a timing issue.

sleep 3 && xdotool key Ctrl+t

...giving you time to focus the firefox window, works. Also:

xdotool search --onlyvisible --class "firefox" windowfocus && xdotool key Ctrl+t

...works.

Offline

#3 2015-12-24 13:29:32

dsulli99
Member
Registered: 2010-11-18
Posts: 31

Re: [Solved]xdotool new tab with Chromium or Firefox

Indeed it does work.  Thank you.  :-)

Dan

Offline

Board footer

Powered by FluxBB