Open jarrard opened 6 years ago
To help, I'm suspecting isActivWinFullscreen can be replaced with just isActivWin?¿ BUT I don't know if that passes sanity check as I'm no coder and simply taking a guess. Input needed. Cheers
The thing is: how do you recognize if a video is playing? This script just uses the fact that while you are playing a video in fullscreen you most likely don't want the screensaver to activate. That's an easy thing to check! E.g. if Firefox runs in fullscreen, we assume you are watching a video and thus delay the screensaver activation. But with normal window videos it is different. How do you detect if a non-fullscreen window is displaying a video and thus you need to delay the screensaver? That's hard! You have to check the window content for changes for example. That's why this script focuses on fullscreen only.
The script from what I understand detects HTML5 and Flash playback, not just if a window is in fullscreen. Unless I read it wrong, perhaps I have. Which begs the question why such a large script to just check for windows in fullscreen mode.
Anyway if there is no way to turn off xscreensaver when a web browser is playing audio/video then i guess we can't do much. Another option was to check if audio was being played and then stop screensaver in that instance but I am looking into that further.
That would include things like Spotify in Webbrowser or 8tracks and such. Where you might not want the screensaver to delay. It might be more interesting to see if you can choose the screensaver delay based on certain webpages like YouTube. But as far as I know this script uses only the detection via xorg, which has no information on that. But if you can query Firefox if a webpage is opened that might work...(all of that is just my opinion, if you find a clever way to detect the playback of a video in any window that would be great!)
Another option is to just check if Youtube is in the Window Title, for example. Doesn't detect if playing but at least will detect if your got youtube opened up on a tab.
something that finds any selection of text in an array within a windows title bar would be a start.
DisableSaverText = [Youtube,video,netflix]
DisableSaverText in WinTitle then disable xscreensaver for X long... something like that, I could probably figure out howto do that on my own with a bit of time.
Go for it. It would be a nice feature but keep in mind that this should be opt-out'able (or maybe opt-in'able) since not everyone wants this behavior for their screensaver delay script.
Yeah if I can figured it out then I will just add it as a option like the rest (xx == 1/0)
I never watch youtube in FULLSCREEN because I multitask allot and do other things while videos play in background, so why is this script 100% fixed to only activate on fullscreen events?
I was trying to adapt it to VIVALDI browser, with no luck, then I realized lots of fullscreen mentions so figured that's why it wasn't working.
It would be nice if I was a coding master and could adapt it to normal window checking and not just fullscreen but I am not. Any help appreciated.
lightsOn.zip