Re: [dev] Focusing on windows by name
Patrick Haller a écrit :
> On 2011-10-26 11:48, Manolo Martínez wrote:
> >
> > In openbox I have a key bound to the following:"wmctrl -xa mutt ||
> > urxvt -name mutt -e mutt"
>
> xlsclients | grep -q mutt || urxvt -e mutt
No, this is not equivalent because the following command:
wmctrl -xa mutt
activates the first client matching the given 'title'.
You could rather do:
#! /bin/sh
wid=$(lsw -l | grep -m 1 "$_AT_" | cut -d ' ' -f 1)
if [ -n "$wid" ]; then
xdotool windowactivate "$wid"
else
case "$_AT_" in
mutt)
urxvt -title mutt -e mutt;;
MOC)
urxvt -e mocp;;
*)
echo "don't know how to raise '$_AT_'" >&2
exit 1;;
esac
fi
Received on Wed Oct 26 2011 - 12:32:11 CEST
This archive was generated by hypermail 2.3.0
: Wed Oct 26 2011 - 12:36:04 CEST