use ICC color profiles to change the brightness of the display inspired by icc-brightness but more performant and does not produces ICC files in local directory
NOTE: currently only intel_backlight is used for backlight change
mkdir build && cd build
cmake ..
make install
colord
lcms2
easyloggingpp
# only for building
pkgconf
cmake
- uses inotify to watch for changes on the kernel backlight driver (currently only /sys/class/backlight/intel_backlight/brightness)
- if this file gets modified, it sends events and the changed content to the main programm
- the main programm then uses little-cms to create a color profile with the brightness from the file
- this profile then gets applied to the colord-daemon but the daemon needs a file to read from
- this file is a file only in memory, and only exist as long as the programm runs (it uses the syscall memfd_create)
- should work on all linux-based systems using the colord-daemon for color management and a compositor (wayland or Xorg) which supports color-manaement (e.g. Gnome, KDE, etc)
- Archlinux with Gnome
- Sway (no color-manaement supports, but could be in future)
- add commandline interface
- add config file?
- improve structure
- improve readme
- for a icc profile (which is needed for a setting it system wide) a file need to be saved some ware -> read/write in the slow SSD
- as a work arround, 3 solutions:
- save the file in a tmpfs
- use a named pipe as a file, eg.:
mkfifo my_pipe cat file > my_pipe echo my_pipe > new_file rm my_pipe
- (current approach) use a memfd (memfd_create) to simulate a file in a fd which is saved in ram an cleared, if reference is cleared
- use inotify and conditional variables as notification system for file changes