Independent display controller based on PIR sensor.

This is not really a module for the MagicMirror application itself, but I wrote it for my own mirror and I want to share it, if anybody has use for it.

I wanted a turn-off-my-display-control that is independent from the MagicMirror application. It turns off the display after a given countdown time from the last time a motion was detected by a PIR sensor.
So every time a motion is recognized, the countdown is set to the maximum countdown time. When no motion is noticed for that time, the display is set to sleep. When then a motion is detected, the display is turned on.

I also provide a systemd service file, if you want to use it as a service.

@Beh i see thx! maybe it’s better to use your one to somehow bypass these settings which are a bit frustrating. i did’t really get the systemd option (i am new) but as i understood it’s like a crontab, correct?