runSlicer.sh 502 B

123456789101112131415161718192021
  1. #!/bin/bash
  2. . `dirname $0`/env.sh
  3. #sometimes, particular for users only used through su, /run/user/XXXX is not created
  4. #to solve, run as sudoer
  5. #sudo loginctl enable-linger <USERNAME>
  6. export DISPLAY=:$DISPLAYID
  7. TEMP=~/.xpra/temp.log
  8. #make sure xpra is running a virtual buffer at DISPLAY
  9. xpra info $DISPLAY > $TEMP || xpra start $DISPLAY;
  10. LOG=$HOME/logs/runSlicer.log
  11. if [ $# -gt 2 ] ; then
  12. LOG=$3/runSlicer.log;
  13. fi;
  14. nohup $SLICER/Slicer --no-main-window --python-script $1 $2 0<&- &> $LOG &