If you’re running Linux and prefer using the command line, adjusting your monitor’s brightness without a GUI is not only possible—it’s often faster and more efficient. Whether you’re scripting your system setup, working on a headless machine, or just like keeping your hands on the keyboard, here’s how to control your screen brightness via the terminal.
Method 1: Using xrandr
(for X11 systems)
If you’re running a desktop environment that uses X11 (which many do), xrandr
is the go-to tool.
Step 1: Find your display name
Open a terminal and run:
xrandr --current
Look for the connected display—usually something like eDP-1
, HDMI-1
, or DP-1
.
Step 2: Set brightness
Once you have the display name, adjust the brightness (0.0 to 1.0):
xrandr --output eDP-1 --brightness 0.7
This example sets brightness to 70%. Note: this doesn’t change hardware brightness, just software gamma, which may affect video playback and color accuracy.
Method 2: Writing directly to /sys/class/backlight
(for hardware-level control)
This method is more reliable on laptops and adjusts actual backlight brightness.
Step 1: Find the backlight device
Run:
ls /sys/class/backlight/
You’ll see a folder like intel_backlight
or acpi_video0
.
Step 2: Check current and max brightness
cat /sys/class/backlight/intel_backlight/max_brightness
cat /sys/class/backlight/intel_backlight/brightness
Step 3: Set brightness
You need root permissions:
echo 300 | sudo tee /sys/class/backlight/intel_backlight/brightness
Replace 300
with a value between 0 and the max brightness you found earlier.
⚠️ Important: Be careful not to set brightness too low or you might not see your screen at all.
Method 3: Using brightnessctl
(more user-friendly)
If you want a safer tool that handles permissions and scales brightness levels automatically:
Step 1: Install it
On Ubuntu/Debian:
sudo apt install brightnessctl
On Arch:
sudo pacman -S brightnessctl
Step 2: Use it
brightnessctl set 50%
brightnessctl set +10%
brightnessctl set 300 # raw value
You can also check current settings with:
brightnessctl
Wrap-Up
Command-line brightness control in Linux gives you flexibility, especially when working with scripts, automation, or minimal setups. Whether you prefer direct control through /sys
, a simpler interface like brightnessctl
, or quick gamma adjustments with xrandr
, there’s a method that fits your needs.
Have questions or want to see how this fits into a script or startup config? Drop a comment below.
Leave a Reply