#!/bin/zsh -- # raise a program's window if it's already running, otherwise start it. # syntax as per 'xstartup', see there for details. # requires 'xstartup' and 'raise' scripts, which in turn require # wmctrl binary. # raise_or_start |- [-F] # 2007/05/07 Azundris init PATH=".:$PATH" if [ $# -lt 4 ] then echo "$0 |- [-F] " echo "see 'xstartup' for specific parameters." exit 1 fi if [[ "x$3" = "-F" ]] then raise --desk $1 --exact $4 else raise --desk $1 $3 fi if [ $? -eq 1 ] then echo "that didn't work, starting instance, then ..." xstartup $* exit $? fi exit 0