caffeine-ng icon indicating copy to clipboard operation
caffeine-ng copied to clipboard

screen dimming in manjaro-XFCE 18 & possible "presentation mode" support?

Open carlinux opened this issue 6 years ago • 1 comments

Apparently caffeine doesn't prevent xfce4-power-manager screen dimming (after x seconds) . in manjaro-XFCE. ( I'm not sure in other xfce distros. ) Extrangely enough, xfce4-power-manager knows that caffeine is preventing power management as you can see in the screenshot. Captura de pantalla_2019-03-16_17-02-22 (sorry it is in spanish, the message says "caffeine is preventing the use of PM" On the other hand xfce4-power-manager now has a (less smart than caffeine) mode to prevent PM, it is called "presentation mode". That mode prevents PM while it is active.

I wonder if it would be possible to integrate "Presentation mode" as the PM for caffeine in XFCE. it can be set in real time by summoning xfconf-query To trigger it on and off xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -T To explicitly activate or deactivate it
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s true xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s false

This mode prevents screen dimming and every other PM aspect.

Thanks in advance

carlinux avatar Mar 16 '19 16:03 carlinux

~~First of all i'm not a coder so maybe i,m missing something important but just looking into the code I think this could do it.~~

I Tested this piece of code and it works as intended :+1: I never did a PR so, please, mind it if I'm doing something wrong.

class xfceInhibitor(BaseInhibitor):

    def __init__(self):
        BaseInhibitor.__init__(self)

    def inhibit(self):
        self.running = True

        os.system("xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s true")

    def uninhibit(self):
        self.running = False

        # FIXME: Aren't we enabling it if it was never online?
        # Grep `xset q` for "DPMS is Enabled"
        os.system("xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/presentation-mode -s false")

    @property
    def applicable(self):
        # TODO!
        return True

carlinux avatar Mar 16 '19 16:03 carlinux

This repository has moved to codeberg.

Follow-up for this issue is at https://codeberg.org/WhyNotHugo/caffeine-ng/issues/23

WhyNotHugo avatar Nov 06 '22 14:11 WhyNotHugo