XFCE display power management - Detecting video on youtube, etc

What happens is, sometimes it works as intended. I am playing a video on firefox->youtube and the screen won’t go off. Maybe I pause the video, go away and the screen turns off after 10min. All fine.

Buut. Sometimes it doesn’t and when I come back, the screen hasn’t gone off for hours. This is terrible for many reasons, but most important my monitor bulb life. Sometimes I close every program and still it won’t turn off.

So my question isn’t how do I fix this (although…). My question is: How do I debug this.

I want a “watch” command in a terminal that tells me when XFCE, or X11 thinks a video is playing.

99% of the time I’m using firefox, or mpv.

inxi -Fxxxzam --no-host

xset q