photo
Jordan Sissel
geek

Sat, 14 Jun 2008

keynav shell command examples

Press 'f' when keynav is active and instantly jump to my firefox window.
# in .keynavrc
f sh "activate-firefox.sh", end
Now, in activate-firefox.sh:
#!/bin/sh
# activate-firefox.sh
xdotool windowactivate $(xdotool search -title -- '- Mozilla Firefox')
Extend that and press 'g' to jump to gmail, assuming that tab is open. (Requires my firefox tabsearch plugin)
# in .keynavrc
g sh "activate-gmail.sh"
Now, in activate-gmail.sh:
#!/bin/sh
# activate-gmail.sh

./activate-firefox.sh
xdotool key ctrl+apostrophe
xdotool type gmail
xdotool key Return

Comments: 0 (view comments)
Tags: , , ,
Permalink: /geekery/keynav-shell-examples
posted at: 06:23

Fri, 06 Jun 2008

new xdotool version available (20080606)

Hop on over to the xdotool project page and download the new version.

I've also put up an HTML version of the manpage: xdotool.xhtml.

The changelist from the previous announced release is as follows:

20080606:
  * Correctly report an error if xdotool is invoked with an invalid command.
  * Fix invalid error code reporting from 'windowraise'

Comments: 0 (view comments)
Tags: , ,
Permalink: /geekery/xdotool-20080606
posted at: 03:42

Tue, 03 Jun 2008

new xdotool version available (20080603)

Hop on over to the xdotool project page and download the new version.

The changelist from the previous announced release is as follows:

20080603:
  * Daniel Kahn Gillmor reported a problem with return codes from xdotool. All
    commands return proper exit status now (0 == success, nonzero == error)
  * I tested on 3 window managers: Gnome2 2.20.0, OpenBox 3.4, ion-3rc-20070608
    - Gnome2 and OpenBox pass all tests.
    - ion-3 fails on any desktop-related methods (ion-3 lacks the support).

Comments: 0 (view comments)
Tags: , ,
Permalink: /geekery/xdotool-20080603
posted at: 05:10

Sun, 01 Jun 2008

new xdotool version available (20080601)

Hop on over to the xdotool project page and download the new version.

The changelist from the previous announced release is as follows:

20080601:
  * Add new commands:
    - windowactivate: Activate a window. If the window is on another desktop, we
        will switch to that desktop and then activate the window.
    - set_num_desktops number: Changes the number of desktops or workspaces.
    - get_num_desktops: Output the current number of desktops.
    - set_desktop desktop_number: Change the current view to the specified
        desktop.
    - get_desktop: Output the current desktop in view.
    - set_desktop_for_window window_id desktop_number: Move a window to a
        different desktop.
    - get_desktop_for_window window_id: Output the desktop currently containing
        the given window.

    windowactivate tested and confirmed working in: ion-3 and Gnome2 (metacity)
    The rest of the new commands have only been tested in Gnome2. They do not
    work in ion-3 due to lacking support for EWMH in ion.
  * Rewrote the man page in perlpod format.

Comments: 0 (view comments)
Tags: , ,
Permalink: /geekery/xdotool-20080601
posted at: 04:50

Sat, 31 May 2008

xdotool desktop features

I spent a while tonight reading up on extended window manager hints. It's not a very well thought-through standard, but many window managers implement it nonetheless.

Tonight I added 7 new commands to xdotool (not yet in a release):

  • get and set the number of desktops
  • get and set the currently active desktop
  • get and set the desktop for a specific window (set == move it to a new desktop)
  • activate a window
The first 3 should be pretty straight forward. For fun, I told Gnome2 to create 50 workspaces, and it didn't barf. The taskbar pager looked a little funny as it was sprawling with little desktop views, but it works :)

The last is window activation. It will jump you to the window and give it focus. If the window is on a different desktop, it jumps to that desktop and then activates the window. I've tested exactly that behavior (firefox lives on a separate desktop or workspace) in Gnome2 and ion-3, and it works.

Example: Jump to firefox:

./xdotool windowactivate $(./xdotool search -title "Mozilla Firefox")
Example: Trying to do bad things in Gnome2
% ./xdotool set_num_desktops 5000
% ./xdotool get_num_desktops
36
Example: Move firefox to another desktop
# Find firefox's X Window ID
% MOZWIN=$(./xdotool search --title "Mozilla Firefox")

# Find the desktop containing firefox.
% ./xdotool get_desktop_for_window $MOZWIN
0

# How many desktops do we have?
% ./xdotool get_num_desktops
5

# Move firefox to desktop 3 (index starts at 0)
% ./xdotool set_desktop_for_window $MOZWIN 3

# Show me that firefox has moved to desktop 3
% ./xdotool get_desktop_for_window $MOZWIN
3

# Show me the current desktop
% ./xdotool get_desktop
0

# Activate firefox's window (taking us to Firefox's desktop)
% ./xdotool windowactivate $MOZWIN

