Flickr Photos

Young Red Fox
Red Fox eating rowan berries
Roe Deer
Leopard in the rain
Lion mum taking care of cubs
Male Lion
Lion Cubs Playing
Leopard
Lazy Spotted Hyena
Female Lion
Cheetah
Golden Jackal

Linux: Adjust LCD laptop backlight brightness from command line

I needed to find out how can I change my laptop backlight brighness using just a command line. Solution for that problem was easier than I thought because you can do
that just with one line =)

On my laptop which is Dell Latitude D430 brigness file was on /sys/class/backlight/dell_backlight directory but it’s probably almost on the same place /sys/class/backlight/ on every laptop (and linux distribution) which is it possible to change.

Before you start to change your laptop display brightness you should find out which is the maximum brigness of your screen which you can see with cat command from the max_brigtness file like this:

cat /sys/class/backlight/dell_backlight/max_brightness

On my laptop max brightness was 7 and surprisingly lowest brightness is 0 so let’s change brightness between 0-7 =)

So if I want to save energy and turn backlight as dark as possible I just put 0 to brightness file like this:

echo 0 > /sys/class/backlight/dell_backlight/brightness

and when I want full brightness I just write seven to that same file:

echo 7 > /sys/class/backlight/dell_backlight/brightness

Just be sure that you use > and not >> because >> will just add that number on that file and now we want to remove the old number and add new one there.

So why I needed to do this? I had a script which was checking some things and alert me when something wrong happened so instead of email/sms alerts or audio alerts I just wrote a script which keeps my display as dark as possible and when it needs my attenion it will turn brighness to max and show alerts on display =)

5 comments to Linux: Adjust LCD laptop backlight brightness from command line

  • Anonymous

    Hello! This post could not be written any better!
    Reading this post reminds me of my good old room mate! He always kept chatting about this.

    I will forward this article to him. Pretty sure he will
    have a good read. Many thanks for sharing!

  • Binyul

    it doesn’t work.
    even running as root doesn’t work as well.

  • Thanks , I’ve recently been searching for info approximately this subject for a long time and yours is the greatest I have discovered so far. But, what concerning the conclusion? Are you sure in regards to the source?

  • KerrnelPanic

    I have the same problem as Binyul described on my RV511…
    I noticed that my OS is actually capable of manipulating brightness since I added the notorious “acpi_backlight=vendor” flag in grub. Since doing that, brightness changes when booting and sets the brightnes that has been set before reboot.
    I’ll describe further:
    1. I try to use the fn Keys to change brightness when OS is running. A pop up apears with a brightness indicator and the indicator changes, but thats all, screen brightnes stays the same
    2. I reboot the system. While rebooting, brightness changes and it changes to the last value that was set with the keys and indicated by that pop up
    3. I then cannot change brightness when OS is running, but when suspending and waking up again, brightness is set to max
    So, to change brightness, the only way is to reboot the whole system…
    I read about systemd changing brightness to the same level as it was when shutting down, I guess this is why brightness changes on reboot, but I didn’t find out what systemd does and how I can do this when I’m logged in.

    Resuming in non X mode: xrandr not found. For package install advice run: inxi –recommends
    System: Host: Samsung_RV511S02 Kernel: 4.14.27-1-MANJARO x86_64 bits: 64 Desktop: N/A
    Distro: Manjaro Linux
    Machine: Device: laptop System: SAMSUNG product: RV411/RV511/E3511/S3511/RV711/E3411 serial: N/A
    Mobo: SAMSUNG model: RV411/RV511/E3511/S3511/RV711/E3411 serial: N/A
    BIOS: Phoenix v: 07PA.M014.20121127.XW date: 11/27/2012
    Battery BAT1: charge: 21.2 Wh 98.0% condition: 21.6/47.5 Wh (45%)
    CPU: Dual core Intel Core i3 M 380 (-MT-MCP-) cache: 3072 KB
    clock speeds: max: 2533 MHz 1: 1074 MHz 2: 1323 MHz 3: 1245 MHz 4: 1158 MHz
    Graphics: Card: NVIDIA GT218M [GeForce 315M]
    Display Server: N/A driver: nvidia tty size: 107×16
    Audio: Card-1 NVIDIA High Def. Audio Controller driver: snd_hda_intel
    Card-2 Intel 5 Series/3400 Series High Def. Audio driver: snd_hda_intel
    Sound: Advanced Linux Sound Architecture v: k4.14.27-1-MANJARO
    Network: Card-1: Qualcomm Atheros AR9485 Wireless Network Adapter driver: ath9k
    IF: wlp3s0 state: up mac: 44:6d:57:88:18:de
    Card-2: Realtek RTL8111/8168/8411 PCIE Gigabit Ethernet Controller driver: r8168
    IF: enp5s0 state: down mac: e8:11:32:17:f5:2b
    Drives: HDD Total Size: 120.0GB (5.5% used)
    ID-1: /dev/sda model: ADATA_SSD_S510_1 size: 120.0GB
    Partition: ID-1: / size: 67G used: 6.1G (10%) fs: ext4 dev: /dev/sda4
    Sensors: System Temperatures: cpu: 53.0C mobo: 53.0C gpu: 55C
    Fan Speeds (in rpm): cpu: N/A
    Info: Processes: 151 Uptime: 9 min Memory: 1124.4/7841.6MB Init: systemd
    Client: Shell (bash) inxi: 2.3.56

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>