Coder Social home page Coder Social logo

firefox-dpms's Introduction

Firefox-DPMS

Disables DPMS (screen blanking) when Firefox is playing back video.

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.

NOTE: this is a hacky way to solve the problem. A better approach would be utilizing the org.freedesktop.ScreenSaver dbus interface. I have no plans right now to work on it, hopefully someone else will.

I couldn't find a way to make Firefox suspend the DPMS settings when it was playing back videos on a website (YouTube for example). This accomplishes exactly that, but in a hacky way.

It works by checking if there are audio streams coming from Firefox with Pulseaudio. The idea is that when you're watching videos, audio is also present. When it detects Firefox audio, it turns DPMS off and restores it again when Firefox's audio disappears, i.e.: the video is closed.

How to install

Run $ python setup.py install
It requires python-pulse-control and obviously Pulseaudio. Arch Linux users can install it from the PKGBUILD in the AUR.

How to use

  • Run $ firefox-dpms

You can specify an additional command to be run alongside the DPMS settings change. For example you can toggle additional screensavers. Use:

  • -c or --command-on to run it when video/audio streams are detected
  • -o or --command-off to run it when streams stop

firefox-dpms's People

Contributors

dglava avatar

Stargazers

 avatar Moarten avatar Francesco Nicastri avatar Hà Văn Hùng avatar

Watchers

 avatar

Forkers

zhou13 castljos

firefox-dpms's Issues

Nightly support

Hello,
would it be possible to add support for Firefox Nightly? I suppose the sink detection needs to be adjusted for this.

Thanks!

AUR package?

Hey, this looks really cool! Is there any chance you could publish the PKGBUILD to aur.archlinux.org?
Thanks :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.