You are not logged in.

#1 2024-07-27 18:05:28

nephanth
Member
Registered: 2017-01-01
Posts: 1

YABD - yet another brightness daemon

YABD - yet another brightness daemon

https://github.com/tbrugere/yabd

This is a simple (~300 lines of python) daemon that sets the brightness of the screen depending on ambient brightness. It was developed for my framework laptop on wayland / sway, but it should work with any system that

  1. uses systemd/dbus (with systemd-logind)

  2. has an ambient light sensor compatible with iio-sensor-proxy

Features:

  • Sets brightness depending on ambient brightness sensor

  • dim screen with a dbus command (for use with swayidle or similar)

  • optionally ramps brightness up and down smoothly

  • Uses dbus interfaces systemd-logind (8) (to set brightness) and iio-sensor-proxy. This means it should be compatible with any window system / wayland / tty (though I have only tested it on sway).

  • Control brightness by hand by interacting with the daemon through commands

Why another daemon for screen brightness?

  • cause it was fun to code ^^

  • Handles the specific case of sway (although this should work in a lot more environments)

  • Pretty simple. Less than 300 lines of code (excluding comments). Most of the complexity of handling devices is offloaded to iio-sensor-proxy and systemd-logind

  • Opinionated design. It uses a power-law for scaling brightness because it feels nicer, nice ramps between values, commands for dimming the screen for idle managers…

  • only handles backlight. this isn't built to replace redshift

  • user/automation can interact with the daemon to dim the screen (for idle config) or to change brightness values.

Last edited by nephanth (2024-07-29 10:00:57)

Offline

Board footer

Powered by FluxBB