Acquired a great Samsung HDMI TV/monitor that doesn't go into standby when the signal is dropped. I've acquired a Pulse Eight CEC command injector, and worked out how to turn the monitor off/on from the command line.
The problem is that I don't know where the most reliable/future proof/Ubuntu/Gnome way of causing those commands to execute is - What I've looked into so far:
systemd
Seems to have targets for when a user is logged in, and for when the graphical system comes up, but not before the login.
acpid
Catching the screen sleep/wake mechanism here sounds perfect, but I can't seem to find a way to do it.
gdm3
Seems to support adding scripts in just about every case OTHER than on keyboard activity.
xss-lock
Tried using this with a script to sleep the monitor when it runs, and catch the SIGHUP to issue a wake command - but it didn't seem to work reliably.
I found this from 2015: How to run scripts on screen sleep / wake
... but just about every option above feels like a better solution than looping a background task to scrape log traffic constantly or takes @wait/2 seconds to come up after a key is pressed. Is that the best solution available?