#!/bin/bash screenOffLockFile=/tmp/screen-off-lock DISPLAY=:0.0 if [ -f $screenOffLockFile ]; then rm $screenOffLockFile && ssh glitchd@192.168.1.19 xscreensaver-command -deactivate notify-send "Screen on." -i /usr/share/icons/gnome/48x48/devices/display.png else touch $screenOffLockFile sleep .5 while [ -f $screenOffLockFile ] do xset dpms force off && ssh glitchd@192.168.1.19 nohup xscreensaver-command -activate sleep 2 done xset dpms force on fi