Smaller brightness steps with the Asus N56VB and Ubuntu

Ubuntu on the laptop is definitely maturing. We’re way past “at least it boots” and now that survival is ensured, it is time for luxury illnesses. One of those on the Asus N56VB is handling of screen brightness which, for my taste, comes in too steep steps. Especially the minimum brightness is still too bright for nocturnals like me.

Thankfully that is not some hardware limitation, so we can get around it with a script:

#!/bin/bash

user=`whoami`

if [ "$user" != "root" ]; then
echo Re-running as root
sudo $0 $1
exit 0
fi

command=$1
increment=1
B=/sys/class/backlight/acpi_video1/brightness
brightness=`cat $B`

case "$command" in
up)
brightness=`expr $brightness + $increment`
echo $brightness > $B
;;
down)
brightness=`expr $brightness - $increment`
echo $brightness > $B
;;
*)
echo supply up or down
;;
esac

You can bind a call to the script such as:

brightness.sh down

or

brightness.sh up

to a key shortcut and handle brightness changes with that script. If you feel the increment of 1 is too low, you can change it in the script too.

[2014.07.26]
Script is now available on github https://github.com/ggeorgovassilis/linuxscripts

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s