USING XDOTOOL

2,136 views
Skip to first unread message

Esteban Oliveros Montoya

unread,
Nov 15, 2010, 11:10:36 AM11/15/10
to xdotoo...@googlegroups.com
Hello Jordan, first of all, thanks for xdotool.
I'm trying to use it to control with voice the gnome desktop, fews apps, nothing strange, but I find out that when I'm try to e.g. close a window "Alt+F4" the program "press" first Alt and then F4, obviously without success closing the window....The same happens with shift and crtl.

That is the issue.... :S

 When I test the first example you put on the xdotool webpage....
xdotool search "Mozilla Firefox" windowactivate --sync key --clearmodifiers ctrl+l

Firefox appers in first plane, but the command to clean my terminal doesnt work.
If you need more specific info. for help me, please let me know.

Thanks in advance,

--
Esteban Oliveros Montoya
Vicepresidente Rama estudiantil IEEE
Lab. Visión Artificial  - Espacio 2020 Edif. 353
Universidad del Valle, Cali.

Celular: 314-5665752






Joseph Krahn

unread,
Nov 19, 2010, 5:31:52 PM11/19/10
to estebano...@gmail.com, xdotoo...@googlegroups.com
On 11/15/10, Esteban Oliveros Montoya <esteb...@ieee.org> wrote:
> Hello Jordan, first of all, thanks for xdotool.
> I'm trying to use it to control with voice the gnome desktop, fews apps,
> nothing strange, but I find out that when I'm try to e.g. close a window
> "Alt+F4" the program "press" first Alt and then F4, obviously without
> success closing the window....The same happens with* shift* and* crtl*.

>
> That is the issue.... :S
>
> When I test the first example you put on the xdotool webpage....
>
> xdotool search "Mozilla Firefox" windowactivate --sync key
> --clearmodifiers ctrl+l
>
> Firefox appers in first plane, but the command to clean my terminal doesnt
> work.
>
> If you need more specific info. for help me, please let me know.
>
> Thanks in advance,
>
> --
> *Esteban Oliveros Montoya**

> Vicepresidente Rama estudiantil IEEE
> Lab. Visión Artificial - Espacio 2020 Edif. 353
> **Universidad del Valle, Cali*.

I don;t know about the webpage examples, but I can explain how to send window
manager shortcut keys.

The window manager shortcut keys must be sent to the window manager's
frame window.
For example, using "xwininfo -children", I can find the parent window
ID, which is the
frame window. I can then send alt+F9 like this, where the ID is the parent:

xdotool key --window 0x1116d86 alt+F9

Using Gnome window manager, this will minimize the target window. WIth
F4 instead of
F9, it will close the window.

Joe Krahn

Jordan Sissel

unread,
Nov 19, 2010, 5:48:01 PM11/19/10
to joseph...@gmail.com, estebano...@gmail.com, xdotoo...@googlegroups.com

If you use --window 0 (which is default unless you have done a
search), it'll send a keystroke exactly as if your keyboard had typed
it.

Window of 0 means xdotool will use XTEST which is a normal X extension
that makes input present as a normal keyboard and mouse. If the window
is nonzero, xdotool will send keystrokes specific to that window using
XSendEvent.

This will close the first-found gnome-terminal assuming your window
manager is looking for Alt+F4 to close a window:
xdotool search gnome-terminal windowactivate --sync key --window 0 alt+f4

You can also kill windows, which usually exits the application:
xdotool search gnome-terminal windowkill

-Jordan

Reply all
Reply to author
Forward
0 new messages