Skip to content
Federico Di Pierro edited this page Oct 23, 2021 · 40 revisions

Table of contents

  1. Common issues
  2. Dbus tricks

Common Issues

This is a list of the most commonly asked questions.

Where is Clight log?

Clight log is located in $XDG_DATA_HOME/clight/clight.log; normally it should resolve to .local/share/clight/clight.log.

Where is Clight conf?

Clight conf file is located in /etc/default/clight.conf.
For more info: https://github.com/FedeDP/Clight/wiki/Config and man clight.

How to enable verbose mode?

Open Clight conf file and uncomment verbose = true; line.

Clight does not detect my external monitor

Check that Clightd was built with ddcutil support; moreover, check that your monitor actually supports DDC/CI: sudo ddcutil detect.

Clight keeps running even after my session was killed

Some distro ship a systemd-logind conf (/etc/systemd/logind.conf) with flag KillUserProcesses=no.
This means clight will not get killed upon user leaving the session, and will not properly get killed on system shutdown.
I encourage to set the flag to yes.
For more info, read here: https://fedoraproject.org/wiki/Changes/KillUserProcesses_by_default.
You can check your system current KillUserProcesses value through dbus:
busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager KillUserProcesses

Clight on wayland

Unfortunately on Wayland there is yet no standard protocol for gamma, dpms and screenshots handling.
Most probably your DE does not implement specific protocols.
For more info: https://github.com/FedeDP/Clight/wiki/Modules#wayland-support.

Geoclue asks for permission

Please try to append following lines to /etc/geoclue/geoclue.conf:

[clightc]
allowed=true
system=false
users=

If issues persist, please fill a bug report.

DBus tricks

Clight may work well on its own, but where it shines is its DBus interface! You can control many aspects of how the program works through integration with other programs or your own scripts!

How do I pause the dimmer temporarily?

Clight implements the Freedesktop ScreenSaver interface, meaning many programs will automatically cause Clight to pause itself. If you want finer control, you can use Clight's dbus interface:

busctl busctl --user call org.clight.clight /org/clight/clight org.clight.clight Inhibit b true

and likewise, you can use false to return the dimmer to normal. You can write a script to toggle inhibition:

#!/usr/bin/env python3
import dbus

bus = dbus.SessionBus()
prop = bus.get_object('org.clight.clight','/org/clight/clight')
currVal = prop.Get('org.clight.clight','Inhibited',dbus_interface='org.freedesktop.DBus.Properties')
prop.Inhibit(not currVal,dbus_interface='org.clight.clight')

Finally, Clight desktop file has a quick action to pause/resume dimmer.

How do I change the backlight manually?

Clight should automatically control your brightness to acceptable values, but if you want to override it manually, there are two ways:

  1. Use IncBl and DecBl to increase/decrease.

These two dbus methods can be used to increase and decrease the backlight by a certain percentage.

busctl --user call org.clight.clight /org/clight/clight org.clight.clight IncBl d 0.1

will increase the backlight by 10%. Likewise, you can use DecBl to decrease by 10%.

Here is another script to change the backlight:

#!/usr/bin/env python3

import dbus
import sys

bus = dbus.SessionBus()
obj = bus.get_object('org.clight.clight','/org/clight/clight')

if sys.argv[1] == '-inc':
	obj.IncBl(float(sys.argv[2]),dbus_interface='org.clight.clight')
if sys.argv[1] == '-dec':
	obj.DecBl(float(sys.argv[2]),dbus_interface='org.clight.clight')

which can be used like backlight -inc 0.1 or backlight -dec 0.1.

  1. Set the backlight directly.

The DBus property BlPct can be used to set the backlight to a specific value.

busctl call org.clightd.clightd /org/clightd/clightd/Backlight org.clightd.clightd.Backlight SetAll d\(bdu\)s 0.5 false 0 0 ""

where 0.5 can be changed to the desired value.

Stop Clight calibrating backlight

You can use the following DBus call to disable automatic screen backlight calibration:

busctl --user set-property org.clight.clight /org/clight/clight/Conf/Backlight org.clight.clight.Conf.Backlight NoAutoCalib b true

Use false to enable it back.
This can again be put in a script to toggle whenever you need to:

#!/usr/bin/env python3
import dbus

bus = dbus.SessionBus()
prop = bus.get_object('org.clight.clight','/org/clight/clight/Conf/Backlight')
currVal = prop.Get('org.clight.clight.Conf.Backlight','NoAutoCalib',dbus_interface='org.freedesktop.DBus.Properties')
prop.Set('org.clight.clight.Conf.Backlight','NoAutoCalib',not currVal,dbus_interface='org.freedesktop.DBus.Properties')

Finally, Clight desktop file has a quick action to pause/resume backlight autocalibration.

I want to set 100% backlight when opening vlc to watch a movie

Sure, it is as simple as creating a video player launcher script and adding:

busctl --user set-property org.clight.clight /org/clight/clight/Conf/Backlight org.clight.clight.Conf.Backlight NoAutoCalib "b" true
busctl --user call org.clight.clight /org/clight/clight org.clight.clight IncBl "d" 1.0

before video player command, and then:

busctl --user set-property org.clight.clight /org/clight/clight/Conf/Backlight org.clight.clight.Conf.Backlight NoAutoCalib "b" false

after it, to enable back automatic screen backlight calibration.

DE Night Theme

Again, this is super easy using Clight dbus API.
Please, head to https://github.com/FedeDP/Clight/wiki/DE-Night-Mode-scripts for a list of scripts for various DEs.

Clone this wiki locally