to adjust brightness on my laptop.
So, what I have to do is: change to /dev/tty1, adjust brightness, change back into X.
I created a script called 'dim', and set sudo to allow it to be run without password
for me:
#!/bin/bash
if [ "x$1" == "x" ]
then
cat /proc/acpi/video/PEGP/LCD/brightness
exit;
fi
if [ "x$DISPLAY" != "x" ]
then
chvt 1
fi
echo -n $1 > /proc/acpi/video/PEGP/LCD/brightness
if [ "x$DISPLAY" != "x" ]
then
chvt 8
fi
No comments:
Post a Comment