Hi there,
On Wed, 29 Mar 2017,
der...@derrickisonline.com wrote:
> Same here, any luck or updates on this? I know this thread is old but
> hoping someone figured it out.
>
> On Wednesday, September 21, 2016 at 1:38:08 AM UTC-4, Douglas Banker wrote:
> > ...
> > bash script that sleeps just for 20 seconds to let chromium-browser load
> > but when I add the line watch -n 10 'xdotool search --onlyvisible --class
> > "chromium" windowfocus; xdotool key ctrl+Tab' it doesn't work. I've tried
> > a lot of different combinations but have not found one to work yet. Any
> > thoughts??
I'm in no way an xdotool expert. I only really used xdotool once, a
few years ago, for a customer who has an old Microsoft keyboard which
he wanted to carry on using although it had been unsupported for many
years. I've remained on the list because it's always been possible
that I will need to use xdotool again - and it's a low volume list. :)
So I'm answering from a very general perspective. On the plus side, I
have been using and coding on Unix-based systems since the 1970s.
Several things come immediately to mind.
1. Bash (etc.) scripts are often run in an environment which differs
from the one which the developer uses while he's developing it. Those
new to scripting on a Unix-based OS often fall foul of this issue. At
its simplest, this means that when an executable is called from the
script, you might need to give the full path to the executable instead
of the bare executable name; in this case perhaps '/usr/bin/watch' and
'/usr/local/bin/xdotool' instead of 'watch' and 'xdotool'. The paths
maight not be the same on your system, it depends on how the packages
were installed. There may be other important considerations, such as
the terminal capabilities to be expected. You might even need to set
up the script's environment so that it mirrors fairly closely the one
you usually have in your login session.
2. If you focus on a single solution to your problem (even assuming
that you've properly identified the problem) you might ignore a whole
bunch of other possible solutions. For example I came across xdotool
after trying half a dozen similar utilities, all of which had their
own distinct set of failings, quirks and gotchas. In some cases I
tried more than a dozen different ways of attacking the problem (in my
case it was to get some proprietary buttons on the keyboard to emulate
other key combinations - different combinations for each button). In
the present case, the CTRL+TAB key combination may be one of many ways
of achieving the desired result, and even if the alternatives do not
"work" they might with sufficient perspiration allow another coin to
be shaken out of the piggy bank of clues which lead to a solution. It
took me two weeks to get three buttons on that accursed Microsoft
keyboard to do what the customer wanted - cut and paste in Paintshop,
running on a Windows 7 VM - but the customer is still a customer. :)
3. Mr. Banker says only "it doesn't work". This is a very common and
almost universally useless problem description. The precise way in
which it doesn't work is a very important clue to finding out what is
happening. Does the executable even run? If it runs, does it produce
any debugging/logging/output of any kind at all? If not, what can be
done to create some of that stuff?
4. Mr. Banker said he tried "a lot of different combinations". But he
has *not* said what they were, so we don't even know what direction(s)
he's been going in, never mind how far along the path(s) he got. As a
purely mailing-list-support consideration, this isn't very helpful to
the people who might be trying to help. And "same here" doesn't add a
whole lot to the sum of human knowledge. :(
Finally, my notes tell me that the tool that I eventually used to get
my customer's keyboard doing what he wanted it to do was not xdotool.
It was evrouter. It was five years ago, I'd forgotten.
Keep notes. If that's the only thing you take away from this message,
it was worth the trouble of writing it.
HTH
--
73,
Ged.