xbacklight is a small tool that allows adjust the brightness of our screen through the console using command:
xbacklight -set [porcentaje-brillo]
If we wish for example change screen brightness from one hundred to eighty percent we just have to execute:
xbacklight -set 80
We can also increase and decrease the percentage of brightness without worrying about the exact percentage in which it is. Suppose for example that we want to increase the current brightness of the screen by ten percent, for this we use the option
-inc:xbacklight -inc 10
And to decrease, the option
-dec:xbacklight -dec 10
This is extremely interesting if we want to create keyboard shortcuts that allow us increase and decrease the screen brightness level in order not to have to enter the command in the terminal every time we want to make adjustments.
Xbacklight can be easily installed from the official Ubuntu repositories by running on the console:
sudo apt-get install xbacklight
Increase and decrease the brightness of my laptop
Increase or decrease the brightness on a laptop at present it is very simple. But if you have this doubt, it is probably because the next point, in which I will talk about how to do it with the keyboard, does not work in your case. In the next point I will explain everything necessary for you to do it as it should be but, if for whatever reason it is not possible in any way, we can always do it from the options designed for it.
How to do it will be different depending on the graphical environment that we are using. In the version of GNOME that Ubuntu uses, all you have to do is follow these steps:
- We click on the system tray. It is the group of icons that appears at the top right, where we see the volume and the network icon.
- We move the slider or slider It has the icon of a sun with half in white and half in black. Sliding to the left we will lower the brightness, while sliding to the right we will increase it.
In other distributions like Kubuntu, it is usually in the same system tray, with the difference that it will be in the lower right part. If the battery icon does not appear, it will be because we have removed it from the settings. In the unlikely case that an operating system does not allow it from the system tray, the most normal thing is that there is an option in the Settings / Configuration of the operating system app.
Increase or decrease the brightness with the keyboard
Today's laptops come with different keyboards than they used decades ago. Long ago, keyboards were simpler and didn't include keyboards. Fn or Function keys, being only the F1, F2, F3, etc that are similar, but not exactly the same. Each brand uses different keys to perform the same action, but today we can raise and lower the volume from the keyboard, turn off the mouse, switch between monitors or, also, raise and lower the brightness. And this is how it has been designed and that is how it should be.
We have two options:
- Works directly, of fabric. In this case, pressing on what are usually two suns, one filled and the other empty, will increase or decrease the brightness. The one on the left will lower it and the one on the right will raise it.
- Does not work directly. In this case there are two more options: the first is that we cannot do it with the keyboard and the second is that we have to press the Fn key before pressing the brightness increase / decrease keys.
We will rarely stumble upon the second case. Computers already arrive with function keys activated by default. If not, you have to access the BIOS (usually F2 or Fn + F2 when turning on the computer), look for “Function Keys” and check that it says “Enabled” (Activated). If it is not, we activate it and exit saving the changes.
Alternatively create our own keyboard shortcut, but this will not be available in Ubuntu. Yes, we can do it in other more customizable operating systems such as Kubuntu and we can create a customized global shortcut by looking in "global" Preferences to access Shortcuts / Global keyboard shortcuts / Power management. On the right, the options "Increase screen brightness" and "Decrease screen brightness" will appear. We just have to click on one, mark "Custom" and indicate a new keyboard shortcut after clicking "None".
Do you already know how to increase and decrease the brightness of your Ubuntu PC?