#!/bin/sh
#- exit cleanly on SIGUSR1, so that our init can see a clean shutdown and automatically reboot
reboot () {
exit 0
}
trap 'reboot' SIGUSR1
while true; do
wait4x || exit 1
xwait -permanent &
xdim=`xdpyinfo | perl -ne 'print $1 if /dimensions:\s*(\d+)/'`
qiv --root /image/move/BOOT-$xdim-MOVE.jpg
startkde
sudo killall X
done