Regarding the lowest brightness when charging with Ubuntu

Asked 2 years ago, Updated 2 years ago, 42 views

I use Ubuntu 18.04.3 LTS in Let's Note SZ6, and when charged, the brightness of the display is the lowest.Every time I adjust the brightness with Fn+F1, what can you think of as the cause?

I wish I could fix it by fiddling with the settings at the terminal, but I don't know if the Live USB I used for the installation was bad.

linux ubuntu

2022-09-30 20:11

1 Answers

I'm not sure why it gets dark, but ACPI may be able to detect AC power events and adjust the brightness.

As a prerequisite, /sys/class/backlight/*/brightness must be able to change the brightness.
Each model has a different path, so please check it beforehand.

#ls-1/sys/class/backlight/*/brightness
/sys/class/backlight/intel_backlight/brightness
# cat/sys/class/backlight/intel_backlight/brightness
937 ← Current brightness setting
# cat/sys/class/backlight/intel_backlight/max_brightness
937 ← Maximum configurable value
# echo100>/sys/class/backlight/intel_backlight/brightness← Brightness 100 (dark)
# echo500>/sys/class/backlight/intel_backlight/brightness← Brightness 500
# echo937>/sys/class/backlight/intel_backlight/brightness←Maximum brightness

Check the events when AC power is turned on.
Run acpi_listen to install AC power in that state.

$acpi_listen
ac_adapter ACPI0003:00000000800000000 ← Events Output When AC Power Is Disconnected
(omitted)
ac_adapter ACPI0003:00000000800000001 ← Events output when AC power is installed
(omitted)

Creates a configuration file for ACPI events.
Example: /etc/acpi/events/ac-plugged

 event=ac_adapter ACPI0003:0000000000800000001 ← Events just checked
action=/etc/acpi/ac-pluged.sh← Commands to execute upon event detection

Create a script to run in the action.
Example: /etc/acpi/ac-pluged.sh

#!/bin/sh
KEYS_DIR=/sys/class/backlight/intel_backlight
test-d$KEYS_DIR||exit0
# Set brightness to max_brightness
VAL = $(cat$KEYS_DIR/max_brightness)
echo$VAL>$KEYS_DIR/brightness

The KEYS_DIR value must be in the first directory you checked.

Restart acpid and it will take effect.

#systemctl restart acpid


2022-09-30 20:11

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.