#!/bin/bash
wid=`xdpyinfo | sed -ne 's/^focus:.*\(0x[^,]\+\).*/\1/p'`
proc=$(ps hco command --pid $(
pid=`xprop -id $wid |grep _NET_WM_PID | awk '{printf $3 "\n"}';`
if [ -z $pid ]; then
wid2=`xwininfo -children -id $wid 2>/dev/null|grep Parent\ window\ id | awk '{printf $4 "\n"}';`
pid=`xprop -id $wid2 2>/dev/null |grep _NET_WM_PID | awk '{printf $3 "\n"}';`
if [ -z $pid ]; then echo 1;exit 0;fi
fi
echo $pid
))
if [[ z$proc == "zinit" ]];then
xprop -id $wid |grep WM_CLASS\(STRING\)| awk '{printf $3 $4"\n"}'
else
echo $proc
fi
2009-05-02
Подписаться на:
Сообщения (Atom)