op_lcdsettings.sh: Added "simple" Gamma Settings
[openpandora.oe.git] / recipes / pandora-system / pandora-scripts / op_lcdsettings.sh
index 12b318e..fd419fb 100644 (file)
@@ -1,11 +1,11 @@
 #!/bin/bash
 # Released under the GPL
-# LCD-Settings, v1.0, written by Michael Mrozek aka EvilDragon 2010. Brightness-Settings-Part written by vimacs.
+# LCD-Settings, v1.1, written by Michael Mrozek aka EvilDragon 2010. Brightness-Settings-Part written by vimacs.
 # This scripts allows you to create, load and save Gamma-Settings and to change the LCD Brightness.
 
 . /usr/pandora/scripts/op_paths.sh
 
-while mainsel=$(zenity --title="LCD-Settings" --width="300" --height="300" --list --column "id" --column "Please select" --hide-column=1 --text="Welcome to the LCD-Settings-Dialogue.\n\nWhat do you want to do?\n" "bright" "Change LCD Brightness" "gamma" "Manage LCD Gamma" "filter" "Select current video filter" "filterdef" "Select default video filter" "sblank" "Enable/disable screen blanking" --ok-label="Change Setting" --cancel-label="Exit"); do
+while mainsel=$(zenity --title="LCD-Settings" --width="300" --height="330" --list --column "id" --column "Please select" --hide-column=1 --text="Welcome to the LCD-Settings-Dialogue.\n\nWhat do you want to do?\n" "bright" "Change LCD Brightness" "gammasimple" "Manage LCD Gamma (simple)" "gamma" "Manage LCD Gamma (Advanced)" "filter" "Select current video filter" "filterdef" "Select default video filter" "sblank" "Enable/disable screen blanking" --ok-label="Change Setting" --cancel-label="Exit"); do
 
 case $mainsel in
 
@@ -99,6 +99,15 @@ case $mainsel in
          zenity --info --title="Screen blanking" --text "The automatic screen blanking has been disabled." --timeout 6
          DISPLAY=:0 xset s off
        fi;;
+
+     "gammasimple")
+     dsscurr=$(cat /etc/pandora/conf/dssgamma.state)
+     while dssgamma=$(zenity --scale --text "Set Quick Gamma (Standard: 100)\n\nPress Ok to apply and Cancel to go back to the main menu." --min-value=0 --max-value=200 --value=$dsscurr --step 1); do
+     dssgamma2=$(echo "scale=2;$dssgamma / 100" | bc)
+     dsscurr=$dssgamma
+     echo $dsscurr > /etc/pandora/conf/dssgamma.state
+     sudo /usr/pandora/scripts/op_gamma.sh $dssgamma2
+     done;;
 esac
 done