I am trying to create a script to use a movie as ScreenSaver, but once the movie is opened, the system freezes and reboots.
I have been pulling hairs off of my head because I cannot figure out why this happens. I tried the same script in another machine and it worked perfectly for many months...
The machine it worked on was a Linux Mint 13 machine and the one it didn't work on was a Linux Mint 17 machine.
The script is the following:
#!/bin/bash
screen_on=false;
state=0;
time_idle=1200;
while true;do
IDLE=$(./idletime)
if [ $IDLE -gt $time_idle ];then
if [ $(pidof mplayer) ];then
echo "Screen is on " >> mylog.log
else
./test.sh &
fi
else
if [ $(pidof mplayer) ];then
pkill mplayer
else
echo "Screen is off." >> mylog.log
fi
fi
done
The idletime program is actually the same as xprintidle... It uses the X Server to get the system's idle time. The test.sh script is as follows:
#!/bin/bash
mplayer -nostop-xscreensaver movie.mp4 -fs -loop 0
Thank you!