Skip to content(if available)orjump to list(if available)

Show HN: Auto-Adjust Keyboard and LCD Brightness via Ambient Light Sensor[Linux]

Show HN: Auto-Adjust Keyboard and LCD Brightness via Ambient Light Sensor[Linux]

1 comments

·November 2, 2025

I have always wanted cool features in Linux because I use it day to day as my OS. I have always wanted to implement this feature and do it properly: one that automatically adjusts keyboard and LCD backlights using data from the Ambient Light Sensor.

I enjoy low-level programming a lot. I delved into writing this program in C. It came out well and worked seamlessly on my device. Currently, it only works for keyboard lights. I designed it in a way that the support for LCD will come in seamlessly in the future.

But, in the real world, people have different kinds of devices. And I made sure to follow the iio implementation on the kernel through sysfs. I would like feedback. :)

seba_dos1

FWIW, iio-sensor-proxy gives you a user-accessible dbus API for ambient light sensors. GNOME has had a feature to auto-adjust screen brightness based on it for ages (though their implementation leave much to be desired and hasn't changed despite of several attempts to rework it over the years).

  $ monitor-sensor
      Waiting for iio-sensor-proxy to appear
  +++ iio-sensor-proxy appeared
  === Has accelerometer (orientation: normal)
  === Has ambient light sensor (value: 56.200000, unit: lux)
  === Has proximity sensor (near: 0)
      Light changed: 56.200000 (lux)
      Light changed: 55.100000 (lux)
      Light changed: 58.500000 (lux)
      Light changed: 48.800000 (lux)