Skip to content
Federico Di Pierro edited this page Jun 8, 2023 · 44 revisions

Clightd offers a bus interface at org.clightd.clightd that is splitted into various objects paths/interfaces.

/org/clightd/clightd

Properties

Prop OUT OUT values Writable Const
Version s
  • Clightd version

/org/clightd/clightd/Backlight

Note that this is the old version of the Backlight API, that now just acts as a router for the new Backlight2 API.

Methods

Backlight Smooth struct:

  • b -> isSmooth (true for smooth change)
  • d -> smooth step (eg: 0.02)
  • u -> smooth timeout: timeout for smoothing in ms
Method IN IN values OUT OUT values Polkit restricted Xorg Wayland tty
GetAll s
  • Backlight interface for internal monitor (Nullable)
a(sd)
  • Array of struct with serialNumber and current backlight pct for each screen
SetAll d(bdu)s
  • Target pct
  • Backlight Smooth struct
  • Internal laptop's screen interface (Nullable)
b
  • True if no error happens
RaiseAll d(bdu)s
  • Relative to current backlight pct target pct
  • Backlight Smooth struct
  • Internal laptop's screen interface (Nullable)
b
  • True if no error happens
LowerAll d(bdu)s
  • Relative to current backlight pct target pct
  • Backlight Smooth struct
  • Internal laptop's screen interface (Nullable)
b
  • True if no error happens
Get s
  • Backlight serial
sd
  • Struct with serialNumber and current backlight pct for desired screen
Set d(bdu)s
  • Target pct
  • Backlight Smooth struct
  • Desired backlight serial
b
  • True if no error happens
Raise d(bdu)s
  • Relative to current backlight pct target pct
  • Backlight Smooth struct
  • Desired backlight serial
b
  • True if no error happens
Lower d(bdu)s
  • Relative to current backlight pct target pct
  • Backlight Smooth struct
  • Desired backlight serial
b
  • True if no error happens

Note that passing an empty/NULL string as internal backlight interface parameter will make clightd use first device it finds (through libudev and ddcutil)!

For external monitors, you should use device Serial Number or I2C bus, as found through:

sudo ddcutil detect
Display 1
I2C bus:             /dev/i2c-1
EDID synopsis:
Mfg id:           ACI
Model:            ASUS VX239
Serial number:    G2LMTJ006007
Manufacture year: 2016
EDID version:     1.3
VCP version:         2.1

Signals

Sig OUT OUT values
Changed sd
  • Backlight interface
  • New backlight level

/org/clightd/clightd/Backlight2

New version for Backlight interface; it has a main object path that acts as router to any screen (both internal and external) it found; moreover each screen has its own object path.

Methods

Backlight2 Smooth struct:

  • d -> smooth step (eg: 0.02, 0 to disable smoothing)
  • u -> smooth timeout: timeout for smoothing in ms (0 to disable smoothing)
Method IN IN values OUT OUT values Polkit restricted Xorg Wayland tty
Get a(sd)
  • Array of struct with serialNumber and current backlight pct for each screen
Set d(du)
  • Target pct
  • Backlight2 Smooth struct
Raise d(du)
  • Relative to current backlight pct target pct
  • Backlight2 Smooth struct
Lower d(du)
  • Relative to current backlight pct target pct
  • Backlight2 Smooth struct

Signals

Sig OUT OUT values
Changed sd
  • Backlight interface
  • New backlight level

Each screen API implements same interface described above, plus it exposes 2 properties:

Properties

Prop OUT OUT values Writable Const
Max i
  • Max backlight level
Internal b
  • True if internal screen, false otherwise

/org/clightd/clightd/Gamma

Methods

Gamma Smooth struct:

  • b -> isSmooth (true for smooth change)
  • u -> smooth step (eg: 50)
  • u -> smooth timeout: timeout for smoothing in ms

Note that both ID and AUTH here below have different meaning for different plugins. Be sure to check out also https://github.com/FedeDP/Clightd/wiki/Gamma.

Method IN IN values OUT OUT values Polkit restricted Xorg Wayland tty
Get ss
  • env ID
  • env AUTH
i
  • Current display gamma temp
Set ssi(buu)
  • env ID
  • env AUTH
  • New gamma value
  • Gamma Smooth struct
