[xmonad] Spawning an external process with focused window XID

wagnerdm at seas.upenn.edu wagnerdm at seas.upenn.edu
Tue Feb 5 13:58:48 CET 2013


Quoting Mina Nagy Zaki <mnzaki at gmail.com>:

> How would I go about spawning an external process with the XID of the
> focused window as an argument? I currently spawn this process and use
> xprop and click on the focused window to get its PID.

You may use
XMonad.Operations.withFocused :: (Window -> X ()) -> X ()
for this. For example:

((0, xK_Print), withFocused (\xid -> spawn ("print-screen-app " ++ show xid)))

~d



More information about the xmonad mailing list