I think [ "$foo" ] will work too. No need for -n. But yeah. Bashisms did lot of
brain damage
On 26/10/2011, at 20:09, Rob wrote:
> On 26 October 2011 14:51, Peter John Hartman
> wrote:
>> I do something similar:
>>
>> if [[ $foo != "" ]]; then
>
> [ -n "$foo" ]
>
> if you're going for POSI
On 26 October 2011 14:51, Peter John Hartman wrote:
> I do something similar:
>
> if [[ $foo != "" ]]; then
[ -n "$foo" ]
if you're going for POSIX.
I do something similar:
TMPFILE=/tmp/dwm-lastwindow
xdotool getwindowfocus > $TMPFILE
foo=$(xdotool search --class st)
if [[ $foo != "" ]]; then
xdotool windowactivate $foo
else
st -e tmux-start &
fi
--
sic dicit magister P
University of Toronto / Fordham University
Collins Hall
Manolo Martínez a écrit :
> Is using xdotool's search option slower or otherwise
> worse than this?
I can't tell.
> (btw, i'm not sure I know what lsw is)
http://tools.suckless.org/lsw
Greetings,
--
Bastien
On 10/26/11 at 12:32pm, Bastien Dejean wrote:
> 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 "$@" | cut -d ' ' -f 1)
>
>
On 10/26/11 at 05:51pm, Patrick Haller 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
>
xdotool seems to work: "xdotool search "mutt" windowactivate | urxvt -e mutt"
Manolo
--
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
On 10/26/11 at 05:51pm, Patrick Haller 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
>
Thanks, Patrick, this does half of what I want: it launches mutt only if there
is no previous mutt wi
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
Dear all,
In openbox I have a key bound to the following:"wmctrl -xa mutt ||
urxvt -name mutt -e mutt"
The idea is not to have many instances of mutt lying around -- my key raises
a "mutt" window if there is one, or launches it if there isn't. wmctrl does not
speak to dwm, if I understand it corr
10 matches
Mail list logo