Dave wrote:
copy and paste to a textfile named brightness
Code: Select all
#!/bin/bash
#Script for working brightness function keys
LEVEL=`cat /proc/acpi/video/VGA/LCD/brightness | grep current | cut -d : -f2 | grep -o [1-9].*`;
function up {
echo `expr"$LEVEL" +"10"` > /proc/acpi/video/OVGA/DD04/brightness;
}
function down {
echo `expr"$LEVEL" -"10"` > /proc/acpi/video/OVGA/DD04/brightness;
}
# Initializing variables
UP=false
DOWN=false
for args; do
case"$1" in
-u|--up) UP=true;;
-d|--down) DOWN=true;;
--) shift; break;;
-*) echo"Unrecognized option: $1"; ERROR=true;;
*) break;;
esac
shift
done
$UP && {
up;
exit;
}
$DOWN && {
down;
exit;
}
Ok, to make your function keys work
menu --> run
type: roxterm
checkoff: run as root
press: ok
type: root (THIS IS ROOT PASSWORD FOR DEMO, CHANGE WHEN INSTALLED)
type: cp ~/brightness /usr/local/bin/brightness
type: chmod 755 /usr/local/bin/brightness
type: chown root:users /proc/acpi/video/OVGA/DD04/brightness
type: exit
type: echo -n 50 > /proc/acpi/video/OVGA/DD04/brightness ( This is to verify that it can now be done by a user and change 50 to 100 to go back )
FIND FUNCTION KEY NAMES
type: xev
press: function key brightness up (XF86MonBrightnessUp)
output should show
Code: Select all
KeyRelease event, serial 37, synthetic NO, window 0x1800001,
root 0x15d, subw 0x0, time 797893, (-283,347), root:(595,369),
state 0x0, keycode 233 (keysym 0x1008ff02, XF86MonBrightnessUp), same_screen YES,
XLookupString gives 0 bytes:
XFilterEvent returns: False
your key name will be in the same spot as XF86MonBrightnessUp, though it may not be the same
copy: XF86MonBrightnessUp section
press: Control + C
WINDOW MANAGER DEPENDANT
For FLUXBOX do
type: leafpad ~/.fluxbox/keys
find: the bottom line ( new line )
paste: (previously copied)
type: " :Exec brightness -u" 1 space, 1 colon,"Exec", 1 space,"-u" behind what was just pasted
EG:
Code: Select all
XF86MonBrightnessUp :Exec brightness -u
save and close
For ICEWM do
type: leafpad ~/.icewm/keys
find: the bottom line ( new line )
type:"key"""key", 1 space, one quotation mark
paste: (previously copied) behind what was just typed
type:"" brightness -u" 1 quotation mark, 1 space,"brightness", 1 space,"-u"
EG:
Code: Select all
key"XF86MonBrightnessUp" brightness -u
save and close
For brightness down repeat steps from FIND FUNCTION KEY NAMES with the following changes
1. press function key down instead of up (XF76MonBrightnessDown)
2. change all"brightness -u" sections to"brightness -d"
NOTES:
- The brightness code from above will decrease / increase screen brightness by increments of ten
- You will need to restart the window manager for the keys to begin to work
Fluxbox
menu --> Fluxbox Settings-->restart
Icewm
menu --> logout -->restart icewm