first let me thank you for making and sharing your nice little 'xdotool'. I'm using it under Ubuntu 10.10 (64bit). Obviously it works, but I have a little problem (maybe with the use of the syntax, I don't know).
But from the beginning - I have written the following little bash-script:
#!/bin/bash
#Skript to start Nautilus in the 'Split-view' in a specified directory
#start Nautilus in download-directory
nautilus /media/Buffer/Quarantine/Downloads
#bridge the time-gap till Nautilus is started (value in seconds)
sleep 0.5
#start the 'Split-view' in Nautilus with "xdotool"
#find and activate Nautilus-window; wait with next action, till activation is done; fake F3-keystroke
xdotool search --name Downloads windowactivate --sync key F3
Now it appears, that:
- Nautilus only starts in the normal view, when I execute the script the first time after login (when I execute the script directly again after that, everything works fine and Nautilus starts in the split-view).
- This behaviour occurs repeatedly, always if there is a longer time-delay (several minutes, can't tell exactly), until the script is executed again.
What is wrong with the script? I would be very grateful, if you could help me, or give me some hints, how to solve this problem.
If there is some information missing about the problem, please don't hesitate to contact me.
Thanks in advance and have a nice day.
Greetings from Germany
Björn Nelius
--
GMX DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt auch mit
gratis Notebook-Flat! http://portal.gmx.net/de/go/dsl
The biggest problme I see with your script, is that you only do a sleep.
What you really need to do is actually wait for the nautilus window to appear.
I myself do something similar and iconify a Firefox navagator on strat
up. so I have written a script to look for and wait (with a ultimate
fail timeout) of a specific window to appear.
My current script is "xwin_find" available at...
http://www.ict.griffith.edu.au/~anthony/software/#xwin_find
And I use it like this...
( firefox -P default -geometry 820x1000+530+70 & ) &
if id=`xwin_find 60 ".* Mozilla Firefox"`; then
echo "Main firefox window found (id=$id)"
# size, position, and iconify
xwit -resize 820 1000 -move 530 70 -iconify -id $id
else
echo "ERROR: Firefox Default window NOT FOUND!"
fi
The firefox application is launched, and then the script is used
to wait for the application to actually appear.
At this time the "xwin_find" script uses the core xapp "xwininfo" and
could possibility benefit from other methods to look for applications
such as "xdotool" and "xwit".
Actually the addition of a 'wait for app window to appear' function in
"xdotool", would make this type of thing a lot easier!
Anthony Thyssen ( System Programmer ) <A.Th...@griffith.edu.au>
--------------------------------------------------------------------------
All wiyht. Rho sritched mg kegtops awound?
--------------------------------------------------------------------------
Anthony's Castle http://www.cit.griffith.edu.au/~anthony/
Not just with "xdotool" but with xprop, xkill, xwit, wmctrl, xte,
xmacro, and so on.
As well as applications that would call such scripts and tools, like
Key binding programs, including key binding from window managers.
And more advance input applications like "easystroke" (mouse gestures).
I found a number of interesting scripts just with google.
One from a long time ago was a script that grabs text from a text input
box, puts it in an editor of your choice, then when editor finished
puts that text back!
Anthony Thyssen ( System Programmer ) <A.Th...@griffith.edu.au>
--------------------------------------------------------------------------
Give us this day our daily data,
and forgive us our I/O errors,
as we forgive those whose logic is faulty.
Extract from: http://www.cit.gu.edu.au/~anthony/info/docs/KeyboardPrayer
For example...
zenity --title Downloads --error --text HELP &
id=`xwin_find 60 "Download"`
Will wait for the 'Download' window to appear, or time out after 60
seconds.
When the window is found it will return with a 'success' status
and assign the windows 'id' to the variable, so you can then modify
the window without needing to search for it again.
EG
zenity --title Downloads --error --text HELP &
if id=`xwin_find 60 "Download"`
then
# do something with window
else
echo >&2 "Error window not found after 60 seconds!"
fi
the script works by repeatedly doing the equivalent of a
xdotool search -name "...."
until the window appears, at which point it returns the window ID
(just like "xdotool" normally does).
However I wrote it before "xdotool" was available so internally it uses
xwininfo to get the full windows list, and looking for the window.
It pauses a full second between repeated searches, which makes it rather
slow. Something I would like to improve on.
So basically "xwin_find" just 'waits for the window' and return its id.
This functionality could be easily added to xdotool
For example as a type of search, sync, and timeout option
Anthony Thyssen ( System Programmer ) <A.Th...@griffith.edu.au>
--------------------------------------------------------------------------
"I'm serious about what I do, yes. Not necessarily the way I do it."
-- Doctor Who, "The Time Warrior"
--------------------------------------------------------------------------
Anthony's Castle http://www.cit.griffith.edu.au/~anthony/
On Thu, 11 Nov 2010 15:44:11 +0100
"Bjoern Nelius" <bjoern...@gmx.net> wrote:
| Hello Anthony,
|
| thanks for your detailed answer. I've understood, that the script has to wait, till the Nautilus-window appears, but I don't know how to achieve this, since I'm not a programmer.
|
| I looked at your script, but I finally have no Idea, how it works.
|
| Could you please help me - how should the script look like in my case?
|
| Thanks in advance
|
| B. Nelius
|
| -------- Original-Nachricht --------
| > Datum: Thu, 11 Nov 2010 11:30:09 +1000
| > Von: Anthony Thyssen <A.Th...@griffith.edu.au>
| > An: bjoern...@gmx.net
| > CC: xdotoo...@googlegroups.com
| > Betreff: Re: [xdotool-users] ref.: xdotool (starting Nautilus in split-view)