dispvm-prerun.sh 918 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. apps="evince /usr/libexec/evinced soffice firefox"
  3. #If user have customized DispVM settings, use its home instead of default dotfiles
  4. if [ -e /rw/home/user/.qubes-dispvm-customized ]; then
  5. cp -af /rw/home/user /home/
  6. else
  7. cat /etc/dispvm-dotfiles.tbz | tar -xjf- --overwrite -C /home/user --owner user 2>&1 >/tmp/dispvm-dotfiles-errors.log
  8. fi
  9. for app in $apps ; do
  10. echo "Launching: $app..."
  11. $app >>/tmp/dispvm_prerun_errors.log 2>&1 &
  12. done
  13. echo "Sleeping..."
  14. PREV_IO=0
  15. while true; do
  16. IO=`vmstat -D | awk '/read|write/ {IOs+=$1} END {print IOs}'`
  17. if [ $IO -lt $[ $PREV_IO + 50 ] ]; then
  18. break;
  19. fi
  20. PREV_IO=$IO
  21. sleep 1
  22. done
  23. ps ax > /tmp/dispvm-prerun-proclist.log
  24. if [ -e /rw/home/user/.qubes-dispvm-customized ]; then
  25. cp -af /rw/home/user /home/
  26. else
  27. cat /etc/dispvm-dotfiles.tbz | tar -xjf- --overwrite -C /home/user --owner user 2>&1 >>/tmp/dispvm-dotfiles-errors.log
  28. fi
  29. echo done.