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 config for brightness control #335

Closed
wants to merge 2 commits into from

Conversation

jsl9208
Copy link

@jsl9208 jsl9208 commented Mar 15, 2024

Hi, thank you for your awesome project! I've encountered two issues while using it on my ASUS G14 laptop:

  1. The default brightnessCtl command controls the wrong device, so I need to pass -d amdgpu_bl1 to make it work correctly.
  2. The G14 uses an OLED display. I inadvertently set the brightness to 0 several times, rendering it totally unusable. I think it would be better to have a brightness configuration to prevent this situation from happening again.

I have added some configuration to solve these problems, brightness.device and brightness.minPercent.

@clsty
Copy link
Collaborator

clsty commented Mar 16, 2024

While I do appreciate this work, I also personally suggest to consider about ddc control.

Modern monitors support DDC protocol, so when they are connected with computers via DP or HDMI, they can be controlled via DDC.
brightnessctl however does not support it currently.

Basically we can use ddcutil to do this, but it requires specifying the device and is not automatic.

A better solution will be clightd, which provides a dbus interface to control all backlights, including the normal ones (which brightnessctl does) and the DDC ones (normally the connected monitors via DP or HDMI cable).

A script to use clightd to control brightness: https://github.com/clsty/dots-hyprarch/blob/main/.local/bin/clightctl

Usage example in keybinds.conf:

bindle = , XF86MonBrightnessUp, exec, ~/.local/bin/clightctl backlight r
bindle = , XF86MonBrightnessDown, exec, ~/.local/bin/clightctl backlight l

The dependency is available as an AUR package "clightd".


Ok, wait, I've found this in the repo of brightnessctl:

Use the ddcci-driver-linux kernel module to expose external monitor brightness controls to brightnessctl. Available in repositories of AUR, Debian, Nix, Ubuntu, Void.

Tested, after installing ddcci-driver-linux and reboot system and modprobe, brightnessctl only works for one of my 2 monitors, while clightd works for both.

@jsl9208
Copy link
Author

jsl9208 commented Mar 16, 2024

Thank you for the advice. I don't use an external monitor, just the internal one.

I believe the issue is that my laptop has two GPU devices, an integrated one and an Nvidia dGPU. Both of them can handle the display output by switching to different modes (Optimus, Integrated, etc.). These tools are unable to determine which device is in use.

In my case, the default device is Nvidia for most of the tools. I have tested brightnessCtl, clightd, and brillo. Only brillo has the feature to detect the in-use device automatically and it worked correctly.

I think it's too heavy and complicated to use the vendor-specific tool to determine which mode the system is currently in, and then choose the correct device to control. An additional config is better for most cases. But perhaps using brillo is the best approach?

@Zeps2369
Copy link

Thank you for the advice. I don't use an external monitor, just the internal one.

I believe the issue is that my laptop has two GPU devices, an integrated one and an Nvidia dGPU. Both of them can handle the display output by switching to different modes (Optimus, Integrated, etc.). These tools are unable to determine which device is in use.

In my case, the default device is Nvidia for most of the tools. I have tested brightnessCtl, clightd, and brillo. Only brillo has the feature to detect the in-use device automatically and it worked correctly.

I think it's too heavy and complicated to use the vendor-specific tool to determine which mode the system is currently in, and then choose the correct device to control. An additional config is better for most cases. But perhaps using brillo is the best approach?

Hi. Im having the same isues using the g14 2024 model. Can you explain how you fixed it using brillo in detail please :)

@jsl9208
Copy link
Author

jsl9208 commented Mar 26, 2024

Thank you for the advice. I don't use an external monitor, just the internal one.
I believe the issue is that my laptop has two GPU devices, an integrated one and an Nvidia dGPU. Both of them can handle the display output by switching to different modes (Optimus, Integrated, etc.). These tools are unable to determine which device is in use.
In my case, the default device is Nvidia for most of the tools. I have tested brightnessCtl, clightd, and brillo. Only brillo has the feature to detect the in-use device automatically and it worked correctly.
I think it's too heavy and complicated to use the vendor-specific tool to determine which mode the system is currently in, and then choose the correct device to control. An additional config is better for most cases. But perhaps using brillo is the best approach?

Hi. Im having the same isues using the g14 2024 model. Can you explain how you fixed it using brillo in detail please :)

just install brillo, then brillo -S 20%

@Zeps2369
Copy link

Thank you for the advice. I don't use an external monitor, just the internal one.
I believe the issue is that my laptop has two GPU devices, an integrated one and an Nvidia dGPU. Both of them can handle the display output by switching to different modes (Optimus, Integrated, etc.). These tools are unable to determine which device is in use.
In my case, the default device is Nvidia for most of the tools. I have tested brightnessCtl, clightd, and brillo. Only brillo has the feature to detect the in-use device automatically and it worked correctly.
I think it's too heavy and complicated to use the vendor-specific tool to determine which mode the system is currently in, and then choose the correct device to control. An additional config is better for most cases. But perhaps using brillo is the best approach?

Hi. Im having the same isues using the g14 2024 model. Can you explain how you fixed it using brillo in detail please :)

just install brillo, then brillo -S 20%

what is your solution for keyboard backlight?

@jsl9208
Copy link
Author

jsl9208 commented Mar 26, 2024

Thank you for the advice. I don't use an external monitor, just the internal one.
I believe the issue is that my laptop has two GPU devices, an integrated one and an Nvidia dGPU. Both of them can handle the display output by switching to different modes (Optimus, Integrated, etc.). These tools are unable to determine which device is in use.
In my case, the default device is Nvidia for most of the tools. I have tested brightnessCtl, clightd, and brillo. Only brillo has the feature to detect the in-use device automatically and it worked correctly.
I think it's too heavy and complicated to use the vendor-specific tool to determine which mode the system is currently in, and then choose the correct device to control. An additional config is better for most cases. But perhaps using brillo is the best approach?

Hi. Im having the same isues using the g14 2024 model. Can you explain how you fixed it using brillo in detail please :)

just install brillo, then brillo -S 20%

what is your solution for keyboard backlight?

As far I am only able to switch it on/off using asusctl
asusctl led-pow-2 keyboard

@jsl9208 jsl9208 closed this May 24, 2024
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.

None yet

3 participants