GithubHelp home page GithubHelp logo

Comments (3)

jackpot51 avatar jackpot51 commented on June 19, 2024

This seems like a bug in GNOME Settings Daemon, assuming the brightness only changes from within GNOME Settings Daemon.

To have this power daemon work outside of GNOME, it uses the /sys/class/backlight API to control backlights. GNOME Settings Daemon should probably watch this for changes.

Since the likelihood of changing GNOME Settings Daemon to do this is low, I will look into sending the new brightness information through the DBUS API if it is available, as a temporary workaround.

from system76-power.

mmstick avatar mmstick commented on June 19, 2024

Documentation on the DBUS API is scarce. Here's a dump from gdbus.

node /org/gnome/SettingsDaemon/Power {
  interface org.freedesktop.DBus.Properties {
    methods:
      Get(in  s interface_name,
          in  s property_name,
          out v value);
      GetAll(in  s interface_name,
             out a{sv} properties);
      Set(in  s interface_name,
          in  s property_name,
          in  v value);
    signals:
      PropertiesChanged(s interface_name,
                        a{sv} changed_properties,
                        as invalidated_properties);
    properties:
  };

  interface org.freedesktop.DBus.Introspectable {
    methods:
      Introspect(out s xml_data);
    signals:
    properties:
  };

  interface org.freedesktop.DBus.Peer {
    methods:
      Ping();
      GetMachineId(out s machine_uuid);
    signals:
    properties:
  };

  interface org.gnome.SettingsDaemon.Power.Screen {
    methods:
      StepUp(out i new_percentage,
             out i output_id);
      StepDown(out i new_percentage,
               out i output_id);
    signals:
    properties:
      readwrite i Brightness = 50;
  };

  interface org.gnome.SettingsDaemon.Power.Keyboard {
    methods:
      StepUp(out i new_percentage);
      StepDown(out i new_percentage);
      Toggle(out i new_percentage);
    signals:
      BrightnessChanged(i brightness,
                        s source);
    properties:
      readwrite i Brightness = 0;
  };
};

It seems that in order to control brightness, you have to use the Brightness property.

Checking if it exists

gdbus introspect --session --dest org.gnome.SettingsDaemon.Power \
    --object-path /org/gnome/SettingsDaemon/Power \
        || echo SettingsDaemon.Power does not exist

Getting Brightness

dbus-send --session --print-reply \
    --dest="org.gnome.SettingsDaemon.Power" \
    /org/gnome/SettingsDaemon/Power \
    org.freedesktop.DBus.Properties.Get \
    string:org.gnome.SettingsDaemon.Power.Screen \
    string:Brightness

Setting Brightness

dbus-send --session --print-reply \
    --dest="org.gnome.SettingsDaemon.Power" \
    /org/gnome/SettingsDaemon/Power \
    org.freedesktop.DBus.Properties.Set \
    string:org.gnome.SettingsDaemon.Power.Screen \
    string:Brightness \
    variant:int32:${PERCENT}

from system76-power.

jackpot51 avatar jackpot51 commented on June 19, 2024

Thanks Michael, I think that is enough information to figure this out

from system76-power.

Related Issues (20)

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.