Skip to content
Federico Di Pierro edited this page Mar 4, 2023 · 62 revisions

Clight offers a very nice and clean Bus API; this should make quite simple to build an applet for it.

It has three main object paths:

Moreover, Clight offers freedesktop Screensaver API too:

/org/clight/clight

This interface exposes Clight internal state, as read-only properties that emit changes.

Bus Methods

Method IN IN values OUT OUT values
Capture bb
  • Whether to reset BACKLIGHT capture timer
  • Whether to only capture without changing BACKLIGHT
Inhibit b
  • Whether to inhibit dimmer module(true) or not(false)
Pause b
  • Whether to pause all clight features
IncBl d
  • Increase backlight of a certain pct
DecBl d
  • Decrease backlight of a certain pct
Load s
  • Absolute path to custom module to be loaded
Unload s
  • Absolute path to custom module to be unloaded
  • Inhibit [true] will inhibit DIMMER and DPMS modules. Useful where "org.freedesktop.ScreenSaver" API is not available.
    Note that it is internally redirected to org.freedesktop.ScreenSaver.Inhibit method, thus behaviour is the same.
  • Inhibit [false] will forcefully drop any inhibition.

Read-only Bus Properties

Prop OUT OUT values Emits-Change Const
Version s Clight version
ClightdVersion s Clightd found version
Sunrise t Next sunrise time in seconds since epoch
Sunset t Next sunset time in seconds since epoch
NextEvent i Next daytime event:
  • 0 -> Sunrise
  • 1 -> Sunset
DayTime i Current daytime:
  • 0 -> Day
  • 1 -> Night
InEvent b Whether clight is inside an event
DisplayState i Current display state:
  • 0 -> ON
  • 1 -> DIMMED
  • 2 -> OFF (DPMS)
  • 3 -> DIMMED and OFF
AcState i Current AC state:
  • 0 -> ON_AC
  • 1 -> ON_BATTERY
LidState i Current lid state:
  • 0 -> OPEN
  • 1 -> CLOSED
  • 2 -> DOCKED
