XDoTool Suggestion

635 views
Skip to first unread message

Anthony Thyssen

unread,
Mar 22, 2012, 1:24:18 AM3/22/12
to xdotool Users List

Xdotool can locate windows, but it does not have something to wait
for a specific window to appear.


For example I typically want to start firefox, then when it appears
set its size and iconify it.

At the moment I am needing to use a script to continuiously search
for a window to appear, before I can finish of its setup.

Script...
http://www.ict.griffith.edu.au/anthony/software/xwin_find.sh

Example usage of the script is in its comments.

Something like a -wait option to the search command to continually
search until it finds the window (or times out with a error).

this means I can do somethng like this

firefox &
eval $( xdotool search -limit 1 -wait 60 --classname FireFox \
getwindowgeometry -shell )
xwith -iconify -id $WINDOW

which will wait up to 60 second until it find any firefox window,
then uses "xwit" to iconify it


Note: xdotool does not have an iconify action either!

Nor can you specify the %1 as argument in an exec command argument either!


Anthony Thyssen ( System Programmer ) <A.Th...@griffith.edu.au>
--------------------------------------------------------------------------
"In the beginning their was darkness, and the darkness was without form
and void. And in addition to the darkness their was also me! And I
moved upon the face of the darkness, and I saw that I was alone..."
"Hey... bomb..."
"Let their be light ..." -- Classic SciFi Movie "DarkStar", 1974
--------------------------------------------------------------------------
Anthony's Castle http://www.ict.griffith.edu.au/anthony/

Jordan Sissel

unread,
Mar 22, 2012, 1:29:30 AM3/22/12
to a.th...@griffith.edu.au, xdotool Users List
On Wed, Mar 21, 2012 at 10:24 PM, Anthony Thyssen <A.Th...@griffith.edu.au> wrote:

Xdotool can locate windows, but it does not have something to wait
for a specific window to appear.

It should, I think. I added --sync to search a while ago... but clearly I haven't released it! Oops!

You should be able to build from master if you want to try this feature:


% xdotool search --help | grep sync
--sync          Wait until a search result is found.

-Jordan

Harald Milz

unread,
Apr 4, 2012, 9:24:07 AM4/4/12
to xdotool-users
Anthony,

On 22 Mrz., 07:24, Anthony Thyssen <A.Thys...@griffith.edu.au> wrote:

> Note: xdotool does not have an iconify action either!

At the danger of answering late, xdotool does have an windowminimize
function, which should be what you are looking for.

The search -wait is a good idea IMHO, I have the same problem and need
to poll for the window, causing many forks and context switches, which
is not so nice in a load testing scenario. @Jordan, search --sync
doesn't actually wait, does it?


Jordan Sissel

unread,
Apr 4, 2012, 1:37:28 PM4/4/12
to h...@seneca-muc.de, xdotool-users
search --sync does block until it finds windows; --sync was admittedly a poor choice for the 'search' function, but it mirrors the --sync behavior of all the other commands that implement it ("wait until this is done" essentially).  '

-Jordan

--
You received this message because you are subscribed to the Google Groups "xdotool-users" group.
To post to this group, send email to xdotoo...@googlegroups.com.
To unsubscribe from this group, send email to xdotool-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xdotool-users?hl=en.


Reply all
Reply to author
Forward
0 new messages