Revision: 53 http://svn.sourceforge.net/mactel-linux/?rev=53&view=rev Author: ludov Date: 2006-10-17 12:29:10 -0700 (Tue, 17 Oct 2006)
Log Message: ----------- set the keyboard brigthness on a Apple MacBook Pro computer Added Paths: ----------- trunk/tools/keyboard_brigthness Added: trunk/tools/keyboard_brigthness =================================================================== --- trunk/tools/keyboard_brigthness (rev 0) +++ trunk/tools/keyboard_brigthness 2006-10-17 19:29:10 UTC (rev 53) @@ -0,0 +1,54 @@ +#!/bin/bash + +# set the keyboard brigthness on a Apple MacBook Pro computer +# Copyright (C) 2006 Ludovic Rousseau <[EMAIL PROTECTED]> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +#set -v +#set -x +BRIGHTNESS=/sys/class/leds/smc\:kbd_backlight/brightness +value=$(cat $BRIGHTNESS) + +if [ -z "$1" ]; then + echo $value + exit +fi + +if [ "$1" = "-h" ]; then + echo "Usage: $0 [-h|arg|+arg|-arg]" + echo + echo "Change the keyboard brigthness to:" + echo " arg" + echo " or current value + arg" + echo " or current value - arg" + echo + echo "Without argument it return the current value" + exit +fi + +if [ $(expr match "$1" "[+-]") = "1" ]; then + value=$((value$1)) +else + value=$1 +fi + +if [ $value -lt 0 ]; then + value=0 +fi + +echo $value > $BRIGHTNESS +cat $BRIGHTNESS + Property changes on: trunk/tools/keyboard_brigthness ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Mactel-linux-devel mailing list Mactel-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mactel-linux-devel