Skip to content

Instantly share code, notes, and snippets.

View sinrig's full-sized avatar

Scott Inrig sinrig

View GitHub Profile
@sinrig
sinrig / monitor.py
Created March 18, 2017 22:05
Python script to turn off an HDMI-connected monitor on a Raspberry Pi
# This program monitors the screensaver and turns the monitor off
# when the screensaver blanks the screen, and back on again when
# the screensaver unblanks the screen.
import sys # for exit()
import subprocess # for command execution
# command to monitor the screensaver
MONITOR = "xscreensaver-command"
MONITOR_ARGS = [MONITOR, "-watch"]