Re: [dev] xid of a current window

From: Ivan Kanakarakis <ivan.kanak_AT_gmail.com>
Date: Sun, 25 Mar 2012 15:20:45 +0300

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 <cls_AT_lubutu.com> wrote:
> On 25 March 2012 12:42, Anselm R Garbe <garbeam_AT_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 *
Received on Sun Mar 25 2012 - 14:20:45 CEST

This archive was generated by hypermail 2.3.0 : Sun Mar 25 2012 - 14:24:03 CEST