Mageia Bugzilla – Attachment 2097 Details for
Bug 5570
apple_bl module does not support Macbook Pro 8,2 laptops
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
A script to raise and lower the backlight values
apple_backlight.txt (text/plain), 1.65 KB, created by
Andy Liebman
on 2012-04-24 16:03:28 CEST
(
hide
)
Description:
A script to raise and lower the backlight values
Filename:
MIME Type:
Creator:
Andy Liebman
Created:
2012-04-24 16:03:28 CEST
Size:
1.65 KB
patch
obsolete
>#!/bin/bash > ># Anthony Fejes (apfejes@gmail.com) ># Template taken from post by Fran Diéguez at ># http://www.mabishu.com/blog/2010/06/24/macbook-pro-keyboard-backlight-keys-on-ubuntu-gnulinux/ ># ># This program just modifies the value of video brightness for Apple Laptops ># You must run it as root user or via sudo. ># As a shortcut you could allow to admin users to run via sudo without password ># prompt. To do this you must add sudoers file the next contents: ># ># ALL = NOPASSWD: /usr/sbin/apple_backlight > ># After this you can use this script as follows: ># ># Increase backlight keyboard: ># $ sudo apple_backlight up ># Decrease backlight keyboard: ># $ sudo apple_backlight down ># > >BACKLIGHT=$(cat /sys/class/backlight/gmux_backlight/brightness) >MAX=$(cat /sys/class/backlight/gmux_backlight/max_brightness) >MIN=0 >INCREMENT=5000 > ># if [ $UID -ne 0 ]; then ># echo "Please run this program as superuser" ># exit 1 ># fi > >case $1 in > > up) > TOTAL=`expr $BACKLIGHT + $INCREMENT` > if [ $BACKLIGHT -eq $MAX ]; then > exit 1 > fi > if [ $TOTAL -gt $MAX ]; then > let TOTAL=MAX > fi > echo $TOTAL > /sys/class/backlight/gmux_backlight/brightness > ;; > down) > TOTAL=`expr $BACKLIGHT - $INCREMENT` > if [ $BACKLIGHT -eq $MIN ]; then > exit 1 > fi > if [ $TOTAL -lt $MIN ]; then > let TOTAL=MIN > fi > echo $TOTAL > /sys/class/backlight/gmux_backlight/brightness > ;; > *) > echo "Use: apple_backlight up|down" > ;; >esac
#!/bin/bash # Anthony Fejes (apfejes@gmail.com) # Template taken from post by Fran Diéguez at # http://www.mabishu.com/blog/2010/06/24/macbook-pro-keyboard-backlight-keys-on-ubuntu-gnulinux/ # # This program just modifies the value of video brightness for Apple Laptops # You must run it as root user or via sudo. # As a shortcut you could allow to admin users to run via sudo without password # prompt. To do this you must add sudoers file the next contents: # # ALL = NOPASSWD: /usr/sbin/apple_backlight # After this you can use this script as follows: # # Increase backlight keyboard: # $ sudo apple_backlight up # Decrease backlight keyboard: # $ sudo apple_backlight down # BACKLIGHT=$(cat /sys/class/backlight/gmux_backlight/brightness) MAX=$(cat /sys/class/backlight/gmux_backlight/max_brightness) MIN=0 INCREMENT=5000 # if [ $UID -ne 0 ]; then # echo "Please run this program as superuser" # exit 1 # fi case $1 in up) TOTAL=`expr $BACKLIGHT + $INCREMENT` if [ $BACKLIGHT -eq $MAX ]; then exit 1 fi if [ $TOTAL -gt $MAX ]; then let TOTAL=MAX fi echo $TOTAL > /sys/class/backlight/gmux_backlight/brightness ;; down) TOTAL=`expr $BACKLIGHT - $INCREMENT` if [ $BACKLIGHT -eq $MIN ]; then exit 1 fi if [ $TOTAL -lt $MIN ]; then let TOTAL=MIN fi echo $TOTAL > /sys/class/backlight/gmux_backlight/brightness ;; *) echo "Use: apple_backlight up|down" ;; esac
View Attachment As Raw
Actions:
View
Attachments on
bug 5570
:
2079
|
2080
|
2093
|
2094
|
2095
|
2096
| 2097