Skip to content

community/brightnessctl: restrict openrc service to backlights

Jakko requested to merge jakko/aports:brightnessctl_openrc_service into master

For the postmarketOS installation packages of Xfce4 and LXQt I would like to generally add brightnessctl and its openrc service. Those user interfaces provide backlight control but don't save it across boots. In distributions with systemd it's service systemd-backlight@.service that takes care of this. On OpenRC distrubutions brightnessctl and its openrc service is a good choice.

When enabling the brightnessctl openrc service generally on postmarketOS Xfce4 and LXQt installations, it will also hit devices that don't have backlight support. In those cases brightnessctl starts to mess with LEDs, see commit message for more details.

I suggest to restrict the openrc service to backlights only. If there is no backlight, the service exits with an info (no warning, as it is desired behavior on devices without backlight support).

(I was also thinking about a config file to specify class and device but this would add quite some complexity.)

Additionally to the two if-blocks looking for empty directory /sys/class/backlight, there are two additional minor changes:

  • As the script becomes bigger, I added empty lines to structure the content into blocks.
  • The ebegin text doesn't need ellipsis "...", OpenRC adds them itself. If they are in the script, there will be two sets of ellipsis in the rc.log.

Merge request reports