Difference between revisions of "Samsung R505 Aura"

From ArchWiki
Jump to: navigation, search
m (moved Samsung aura r505 to Samsung R505 Aura: stupid typo)
(added categories)
Line 1: Line 1:
 +
[[Category:Laptops (English)]]
 +
[[Category:Samsung (English)]]
 +
 
===LCD Brightness===
 
===LCD Brightness===
  

Revision as of 21:55, 29 April 2011


LCD Brightness

LCD brightness information can be found in the following files:

/sys/devices/virtual/backlight/acpi_video/brightness
/sys/devices/virtual/backlight/acpi_video/actual_brightness
/sys/devices/virtual/backlight/acpi_video/max_brightness

Since the Fn + Up, Down buttons seem unwilling to work, you can also do the following to adjust the brighness:

# echo <Number> > /sys/devices/virtual/backlight/acpi_video/brightness

If you have tried this already, you have probably received an error message saying something like "permission denied". Therefore, you first have to change the file owner of /sys/devices/virtual/backlight/acpi_video/brightness to your username. You can do this by

# sudo chown <usrname> /sys/class/backlight/acpi_video0/brightness

where <usrname> is the name of your user. For some reason, the file in question is recreated (or restored) on every startup, so you have to perform this command once a session, before you can change your screen brightness. Therefore it might be a good idea to save it under an alias in your .bashrc.

Also, the above command for changing the brightness is not very handy, but this can be fixed with a few shell-scripts designed for this purpose. Consider the following as examples that you may alter to fit your needs.


 [brightnessUp]
 #!bin/bash
 b=`head -1 /sys/class/backlight/acpi_video0/brightness` 
 mb=`head -1 /sys/class/backlight/acpi_video0/max_brightness` 
 if [ $b -lt $mb ] 
 then
     nb=`expr $b + 1`
 else
     nb=`expr $b`
 fi 
 echo $nb > /sys/class/backlight/acpi_video0/brightness
 
 [brightnessDown]
 #!bin/bash
 b=`head -1 /sys/class/backlight/acpi_video0/brightness` 
 mb=0
 if [ $b -gt $mb ] 
 then
     nb=`expr $b - 1`
 else
     nb=`expr $b`
 fi 
 echo $nb > /sys/class/backlight/acpi_video0/brightness
 
 [brightnessSet]
 #!bin/bash
 mb=`head -1 /sys/class/backlight/acpi_video0/max_brightness` 
 if [ $# -ne 1 ]
 then
   echo "Usage: brightnessSet {val}"
 else
     if ([ $1 -le $mb ] && [ $1 -ge 0 ])
     then
         echo $1 > /sys/class/backlight/acpi_video0/brightness   
     else
         echo "error: specify brightness in [0-$mb]"
     fi 
 fi
 
 [brightnessGet]
 #!bin/bash
 b=`head -1 /sys/class/backlight/acpi_video0/brightness` 
 mb=`head -1 /sys/class/backlight/acpi_video0/max_brightness` 
 echo "current screen brightness: $b of $mb"
 

Using these and defining aliases for these scripts in your .bashrc you can easily control your screen brightness form your terminal. Now you can, of course, define keybindings to these scripts if you wish, and thus control your screen brightness directly via keyboard.