Inhibited b Whether clight is currently inhibited
PmInhibited b Whether clight is currently inhibiting PowerManagement
Suspended b Whether clight sees system as suspended (either because of systemd-logind PrepareForSleep signal or manual "Pause" calls
SensorAvail b Whether a Sensor is currently available
BlPct d Current backlight percentage
KbdPct d Current keyboard backlight percentage
AmbientBr d Latest ambient brightness
Temp i Current screen temperature
Location (dd) Current user location as seen by Clight
ScreenComp d Current screen-emitted brightness compensation value

/org/clight/clight/Conf

This interface allows to check and update various configuration values; when a property is changed, its value will immediately be used by Clight.
There are sub-paths for each Clight module.

Bus Methods

Method IN IN values OUT OUT values
Store
  • Store will dump current configuration to user conf.

Bus Properties

Prop OUT OUT values Emits-Change Const
Verbose b Whether verbose logging is enabled
ResumeDelay i Number of seconds clight awaits before restarting features after system resume

/org/clight/clight/Conf/Backlight

Bus Properties

Prop OUT OUT values Emits-Change Const
NoAutoCalib b Whether auto calibration is disabled
InhibitOnLidClosed b Whether to inhibit autocalibration when laptop lid is closed
NoSmooth b Whether backlight transitions are smooth
TransStep d Backlight step of each transition, in pct
TransDuration i Backlight duration of each step's transition
ShutterThreshold d Shuttered capture threshold
AcDayTimeout i Timeout between captures during the day on AC
AcNightTimeout i Timeout between captures during the night on AC
AcEventTimeout i Timeout between captures during an event on AC
BattDayTimeout i Timeout between captures during the day on BATT
BattNightTimeout i Timeout between captures during the night on BATT
BattEventTimeout i Timeout between captures during an event on BATT
RestoreOnExit b Whether to restore previous backlight level upon clight leaving

/org/clight/clight/Conf/Sensor

Bus Properties

Prop OUT OUT values Emits-Change Const
Device s Sensor to be used
Settings s Sensor settings to be used for camera captures
AcCaptures i Number of captures to be taken on AC
BattCaptures i Number of captures to be taken on BATT
AcPoints ad Ambient brightness to backlight level curve points on AC
BattPoints ad Ambient brightness to backlight level curve points on BATT

/org/clight/clight/Conf/MonitorOverride

Bus Methods

Method IN IN values OUT OUT values
List a(sadad)
  • Array of monitor serials and points for both AC and BATTERY, currently used by Clight for monitor specific curves
Set sadad
  • Monitor serial (obtained using Clightd GetAll method), and points for both AC and BATTERY. To Unset a curve, just pass empty arrays for its data points.

/org/clight/clight/Conf/Kbd

Bus Properties

Prop OUT OUT values Emits-Change Const
Dim b Whether keyboard should be dimmed on user inactivity (following DIMMER/DPMS modules)
AcPoints ad Ambient brightness to keyboard backlight level curve points on AC
BattPoints ad Ambient brightness to keyboard backlight level curve points on BATT

/org/clight/clight/Conf/Gamma

Bus Methods

Method IN IN values OUT OUT values
Toggle
  • Toggle will toggle between configured temperatures for day and night.

Bus Properties

Prop OUT OUT values Emits-Change Const
AmbientGamma b Whether ambient-brightness gamma is enabled
NoSmooth b Whether gamma transitions are smooth
TransStep i Gamma step of each transition
TransDuration i Gamma duration of each step's transition
DayTemp i Daily screen temperature
NightTemp i Night screen temperature
LongTransition b Whether redshift-like gamma transition is enabled
RestoreOnExit b Whether to restore previous screen temperature upon clight leaving

/org/clight/clight/Conf/Daytime

Bus Properties

Prop OUT OUT values Emits-Change Const
Sunrise s User-fixed sunrise time, as read by conf file
Sunset s User-fixed sunset time, as read by conf file
Location (dd) User-fixed location, as read by conf file
EventDuration i Duration of an event
SunriseOffset i Offset for sunrise event
SunsetOffset i Offset for sunset event

/org/clight/clight/Conf/Dimmer

Bus Properties

Prop OUT OUT values Emits-Change Const
NoSmoothEnter b Whether dimmer entering transitions are smooth
NoSmoothExit b Whether dimmer leaving transitions are smooth
DimmedPct d Dimmed state backlight level in pct
TransStepEnter d Dimmer step of each transition, in pct, while dimming
TransStepExit d Dimmer step of each transition, in pct, while undimming
TransDurationEnter i Dimmer duration of each step's transition, while dimming
TransDurationExit i Dimmer duration of each step's transition, while undimming
AcTimeout i Timeout for DIMMER tool on AC
BattTimeout i Timeout for DIMMER tool on BATT

/org/clight/clight/Conf/Dpms

Bus Properties

Prop OUT OUT values Emits-Change Const
AcTimeout i Timeout for DPMS tool on AC
BattTimeout i Timeout for DPMS tool on BATT

/org/clight/clight/Conf/Screen

Read-only Bus Properties

Prop OUT OUT values Emits-Change Const
NumSamples i Bucket size for SCREEN snapshots

Bus Properties

Prop OUT OUT values Emits-Change Const
ScreenContrib d Screen-emitted brightness contribution to ambient brightness
AcTimeout i Timeout for SCREEN tool on AC
BattTimeout i Timeout for SCREEN tool on BATT

/org/clight/clight/Conf/Inhibit

Bus Properties

Prop OUT OUT values Emits-Change Const
InhibitDocked b Whether "docked" state triggers an inhibit on laptops
InhibitPM b Whether PowerManagement gets inhibited too

/org/freedesktop/ScreenSaver

Bus Methods

Method IN IN values OUT OUT values
Inhibit ss
  • Application name
  • Reason for inhibition
u A new inhibition cookie
UnInhibit u
  • Inhibition cookie
SimulateUserActivity
GetActive b Whether inhibition is active or not