dispvm-prerun.sh 822 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. apps="/usr/libexec/evinced"
  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 2
  22. done
  23. ps aufwwx > /tmp/dispvm-prerun-proclist.log
  24. echo "Closing windows..."
  25. /usr/lib/qubes/close-window `xwininfo -root -children|tail -n +7 |awk '{print $1}'`
  26. sleep 1
  27. fuser -vkm /rw
  28. echo done.