[Xmonad] Some questions
Sébastien Gross
seb-xmonad at chezwam.org
Fri Aug 10 21:48:17 EDT 2007
On Thu, Aug 09, 2007 at 05:33:44PM +0200, seb-xmonad at chezwam.org wrote:
> - I do use Konsole as console and under ion I wrote a handy tool to ssh
> from my desktop to an other server throught jumphosts:
> konsole_kicker "ssh -t jump1 ssh -t jump2 ssh -t desthost; exit;" \
> "desthost" <pid>
> in fact konsole_kicker uses dcop to display the command string inside
> a new tab in the current console.
> The question is is it possible to get the pid of the current window
> and how?
I found xdotool (http://www.semicomplete.com/projects/xdotool) that
helps me to do what I want.
For the ones that might interest, the lua code is replaced by:
--8<--
xid=$(xdotool getwindowfocus)
if ! xprop -id ${xid} | grep '^WM_NAME(STRING) = ".* - Konsole"$' >
/dev/null; then
pid=''
else
pid=$(xprop -id ${xid} | grep PID | awk '{print $NF}')
fi
--8<--
--
Sébastien Gross
More information about the Xmonad
mailing list