You are not logged in.
Pages: 1
Hi, im trying to make zsh alias to kill xcompmgr before nexuiz starts, and start it again when it finishes. How to do that?
alias nexuiz="killall xcompmgr ; nexuiz-sdl-svn ; wait $PID ; xcompmgr -CfFn -D 5 &"
Something is wrong with wait command? What option should I use?
Offline
if you're using an alias, AFAIK, you could use "&&" instead of ";"
&& waits for first command to finish and goes to the next one, so "killall xcompgr && nexuiz-sdl-svn .." will kill xcompgr first, then execute nexuiz-sdl-svn, etc
i think this will work, unless i read your post wrong
Last edited by milomouse (2010-03-08 14:56:27)
Offline
No, the difference between ; and && is that && only goes on if the preceding commands succeeds (exit code 0).
Unless your setup somehow automatically manages the $PID environment variable, it's probably empty, and will expand to nothing, and the wait command will have the same effect as running 'wait' without arguments. From what I can tell from the man page, if 'wait' is invoked with no arguments, it will wait until all process IDs known to the invoking shell have terminated, which is not what you want.
Offline
Launch nex into another display instead of screwing with the current one.
[git] | [AURpkgs] | [arch-games]
Offline
alias nexuiz="killall xcompmgr; nexuiz-sdl-svn && xcompmgr -CfFn -D 5 &"
The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...
Offline
alias nexuiz="killall xcompmgr; nexuiz-sdl-svn && xcompmgr -CfFn -D 5 &"
Ty, that does it.
Offline
Yes, but that will only start xcompmgr again if nexuiz exits successfully, not if it crashes. Use ;
Last edited by JohannesSM64 (2010-03-09 04:25:57)
Offline
Not an answer, but why not just create a launcher script and put it somewhere in your path? Or even, make it a function in your ~/.bashrc
Offline
Pages: 1