[ale] X window to foreground

Brian Pitts brian at polibyte.com
Sat Dec 29 05:02:02 EST 2007


Jim Popovitch wrote:
> One thing that bugs the fsck out of me is that Evolution can be launched
> multiple times from a menu or panel icon.   This may seem trivial to
> some ;-) but I wind up launching a second instance of Evo more times
> than I care to. :-)   To that end....
> 
> I am looking for a cheap way to take the pid of a running process and
> bring it to the foreground of the current display window.  Ideas?
> 

ACTIVEWINDOWID=$(xprop -root _NET_ACTIVE_WINDOW | awk '{print $5}')

should get the active window

ACTIVEWINDOWPID=$(xprop -id $ACTIVEWINDOWID _NET_WM_PID | awk '{print $3}')

should get the pid associated with the window.

ACTIVEWINDOWCLASS=$(xprop -id $ACTIVEWINDOWID WM_CLASS | awk '{print $3}')

should get the name of the binary associated with the window.

I'm afraid this doesn't get you much closer to an answer. I don't know 
how to programmatically change which window is active.

-Brian



More information about the Ale mailing list