# Show that we're now on the same desktop as firefox
% ./xdotool get_desktop
3
I'll put out a new release after I have a chance to tidy up the code a bit.

Comments: 0 (view comments)
Tags: , , ,
Permalink: /geekery/xdotool-desktop-manipulation
posted at: 06:55

Wed, 21 May 2008

new xdotool version available (20080521)

Hop on over to the xdotool project page and download the new version. This is the first version being served totally from googlecode, let me know if you have problems.

The changelist from the previous announced release is as follows:

20080521:
  * Import patches from keynav's xdotool branch (From Lukas Mai) which make
    xdotool compile happily when building with -Wall and -pedantic (and others)
  * Finally convert to using Window type for (hopefully) everything instead of
    incorrectly typecasting Window to int sometimes.
  * Confirmed that the one (but mostly useless) test passes.

Comments: 0 (view comments)
Tags: , , ,
Permalink: /geekery/xdotool-20080521
posted at: 04:27

Mon, 03 Sep 2007

new xdotool version available (20070903)

Hop on over to the xdotool project page and download the new version.

The changelist from the previous announced release is as follows:

20070903:
  * Add xdo_mousemove_relative for relative mouse movements
  * Add xdolib.sh. This is a script library to help with features xdo does not
    explicitly implement, such as querying window attributes, or fetching the
    root window id. An example which uses this is: examples/move_window_away.sh

Comments: 0 (view comments)
Tags: ,
Permalink: /geekery/xdotool-20070903
posted at: 18:27

Sun, 12 Aug 2007

new xdotool version available (20070812)

Hop on over to the xdotool project page and download the new version.

The changelist from the previous announced release is as follows:

20070812:
  * Magnus Boman contributed keysequence_{up,down} adding new commands to
    xdotool: keyup and keydown. These take the same arguments as 'key' but only
    send keyup or keydown events.
  * Lee Pumphret contributed getwindowfocus, which tells you the window id of the window
    currently holding focus.
  * Removed 'Makefile.no-pkg-config' because the original Makefile now knows
    how to build for both cases: with and without pkg-config.

20070722:
  * Compiles without warnings when using gcc -Wall now
  * Fixed false error reporting due to some functions missing return statements

Comments: 0 (view comments)
Tags: ,
Permalink: /geekery/xdotool-20070812
posted at: 19:29

Mon, 16 Jul 2007

xscreensaver hack: show your screen while locked

There are some rare cases when you need to have your screen locked, but still have the current display visible without a screensaver or blanker.

Here's a hack to do it with xscreensaver and xdotool:

#!/bin/sh
while true; do
  xdotool search --onlyvisible --name xscreensaver \
  | xargs -r -n1 sh -c 'xdotool windowsize $1 1 1' -
  sleep 3
done
Run this and lock the screen. Every 3 seconds this script will try to shrink the xscreensaver window to 1x1 pixels and reveal your desktop below it. Useful if you need it.

Comments: 0 (view comments)
Tags: , ,
Permalink: /geekery/xscreensaver-visible-screen-hack-with-xdotool
posted at: 21:40

Fri, 13 Jul 2007

new xdotool version available (20070713)

Hop on over to the xdotool project page and download the new version.

The changelist from the previous announced release is as follows:

20070713:
  * Add flag SIZE_USEHINTS to xdo_window_setsize
  * Add flag --usehints to xdotool windowsize

  Increments are used often in terminals that say "my font is 5 by 7 pixels, so
  resize by that increment". So, you can use this to set a terminal to be 80x24
  characters instead of pixels. Verified by resizing xterm and gnome-terminal.

20070712:
  Added new search options to 'xdotool search'
    --onlyvisible shows only visible windows in the results
    --title causes only the window title to be matched
    --name causes the window name to be matched
    --class causes the window class to be matched

  For information on names and classes, check out the xprop tool.
    For example, for an xterm you will see this in the xprop output:
    WM_CLASS(STRING) = "xterm", "XTerm"
  "xterm" is the name, "XTerm" is the class. Don't ask me what the differences
  are supposed to be. ;)

Comments: 0 (view comments)
Tags: ,
Permalink: /geekery/xdotool-20070713
posted at: 04:00

Search this site

Navigation

Page 1 of 2  [next]

Metadata

Home About Resume My Code (SVN)

Articles

ARP Security Dynamic DNS with DHCP OpenLDAP+Kerberos+SASL PPP over SSH SSH Security: /bin/false Week of Unix Tools Work Efficiency

Projects

fex firefox tabsearch firefox urledit grok keynav liboverride newpsm (FreeBSD) nis2ldap pam_captcha poor man's backup Solaris audio utility xboxproxy xdotool xmlpresenter xpathtool misc scripts

Presentations

Yahoo! Hack Day '06 Unix Essentials Vi/Vim Essentials

Tag Cloud

Calendar

< June 2008 >
SuMoTuWeThFrSa
1 2 3 4 5 6 7
8 91011121314
15161718192021
22232425262728
2930     

Friends

BarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler Shields

Technorati