#!/bin/bash
echo 'xset status' > xset_out.txt 2>&1
xset -q | grep -A1 DPMS >> xset_out.txt  2>&1
xset -q | grep -A2 Screen >> xset_out.txt  2>&1

#echo -e '\n\n################\nsetting dpms on\n################' >> xset_out.txt 2>&1
#xset +dpms >> xset_out.txt 2>&1
#echo 'xset status' >> xset_out.txt 2>&1
#xset -q | grep -A1 DPMS >> xset_out.txt  2>&1
#xset -q | grep -A2 Screen >> xset_out.txt  2>&1

#echo -e '\n\n################\nsetting dpms off\n################' >> xset_out.txt 2>&1
#xset -dpms >> xset_out.txt 2>&1
#echo 'xset status' >> xset_out.txt 2>&1
#xset -q | grep -A1 DPMS >> xset_out.txt  2>&1
#xset -q | grep -A2 Screen >> xset_out.txt  2>&1

echo -e '\n\n################\nset screensaver noblank\n################' >> xset_out.txt  2>&1
xset s noblank >> xset_out.txt 2>&1
echo 'xset status' >> xset_out.txt 2>&1
xset -q | grep -A1 DPMS >> xset_out.txt  2>&1
xset -q | grep -A2 Screen >> xset_out.txt  2>&1

#echo -e '\n\n################\nshutting screensaver off\n################' >> xset_out.txt  2>&1
#xset s off >> xset_out.txt 2>&1
#echo 'xset status' >> xset_out.txt 2>&1
#xset -q | grep -A1 DPMS >> xset_out.txt  2>&1
#xset -q | grep -A2 Screen >> xset_out.txt  2>&1

echo -e '\n\n################\nshutting off monitor\n################' >> xset_out.txt 2>&1
xset dpms force off >> xset_out.txt 2>&1
echo 'xset status' >> xset_out.txt 2>&1
xset -q | grep -A1 DPMS >> xset_out.txt  2>&1
xset -q | grep -A2 Screen >> xset_out.txt  2>&1

echo -e '\n\n################\nsleeping for 3 seconds\n################' >> xset_out.txt 2>&1
sleep 3s

echo -e '\n\n################\nreseting screensaver\n################' >> xset_out.txt  2>&1
xset s reset >> xset_out.txt 2>&1
echo 'xset status' >> xset_out.txt 2>&1
xset -q | grep -A1 DPMS >> xset_out.txt  2>&1
xset -q | grep -A2 Screen >> xset_out.txt  2>&1

echo -e '\n\n################\nset screensaver blank\n################' >> xset_out.txt  2>&1
xset s blank >> xset_out.txt 2>&1
echo 'xset status' >> xset_out.txt 2>&1
xset -q | grep -A1 DPMS >> xset_out.txt  2>&1
xset -q | grep -A2 Screen >> xset_out.txt  2>&1

echo -e '\n\n################\nshutting off monitor\n################' >> xset_out.txt 2>&1
xset dpms force off >> xset_out.txt 2>&1
echo 'xset status' >> xset_out.txt 2>&1
xset -q | grep -A1 DPMS >> xset_out.txt  2>&1
xset -q | grep -A2 Screen >> xset_out.txt  2>&1

echo -e '\n\n################\nsleeping for 3 seconds\n################' >> xset_out.txt 2>&1
sleep 3s









echo -e '\n\n################\n\activating screensaver on\n################' >> xset_out.txt  2>&1
xset s activate >> xset_out.txt 2>&1
echo 'xset status' >> xset_out.txt 2>&1
xset -q | grep -A1 DPMS >> xset_out.txt  2>&1
xset -q | grep -A2 Screen >> xset_out.txt  2>&1

#echo -e '\n\n################\nshutting screensaver on\n################' >> xset_out.txt  2>&1
#xset s on >> xset_out.txt 2>&1
#echo 'xset status' >> xset_out.txt 2>&1
#xset -q | grep -A1 DPMS >> xset_out.txt  2>&1
#xset -q | grep -A2 Screen >> xset_out.txt  2>&1

#echo -e '\n\n################\nset screensaver noblank\n################' >> xset_out.txt  2>&1
#xset s noblank >> xset_out.txt 2>&1
#echo 'xset status' >> xset_out.txt 2>&1
#xset -q | grep -A1 DPMS >> xset_out.txt  2>&1
#xset -q | grep -A2 Screen >> xset_out.txt  2>&1

#echo -e '\n\n################\nturning monitor back on\n################' >> xset_out.txt 2>&1
#xset dpms force on >> xset_out.txt
#echo 'xset status' >> xset_out.txt 2>&1
#xset -q | grep -A1 DPMS >> xset_out.txt  2>&1
#xset -q | grep -A2 Screen >> xset_out.txt  2>&1

#echo -e '\n\n################\nsleeping for 3 seconds\n################' >> xset_out.txt 2>&1
#sleep 3s

#echo -e '\n\n################\nreseting screensaver\n################' >> xset_out.txt  2>&1
#xset s reset >> xset_out.txt 2>&1
#echo 'xset status' >> xset_out.txt 2>&1
#xset -q | grep -A1 DPMS >> xset_out.txt  2>&1
#xset -q | grep -A2 Screen >> xset_out.txt  2>&1

