- 
                Notifications
    You must be signed in to change notification settings 
- Fork 26
Api
        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:
This interface exposes Clight internal state, as read-only properties that emit changes.
| Method | IN | IN values | OUT | OUT values | 
|---|---|---|---|---|
| Capture | bb | 
 | ||
| Inhibit | b | 
 | ||
| Pause | b | 
 | ||
| IncBl | d | 
 | ||
| DecBl | d | 
 | ||
| Load | s | 
 | ||
| Unload | s | 
 | 
- 
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.
| 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: 
 | ✔ | |
| DayTime | i | Current daytime: 
 | ✔ | |
| InEvent | b | Whether clight is inside an event | ✔ | |
| DisplayState | i | Current display state: 
 | ✔ | |
| AcState | i | Current AC state: 
 | ✔ | |
| LidState | i | Current lid state: 
 | ✔ | |
| 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 | ✔ | 
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.
| Method | IN | IN values | OUT | OUT values | 
|---|---|---|---|---|
| Store | 
- 
Storewill dump current configuration to user conf.
| 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 | 
| 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 | 
| 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 | 
| Method | IN | IN values | OUT | OUT values | 
|---|---|---|---|---|
| List | a(sadad) | 
 | ||
| Set | sadad | 
 | 
| 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 | 
| Method | IN | IN values | OUT | OUT values | 
|---|---|---|---|---|
| Toggle | 
- 
Togglewill toggle between configured temperatures for day and night.
| 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 | 
| 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 | 
| 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 | 
| Prop | OUT | OUT values | Emits-Change | Const | 
|---|---|---|---|---|
| AcTimeout | i | Timeout for DPMS tool on AC | ||
| BattTimeout | i | Timeout for DPMS tool on BATT | 
| Prop | OUT | OUT values | Emits-Change | Const | 
|---|---|---|---|---|
| NumSamples | i | Bucket size for SCREEN snapshots | ✔ | 
| 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 | 
| Prop | OUT | OUT values | Emits-Change | Const | 
|---|---|---|---|---|
| InhibitDocked | b | Whether "docked" state triggers an inhibit on laptops | ||
| InhibitPM | b | Whether PowerManagement gets inhibited too | 
| Method | IN | IN values | OUT | OUT values | 
|---|---|---|---|---|
| Inhibit | ss | 
 | u | A new inhibition cookie | 
| UnInhibit | u | 
 | ||
| SimulateUserActivity | ||||
| GetActive | b | Whether inhibition is active or not |