2015-02-05 03:14:41 +01:00
|
|
|
#!/bin/sh
|
2012-07-12 14:21:44 +02:00
|
|
|
|
2015-04-11 02:43:03 +02:00
|
|
|
apps="/usr/libexec/evinced"
|
2012-07-12 14:21:44 +02:00
|
|
|
|
2012-11-12 13:44:10 +01:00
|
|
|
#If user have customized DispVM settings, use its home instead of default dotfiles
|
2015-11-12 15:30:00 +01:00
|
|
|
if [ ! -e /home/user/.qubes-dispvm-customized ]; then
|
|
|
|
if [ -e /rw/home/user/.qubes-dispvm-customized ]; then
|
|
|
|
cp -af /rw/home/user /home/
|
|
|
|
else
|
|
|
|
cat /etc/dispvm-dotfiles.tbz | tar -xjf- --overwrite -C /home/user --owner user 2>&1 >/tmp/dispvm-dotfiles-errors.log
|
|
|
|
fi
|
2012-11-12 13:44:10 +01:00
|
|
|
fi
|
2012-07-12 14:21:44 +02:00
|
|
|
|
|
|
|
for app in $apps ; do
|
|
|
|
echo "Launching: $app..."
|
|
|
|
$app >>/tmp/dispvm_prerun_errors.log 2>&1 &
|
|
|
|
done
|
|
|
|
|
|
|
|
echo "Sleeping..."
|
|
|
|
PREV_IO=0
|
|
|
|
while true; do
|
|
|
|
IO=`vmstat -D | awk '/read|write/ {IOs+=$1} END {print IOs}'`
|
2015-02-05 03:14:41 +01:00
|
|
|
if [ $IO -lt $(( $PREV_IO + 50 )) ]; then
|
2012-07-12 14:21:44 +02:00
|
|
|
break;
|
|
|
|
fi
|
|
|
|
PREV_IO=$IO
|
2015-04-11 02:43:03 +02:00
|
|
|
sleep 2
|
2012-07-12 14:21:44 +02:00
|
|
|
done
|
|
|
|
|
2015-04-11 02:43:03 +02:00
|
|
|
ps aufwwx > /tmp/dispvm-prerun-proclist.log
|
2012-07-12 14:21:44 +02:00
|
|
|
|
2014-07-04 18:49:49 +02:00
|
|
|
echo "Closing windows..."
|
|
|
|
/usr/lib/qubes/close-window `xwininfo -root -children|tail -n +7 |awk '{print $1}'`
|
|
|
|
sleep 1
|
2014-01-24 06:45:17 +01:00
|
|
|
fuser -vkm /rw
|
2014-07-04 18:49:49 +02:00
|
|
|
|
2012-07-12 14:21:44 +02:00
|
|
|
echo done.
|