You are not logged in.
NOTE: as of Firefox 71 (perhaps even earlier versions) automatic disabling of screensaver/DPMS works out of the box, without any additional screensaver running. Basically this hacky solution is useless now.
Turns off DPMS blanking when Firefox is playing back video.
https://github.com/dglava/firefox-dpms
I have been looking for a way to turn off all DPMS settings when watching videos in my web browser (Firefox). For example when watching YouTube videos. There is lightsOn, but that didn't work like I wanted it to.
The idea is to use Pulseaudio to determine when Firefox is playing back a video. When it does, a Pulseaudio sink shows up with Firefox's details. This allows one to toggle DPMS settings when that happens. Compared to lightsOn and similar scripts, it does not perform a check every number of seconds. Instead it waits for Pulseaudio events and checks based on that.
I am aware that it's basically an ugly hack, but I find it better than the other solution (lightsOn) I found. I am also not sure if this was the best way to implement it, perhaps a simple shell script could do the same (with pactl subscribe). so suggestions are welcome.
There's a basic PKGBUILD in the git repository, but I might improve it and add it to the AUR later.
Last edited by justasug (2020-02-27 13:13:45)
Offline
Just out of curiosity, why don't you like lightsOn? Is it just that it checks periodically?
Offline
LightsOn works only by detecting Flash video. I needed something to work with HTML5 video. I think there are forks of lightsOn which support that, but I only tried 1 which didn't work and finding the others is tedious. I don't really have problems with the periodic checks, it's just that this method happened to be slightly more convenient (I assume it's also more "effective", but I don't think one simple check every minute or so would be too tasking on the CPU).
I would love if Firefox and other programs handled this themselves. That there would be a common way for them to signal "I want you to turn off screen saving", via dbus or something and which would toggle DPMS settings too. But I haven't found such a solution. Is there one?
Offline
firefox has an indicator for sound. It shows a volume icon on the tab in that case. Should be possible to detect this with an extension
He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.
Douglas Adams
Offline
That is a really neat idea. Screensaver inhibition would be nice, though. Maybe an option to run a user defined command in addition to dpms?
firefox has an indicator for sound. It shows a volume icon on the tab in that case. Should be possible to detect this with an extension
You'll still need the systemd service, since Firefox is moving to the chrome way with webextensions. addons won't have access to the OS anymore without a daemon providing access with some sort of rpc server.
Last edited by progandy (2017-08-31 21:22:25)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Online
firefox has an indicator for sound. It shows a volume icon on the tab in that case. Should be possible to detect this with an extension
I'm afraid I don't have any knowledge about Firefox extensions (looks like they need JavaScript knowledge).
That is a really neat idea. Screensaver inhibition would be nice, though. Maybe an option to run a user defined command in addition to dpms?
That sounds reasonable. I'll look into adding that.
EDIT:
Added the ability to run custom commands. See the README or --help.
Last edited by justasug (2017-09-01 13:33:48)
Offline