Current Situation
I'm suspending my laptop after a 30 minutes of idle state. I'm using this code inside this script to detect the idle duration.
Original Problem
VLC (and I'm pretty sure that any other video player that prevents screen saver from running) sends a periodic signal (on every 30 seconds) to disturb the mouse/keyboard events, so screen saver (thus my code) thinks that "end of idle time is reached" and never runs the desired command until VLC finishes playing the video playlist.
Introduced Problem
I worked around it by ignoring any small user input by keeping track of an offset
. If the disturbance is very short, I just add up the previous measurement to the offset
variable, so, the main problem is gone. However, I've also disabled the "suppress the screensaver while watching video" feature of VLC. Now I want to add this feature back.
Question
How can I detect if VLC is playing a full screen video (or more preferably, any "full screen video state" from any player) so I could disable "my screensaver" only when an application/VLC is in full screen mode?
xdotool search -class XTerm getwindowgeometry
you will see the output of the geometry of only one single window. – Quasímodo Aug 22 '20 at 18:06