Sunday, February 15, 2009

Useful way to pass the time

Got bored, have never found something like xkill that I can just say, "xkill somewindowname". Found xwininfo last week, thought about this hehe:

#!/bin/sh
#
# kill X client by window name
#

if [ -n "$1" ]; then
    xwininfo -name "$1" | grep 'Window id:' | awk '{ print $4 }' | \
    head -n 1 | xargs xkill -id 
else
    echo "usage: `basename $0` windowname"
fi


xkillname xconsole and poof - the xconsole window is killed, hehe.

No comments:

Post a Comment