b
  • True if no error happens

Signals

Sig OUT OUT values
Changed si
  • Display
  • New temp

/org/clightd/clightd/Sensor

Methods

Method IN IN values OUT OUT values Polkit restricted Xorg Wayland tty
Capture sis
  • Sensor sysname(eg: Video0 for webcam) (Nullable)
  • Number of frames to be captured
  • Sensor settings string (Nullable)
sad
  • Sensor sysname captured
  • Array of frames' brightness in pct
IsAvailable s
  • Sensor sysname(eg: Video0) to be checked. (Nullable)
sb
  • Sensor sysname found
  • True if any sensor could be found

To know more about Sensor API and available settings strings, head to Sensors wiki page.

Note that passing an empty/NULL string as device sysname will make clightd use first sensor device it finds (through libudev).

Signals

Sig OUT OUT values
Changed ss
  • Sensor's devpath
  • Action string, as received from udev. Eg: "add", "remove"

When a new sensor becomes available, a "Changed" signal is sent on both /org/clightd/clightd/Sensor and /org/clightd/clightd/Sensor/$SensorType object paths.

/org/clightd/clightd/Dpms

Methods

Note that both ID and AUTH here below have different meaning for different plugins. Be sure to check out also https://github.com/FedeDP/Clightd/wiki/Dpms.

Method IN IN values OUT OUT values Polkit restricted Xorg Wayland tty
Get ss
  • env ID
  • env AUTH
i
  • Current dpms state
Set ssi
  • env ID
  • env AUTH
  • New dpms state
b
  • True if no error happens

Signals

Sig OUT OUT values
Changed si
  • Display
  • New DPMS level

/org/clightd/clightd/Idle

Idle interface is "client" based: you request a new Idle client, set required Client's properties, and then start it. When you are finished, you can stop it and destroy it.
Note that caller is validated against desired client, ie: if you created Client0, you can only call methods and set properties on Client0. If you try on Client1, you will receive EPERM error.
Only GetClient requires polkit auth because other calls are already restricted to dbus sender.

Methods

Method IN IN values OUT OUT values Polkit restricted Xorg Wayland tty
GetClient o
  • New Idle client's object path
DestroyClient o
  • Client's to be destroyed

/org/clightd/clightd/Idle/ClientX

Properties

Prop OUT OUT values Writable Const
Timeout u
  • Client's timeout in seconds

Methods

Method IN IN values OUT OUT values Polkit restricted Xorg Wayland tty
Start
Stop

Signals

Sig OUT OUT values
Idle b
  • New idle value for Client

/org/clightd/clightd/Screen

Screen module offers an easy way to compute currently screen-emitted brightness.

Methods

Note that both ID and AUTH here below have different meaning for different plugins. Be sure to check out also https://github.com/FedeDP/Clightd/wiki/Screen.

Method IN IN values OUT OUT values Polkit restricted Xorg Wayland tty
GetEmittedBrightness ss
  • env ID
  • env AUTH
d
  • Current screen-emitted brightness, in pct

/org/clightd/clightd/KbdBacklight

KbdBacklight module offers an easy way to set keyboards backlight and stop timeout on all available keyboards.

Methods

Method IN IN values OUT OUT values Polkit restricted Xorg Wayland tty
Get a(sd)
  • Array of keyboard backlight id and pct
Set d
  • New keyboard backlight in pct
b
  • True if no error happens
GetTimeout a(si)
  • Array of keyboard backlight id and timeout in seconds
SetTimeout i
  • New keyboard timeout in seconds
b
  • True if no error happens

Signals

Sig OUT OUT values
Changed sd
  • Keyboard backlight sysname
  • New backlight value

/org/clightd/clightd/KbdBacklight/$kbd_backlight

KbdBacklight object paths offer an easy way to set and retrieve keyboard backlight and stop timeout on specific keyboard.

Methods

Method IN IN values OUT OUT values Polkit restricted Xorg Wayland tty
Set d
  • New keyboard backlight in pct
b
  • True if no error happens
Get d
  • Keyboard backlight in pct
SetTimeout i
  • New keyboard timeout in seconds
b
  • True if no error happens
GetTimeout i
  • Keyboard timeout in seconds

Signals

Sig OUT OUT values
Changed d
  • New backlight value