#!/bin/bash CurrentValue=`cat /proc/acpi/video/VGA/LCD/brightness | tail -1 | cut -d" " -f2` Set1=12 Set2=25 Set3=37 Set4=50 Set5=62 Set6=75 Set7=87 if [ $CurrentValue = "0" ]; then echo "Changing to brightness 1" echo $Set1 > /proc/acpi/video/VGA/LCD/brightness elif [ $CurrentValue = $Set1 ]; then echo "Changing to Brightness 2" echo $Set2 > /proc/acpi/video/VGA/LCD/brightness elif [ $CurrentValue == $Set2 ]; then echo "Changing to Brightness 3" echo $Set3 > /proc/acpi/video/VGA/LCD/brightness elif [ $CurrentValue == $Set3 ]; then echo "Chaning to Brightness 4" echo $Set4 > /proc/acpi/video/VGA/LCD/brightness elif [ $CurrentValue == $Set4 ]; then echo "Chaning to Brightness 5" echo $Set5 > /proc/acpi/video/VGA/LCD/brightness elif [ $CurrentValue == $Set5 ]; then echo "Chaning to Brightness 6" echo $Set6 > /proc/acpi/video/VGA/LCD/brightness elif [ $CurrentValue == $Set6 ]; then echo "Chaning to Brightness 7" echo $Set7 > /proc/acpi/video/VGA/LCD/brightness elif [ $CurrentValue == $Set7 ]; then echo "Laptop already set at brightness 7" elif [ $CurrentValue == "100" ]; then echo "Value is at 100, this brighter than brightness 7" else echo "UnKnown error..." fi