Configure Screen Brightness in Ubuntu
In this article
To configure screen brightness in Ubuntu, use the brightness slider in the Settings app or the keyboard brightness keys, and for finer control or scripting, use the command-line tools brightnessctl or xrandr. This article covers all the built-in and third-party methods, how they work, and how to fix common issues like missing brightness controls or incorrect brightness after suspend.
Built-in Brightness Controls
The most straightforward way to adjust brightness is through the graphical interface. On Ubuntu’s default GNOME desktop, click the system menu in the top-right corner (the area with the Wi‑Fi, volume, and battery icons). The brightness slider appears at the top of the popover; drag it left or right to change the screen’s backlight intensity.
Most laptops also have dedicated function keys, typically F1 and F2 (or Fn + F1/F2) marked with a sun icon. Pressing these keys sends an ACPI event that the desktop environment translates into a brightness change. If the keys do nothing, the issue is usually that the laptop’s firmware or the kernel driver isn’t exposing the backlight interface correctly.
For desktop monitors, the brightness is usually controlled via the monitor’s own on-screen display (OSD) buttons, not through Ubuntu. Some monitors support DDC/CI, which allows software control, but that requires extra tools like ddcutil and is not part of the default Ubuntu setup.
How Brightness Works on Linux
Brightness control on Linux involves several layers. The kernel exposes the backlight as a sysfs interface, usually under /sys/class/backlight/. There, you’ll find directories like intel_backlight, acpi_video0, or amdgpu_bl0, each containing files such as brightness, max_brightness, and actual_brightness. The desktop environment or a tool like brightnessctl writes a value between 0 and max_brightness to the brightness file.
There are two main types of brightness: backlight (the physical light behind an LCD panel) and software gamma (which alters the color output). The slider in GNOME controls the backlight on most laptops. On some systems, especially with external monitors or certain GPUs, the slider may instead adjust gamma, which does not save battery but can still make the screen appear dimmer.
To see which backlight interfaces are available, open a terminal and run:
ls /sys/class/backlight/
If the list is empty, the kernel has not detected a backlight device, and the graphical slider will likely be missing or ineffective.
Using the Command Line
For precise control or scripting, the command line is the most flexible option. The simplest method is to write directly to the sysfs file, but that requires root privileges. A safer and more user-friendly tool is brightnessctl, which is in the official Ubuntu repositories.
Install it with:
sudo apt install brightnessctl
Then you can:
- Show current brightness and max:
brightnessctl - Set brightness to 50%:
brightnessctl set 50% - Increase by 10%:
brightnessctl set +10% - Decrease by 10%:
brightnessctl set 10%-
Another tool, xrandr, works by adjusting the gamma ramp and is useful for external monitors or when the backlight interface is unavailable. For example, to reduce brightness to 70% on the primary output:
xrandr --output eDP-1 --brightness 0.7
Note that xrandr only affects the X server session, not the physical backlight, and the setting resets after a reboot or when the display reconnects.
Choosing the Right Method
The best method depends on your hardware and needs:
- Laptop with a built-in display: Use the GNOME slider or
brightnessctlto control the actual backlight. This saves battery and is the most reliable. - Desktop with an external monitor: Use the monitor’s OSD buttons. If you want software control, try
ddcutil(requires a monitor that supports DDC/CI and a connected I2C bus). - When the backlight interface is missing: Use
xrandr --brightnessas a temporary workaround, but note it doesn’t reduce power consumption. - For automatic dimming (e.g., when on battery): Use GNOME’s power settings or a tool like
auto-brightness(not installed by default).
Common Problems and Fixes
Many users encounter brightness issues after installing Ubuntu or upgrading the kernel. Here are the most frequent problems and their solutions:
- Brightness keys do nothing: First, check if the slider in Settings works. If it does, the keys may need a different driver or the desktop environment’s shortcut settings. Try installing
xbacklight(for X11) or check your laptop’s manufacturer for a BIOS update. - Brightness resets to maximum after suspend: This is often a kernel bug. A common workaround is to add a systemd service that sets the brightness after resume. For example, create
/etc/systemd/system/brightness.servicewith a script that writes the desired value to/sys/class/backlight/intel_backlight/brightness. - No brightness slider in Settings: This usually means the kernel doesn’t see a backlight device. Try adding the kernel parameter
acpi_backlight=vendororacpi_backlight=nativeto your GRUB command line. Edit/etc/default/grub, add the parameter toGRUB_CMDLINE_LINUX_DEFAULT, then runsudo update-gruband reboot. - Brightness changes are not smooth: Some drivers only support a few discrete steps. This is normal; you can’t force finer granularity unless the hardware supports it.
Comparing Brightness Tools
There are several command-line tools, each with strengths:
- brightnessctl: Modern, actively maintained, works with both backlight and LED devices, and supports saving/restoring settings. It is the recommended tool for most users.
- xbacklight: Older tool that uses the RandR extension. It works on X11 but not on Wayland, and it may not support all GPUs.
- light: Another lightweight utility that can control backlight, but it is not in the default Ubuntu repos and requires manual compilation.
- ddcutil: For external monitors via DDC/CI. It is more complex and requires I2C permissions.
For most laptop users, brightnessctl is the best balance of simplicity and functionality.
Safety and Power Considerations
Setting brightness to 0% on a laptop will turn off the backlight, making the screen unreadable. This is not harmful, but you may need to press a key or move the mouse to restore it. On some systems, a very low brightness can cause eye strain, so it’s advisable to keep it above 20% for comfortable viewing.
Lower brightness reduces power consumption and extends battery life. The backlight is often the largest power draw on a laptop, so reducing it from 100% to 50% can add significant runtime. However, if you use xrandr --brightness, you are only changing the gamma, which does not affect power usage.
Frequently Asked Questions
Why is my brightness slider missing?
This happens when the kernel doesn’t detect a backlight device. Try adding the kernel parameter acpi_backlight=native or acpi_backlight=vendor to GRUB. If that doesn’t work, check if your GPU driver is properly installed (e.g., for NVIDIA, the proprietary driver is often required).
Can I control brightness on an external monitor with Ubuntu?
Yes, if the monitor supports DDC/CI, you can use ddcutil to adjust its brightness from the terminal. Otherwise, use the monitor’s physical buttons.
How do I set a default brightness at startup?
You can create a systemd service that runs brightnessctl set 50% after boot. Alternatively, some desktop environments remember the last brightness setting across reboots.
Does lowering brightness save battery?
Yes, on laptops the backlight consumes a significant portion of power. Reducing brightness from 100% to 50% can extend battery life by 10–20%, depending on the display.
Why does my brightness change when I plug in the charger?
Ubuntu’s power settings can automatically adjust brightness based on power source. You can disable this in Settings → Power, by turning off “Automatic Brightness” or adjusting the “On Battery” brightness level.
What is the difference between backlight and gamma brightness?
Backlight brightness controls the physical light output of the screen, which saves power. Gamma brightness adjusts the color lookup table, making the image darker but not reducing power consumption. The GNOME slider usually controls backlight on laptops, while xrandr adjusts gamma.