📜 ⬆️ ⬇️

A fly in the ointment fly Linux Mint: or how I overcame the brightness

Good day habravchane!

On Habré there were many reviews and articles with impressions from the transition to the OS Linux, which revealed all the pros and cons, opinions and solutions to some problems when working with this OS. I was no exception. How I switched to Linux Mint and how I solved the problem with the brightness of the backlight, read under the cut.

In each IT person's life, sometimes a moment comes when he decides to try something new and, gathering his will, making a backup of everything important, writes an image with a distro selected for so long (I chose Linux Mint 17 x64 Cinnamon) Linux And with the expectation of a miracle loaded with it.

I will not describe the installation process, it is already described everywhere several times. Let me just say that the installation, surprisingly was painless. After reboots, I was greeted by a welcome screen with an invitation to enter my username and password, which I promptly did. After entering, I was greeted with pleasant tones by the desktop and for a moment it seemed to me that I had used it for a hundred years! Everything is so native and understandable that makes you forget about the existence of Windows.
')
The first impression was very positive, I slowly began to learn a new OS for me. I read the manual, looked at the thematic forum, and began to explore the system. On Habré there were reviews of this distribution kit and I had an idea about it. All components of the laptop earned from the first time, wifi, bluetooth, webcam, even a USB modem without installing drivers was immediately determined by the system, and after simple actions on the instructions of the access point earned to the full.

Liked the idea of ​​repositories, Program Manager with thousands of programs in one place. So I started to get used to it. First of all, I installed the necessary software so that it was not boring; I turned on the music in the player (by the way, Audacious replaced my AIMP) and at some point I wanted to turn up the volume. I pressed the treasured combination Fn + cursor to the right and touched the down arrow with my finger, that is, the decrease in brightness. To my surprise, this had no effect on the backlight level. I tried again, the indicator showed a change, but the brightness did not change.

Began to google this phenomenon. From the search results I realized that it was not for me that the brightness did not change one and I began to look for a solution. By the way, the configuration of the laptop Lenovo B570e with a Core i5 2450m / 4Gb RAM / 500Gb HDD / Intel HD Graphics 3000 processor. As it turned out, other models of laptops of this and other manufacturers also have a problem with backlight brightness control. The first solution I tried was editing the grub bootloader file. This was done in the following order of actions:

In the terminal I typed the command:

sudo gedit /etc/default/grub 


And in the opened text editor window I found two lines and brought them into this view:

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


I saved the changes I made and performed the bootloader update:

 sudo update-grub 


After that, I rebooted and tried. After rebooting the keys, everyone also refused to control the brightness, plus the brightness indicator disappeared to everything, but it turned out to change the brightness using the brightness control applet.

The second method I tried was the following command in the terminal:

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


Where xx is a value from zero to 100. The laptop did not react at all to this command.

And, finally, the third method was to change the first two lines, but before that:

 GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX="acpi_backlight=vendor" 


In this case, the screen displays a change in brightness, but the brightness itself did not change. Also, it was not possible to change the brightness through the brightness control applet. After these manipulations, I returned everything as it was and continued to look for other solutions.

The second solution found on the Internet was the following.

It was necessary to create a file in the home directory, with any name, but with the * .sh format and enter the following values ​​inside it:

 #!/bin/bash sudo echo -n 0 >/sys/class/backlight/acpi_video1/brightness 


Where 0 is the brightness, and / sys / class / backlight / acpi_video1 / brightness is the path to the file in which the current brightness value is saved from the system parameters. After saving the file, you had to configure its permissions in this way:

 chmod +x ~/bin/brightness.sh 


And run this script from the terminal:

 sudo sh ~/bin/brightness.sh 


As a result, the brightness value changed, but this decision did not satisfy me with its complexity and unnecessary gestures. It was found another solution, already on the habr , which also did not fit. In the end, I came across another solution, but from a foreign site, which suited me fully. It indicated that this is a solution for laptops with Intel graphics solutions, which more than fully fit me. I cite this solution:

Start the terminal and execute the following command:

 ls /sys/class/backlight/ 


As a result, we will see the following command output:

 kibis@kibis-Lenovo-B570e ~ $ ls /sys/class/backlight/ acpi_video0 intel_backlight 


Then create a configuration file, if it does not exist, with the following command in the terminal:

 sudo touch /usr/share/X11/xorg.conf.d/20-intel.conf 


Open the file we just created for editing:

 sudo gedit /usr/share/X11/xorg.conf.d/20-intel.conf 


It must be empty and write the following into it:

 Section "Device" Identifier "card0" Driver "intel" Option "Backlight" "intel_backlight" BusID "PCI:0:2:0"EndSection 


We save. Reboot. And - voila! As a result, the backlight brightness control keys work, the brightness level indicator is displayed.

Thus, with a little patience and perseverance, I solved this problem, in my opinion, in the most elegant way. I hope that my contribution to solving this problem will help other users.

Source: https://habr.com/ru/post/236353/


All Articles