[Problems and solutions encountered in Linux configuration] ubuntu18.04 screen brightness cannot be adjusted solution

I just reinstalled the original win10 to the ubuntu system on an idle laptop today. The latest version released by ubuntu's official website at the time of writing these words is 18.04. After installing and playing, I found that there is no place to adjust the brightness of the screen. There should have been a small sun icon in the upper right corner to adjust the brightness, but now there is nothing. The dazzling screen is uncomfortable to watch. So I started looking for a way online. Finally found two solutions:

Option 1. Adjust the brightness with the command line in cmd:

Format: sudo setpci -s 00:02.0 F4.B=FF

setpci: command to modify device properties
-s: the next input is the address of the device
00:02.0: VGA device address (<bus>:<interface>.<function>) (you can run lspci to check, but you don't know It doesn't matter what it is, just fill it in)
F4: The address of the attribute to be modified, here should indicate "brightness"
.B: The modified length (B should be Byte), and W (should be Word, two bytes), L (should be Long, 4 bytes))

=FF: The value to be modified (stored in 16 bits from 00~FF)

sudo setpci -s 00:02.0 F4.B=99

FF is the maximum value of brightness, and 00 is the minimum value. I changed it to 99 and felt that the brightness looked more comfortable. After executing this command, you need to restart the machine to update.


Option 2. Let the little sun appear!

Option 1 is really inconvenient. Every time you want to adjust the brightness, you have to execute the command and restart the machine. The most ideal of course is to adjust it through the little sun icon, like this:


Look at the upper right corner, there is a small speaker icon for volume adjustment and a small sun icon for brightness adjustment. I just started with the horn icon. So how do you make the sun appear?

(1) First, ctrl+Alt+T brings up a command line interface.

(2) Execute this command: sudo nano /etc/default/grub    It will open a file called grub

(3)   Change the line of GRUB_CMDLINE_LINEX_DEFAULT to:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_backlight=vendor acpi_osi=Linux"

(4) Press Ctrl+O to save.

(5) Press Ctrl+X to exit editing.

(6) Enter and execute sudo update-grub.

(7) Restart the machine.

It stands to reason that after the restart, the little sun should come out. 


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325192934&siteId=291194637