Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add light support to backlight module #749

Open
wants to merge 1 commit into
base: current
Choose a base branch
from
Open

Add light support to backlight module #749

wants to merge 1 commit into from

Conversation

thiagokokada
Copy link

@thiagokokada thiagokokada commented Jun 1, 2019

This PR introduces support to Light (https://github.com/haikarainen/light) support in backlight module, as a alternative program to control backlight. It uses sysfs files and udev rules instead of through a X protocol like xbacklight, so it works in non-X environments (for example, in sway). Also, it seems more reliable and works where xbacklight does not work (like when using xf86-modesetting instead of xf86-video-intel driver).

It is already supported in the official repositories in multiple distros (like Arch, Fedora and NixOS), so it seems to be a much better supported alternative than other programs that do something similar (like https://github.com/wavexx/acpilight/).

Since this needs to be explicitly set by the user now, I removed the check for the binary. If the user sets adjust_method to either xbacklight or light, it just assumes that either xbacklight or light is installed. However, setting it wrong does not bring any problems either (except the inability to change brightness, of course).

This PR also allows the user to set format_no_backlight to empty string and hide backlight module in case the system does not have a backlight (i.e.:, again, in a Desktop). If you set to an empty string nowadays it results the same output as the default one, resulting in something like Brightness: -1 output.

Substitutes PR #747.

Light (https://github.com/haikarainen/light) is a program to control
backlight using sysfs files and udev rules instead of through a X
protocol like xbacklight, so it works in non-X environments. Also, it
seems more reliable and works where xbacklight does not work (like when
using xf86-modesetting instead of xf86-video-intel driver).

It is already supported in multiple distros (like Arch, Fedora and NixOS), so
it seems to be a much better supported alternative than other programs
that do something similar (like https://github.com/wavexx/acpilight/).
@thiagokokada thiagokokada marked this pull request as ready for review June 1, 2019 19:21
@thiagokokada
Copy link
Author

Tested:

  • Notebook, with adjust_method set to xbacklight, light and default (None).
  • Desktop, with format_no_backlight set to empty string.

@thiagokokada
Copy link
Author

@enkore

@johnliu55tw
Copy link

johnliu55tw commented Oct 18, 2019

Can anyone help review/merge this? xbacklight only works with Intel (according to ArchWiki) so I can't utilize this plugin to adjust my AMD laptop. Thanks!

@enkore enkore changed the base branch from master to current September 6, 2020 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants