Bind xdotool commands to function key

719 views
Skip to first unread message

Bill Purcell

unread,
Mar 5, 2010, 6:32:33 AM3/5/10
to xdotoo...@googlegroups.com
I am trying to bind a script to F8. Here is the script

=========================f8.sh======================
WID=$(xdotool getwindowfocus -f)
xdotool windowactivate $WID
xdotool windowfocus $WID
xdotool key Escape
xdotool type [8
echo "hello there"
echo $WID > 1234.txt
=====================================================

The echo statements at the end are just to see if it's working.

I bound F8 to gnome-terminal and a terminal opened so I know that the
actual key binding is working.

When I bind F8 to /home/william/bin/f8.sh, nothing happend. The
1234.txt is not created and there is nothing typed or keyed by
xdotool. Doing bash f8.sh does exactly what I want, so I don't see
why things aren't working.

Any thoughts?

Regards,
Bill

Jordan Sissel

unread,
Mar 5, 2010, 6:22:26 PM3/5/10
to xdotoo...@googlegroups.com
Sorry about the troubles :)

I'm pretty sure this an instance of this bug (which is now fixed in latest release):

If not, what version are you using?

-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.


Bill Purcell

unread,
Mar 6, 2010, 11:13:33 AM3/6/10
to xdotoo...@googlegroups.com
At Fri, 5 Mar 2010 15:22:26 -0800,

I'm actually not sure what version I'm using. I downloaded
xdotool_20090330-1_i386.deb and installed it but I don't see a version
command line flag to give me the version.

Bill

Jordan Sissel

unread,
Mar 10, 2010, 10:10:29 PM3/10/10
to xdotoo...@googlegroups.com
20090330 is probably the version, though, though that version shouldn't have the bug you describe. There should be a newer version of xdotool available in debian by now, I think.

-Jordan

Daniel Kahn Gillmor

unread,
Mar 10, 2010, 11:13:34 PM3/10/10
to xdotoo...@googlegroups.com
On 03/10/2010 10:10 PM, Jordan Sissel wrote:
> 20090330 is probably the version, though, though that version shouldn't have
> the bug you describe. There should be a newer version of xdotool available
> in debian by now, I think.

20090330 is in testing right now, mainly because of some difficulties
we're having building on hurd-i386, it looks like:

https://buildd.debian.org/pkg.cgi?pkg=xdotool

i'll see what i can do to coax the build on hurd to complete (or maybe
report problems with it) so that the new package migrates, finally.

At any rate, if you want a recent version, you should try grabbing the
.deb from unstable.

If people are interested, i can also backport the new version once it
hits testing.

--dkg

signature.asc

Bill Purcell

unread,
Mar 12, 2010, 8:44:33 AM3/12/10
to xdotoo...@googlegroups.com
How do I make sure I get the latest version ...

I am running ubuntu 9.04. I added the following line to my sources.list

deb http://ftp.de.debian.org/debian sid main

Then apt-get update and then apt-get install xdotool. I think I
should have the latest version now right?

I ask because I am still having trouble with binding my script to a
keyboard shortcut.

=========================f8.sh======================
WID=$(xdotool getwindowfocus -f)
xdotool windowactivate $WID
xdotool windowfocus $WID
xdotool key Escape
xdotool type [8

=====================================================

Jordan Sissel

unread,
Mar 12, 2010, 4:01:12 PM3/12/10
to xdotoo...@googlegroups.com
On Fri, Mar 12, 2010 at 5:44 AM, Bill Purcell <fly...@gmail.com> wrote:
How do I make sure I get the latest version ...

I am running ubuntu 9.04.  I added the following line to my sources.list

 deb http://ftp.de.debian.org/debian sid main

Then apt-get update and then apt-get install xdotool.  I think I
should have the latest version now right?

I ask because I am still having trouble with binding my script to a
keyboard shortcut.

I'm on Ubuntu 9.04, and the latest xdotool I see is 20080720-1, though you may be using different sources than I. You can get the version installed by apt/dpkg by using 'dpkg -l xdotool'

20080720 doesn't have 'xdotool getwindowfocus -f' (no -f flag).

If you're using a recent version (like 1.20100227 or 1.20100301), these have the run-from-script problems. The latest version (not yet published in debian packages, I think) fixes this.

-Jordan


Reply all
Reply to author
Forward
0 new messages