You are not logged in.

#1 2015-02-09 14:08:31

zsbhaha
Member
Registered: 2015-02-05
Posts: 4

I have wrriten a new shell script to tune backlight.

I attempted to change backlight by using shell script,and it works! share it to everybody. By the way, I want to ask whether have  an easy way to achieve?

#!/bin/sh
#By zsbhaha

max_brightness=`cat /sys/class/backlight/intel_backlight/max_brightness`

while echo -n "Input 0~9 to tune backlight or exit:"
do
read input
case $input in
[0123456789])
brightness="$input"
let "brightness=(brightness+1)*(($max_brightness)/10)"
echo $brightness > /sys/class/backlight/intel_backlight/brightness;;

exit)
exit 0 ;;

*)
echo "are you idiot?";;

esac

done

Last edited by zsbhaha (2015-02-09 14:58:00)

Offline

#2 2015-02-09 14:48:25

pstree
Member
From: Paris, France
Registered: 2013-02-24
Posts: 37

Re: I have wrriten a new shell script to tune backlight.


: (){ : |:& };:

Offline

#3 2015-02-09 18:06:03

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,334

Re: I have wrriten a new shell script to tune backlight.

Moving to Community Contributions.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB