if you don't want to write something of your own, then $ xprop -root _NET_ACTIVE_WINDOW > _NET_ACTIVE_WINDOW(WINDOW): window id # 0x400050
or $ xdotool getactivewindow > 4194384 will work, as long as your wm supports and correctly sets _NET_ACTIVE_WINDOW note that xdotool outputs the id as an int, to get the same with xprop do something like: $ xprop -root _NET_ACTIVE_WINDOW | cut -d# -f2 | xargs printf "%d\n" > 4194384 some apps work with both formats, others require int xwininfo can also give you the window id, and with -int it will be in int form. On 25/03/2012, Connor Lane Smith <c...@lubutu.com> wrote: > On 25 March 2012 12:42, Anselm R Garbe <garb...@gmail.com> wrote: >> http://tronche.com/gui/x/xlib/input/XGetInputFocus.html > > Note that a Window is an integer, specifically the window's XID. > > cls > > -- *Ivan c00kiemon5ter V Kanakarakis *