2013/12/5 James Griffin <j...@kontrol.kode5.net>: > I've got a load of functions defined in my configuration file using > DestroyFunc/AddToFunc. What I would like to know, is how can use these > functions to test if the application in question is already running? In > particular, I have an FvwmButtons instance that starts a panel - I wouldn't > want more than one instance of this panel running. > > Any help would be appreciated. > > Cheers, Jamie. >
Try this: DestroyFunc StartOnce AddToFunc StartOnce + I PipeRead 'if [ `ps -ef |grep -v grep |grep -c "$0"` -lt 1 ]; then \ echo Exec $0; \ fi' The only thing is that you've got to set the command in quotes: StartOnce "xterm -fg black -bg snow2 -g 80x40 -fn 7x14" Best, Thomas