How to start an app by a terminal and to keep it running, when closing the terminal?

Ralf Mardorf ralf.mardorf at alice-dsl.net
Tue May 20 21:30:46 UTC 2014


Why is evolution launched, while "evowrap --force-shutdown" and "evoterm --force-shutdown" are running?

case $1 in
  JWM) evoterm --force-shutdown
       while ps aux | grep "evowrap --force-shutdown" | grep -v grep ; do sleep 1 ; done
       while ps aux | grep "evoterm --force-shutdown" | grep -v grep ; do sleep 1 ; done
       evolution
       exit;;
esac

The complete chain is

$ grep force ~/.jwmrc
      <Program label="Evo force shutdown"> evowrap JWM </Program>

IOW "evowrap JWM" to launch the below scripts:

$ cat /usr/local/bin/evoterm
#!/bin/sh

roxterm --maximize -T "evolution $*" -e evowrap $*

exit

$ cat /usr/local/bin/evowrap
#!/bin/sh

case $1 in
  JWM) evoterm --force-shutdown
       while ps aux | grep "evowrap --force-shutdown" | grep -v grep ; do sleep 1 ; done
       while ps aux | grep "evoterm --force-shutdown" | grep -v grep ; do sleep 1 ; done
       evolution
       exit;;
esac

echo "Launch: evolution $@"
printf "Cancel? [c] "
read pushed_key

case $pushed_key in c) exit;; esac
evolution $@

echo
printf "Push enter to close terminal emulation? "
read pushed_key

exit




More information about the D-community-offtopic mailing list