Check-in [c238a7cbeb]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

SHA1 Hash:c238a7cbeb4e370a168b101446766612082ff506
Date: 2012-10-19 14:44:44
User: BarryK
Comment:fixed xgamma-gui

Tags And Properties
Changes

Changes to woof-code/rootfs-skeleton/usr/sbin/xgamma-gui

@@ -1,66 +1,99 @@
 #!/bin/bash
 #Written by PANZERKOPF
 #100215 hacked by BK
-#120330 L18L: internationalized.
-#120507 L18L: 10.0 = 100 using bc now because: Gamma values must be between 0.100 and 10.000 L18L
-
-. gettext.sh
+#101207 hacked by EW
+#121019 BK: fixed. internationalized.
+
+#101207 EW:
+# this is a Xdialog frontend for the xgamma program - setting colour calibration for the screen
+# It is using the 3 RGB channels
+# xgamma uses a logharithmic scale for the gamma values (0.1 - darkest, 1.0 - default, 10.0 - brightest) -> Y Values
+# The GUI uses a linear scale (going from -100 - darkest, 0.0 - default, +100 - brightest) -> X Values
+# The transformation is given by Y=10^(X/100)
+# the calculation has to be performed with bc,
+# to use decimal values in the exponent the equation must be rewritten Y = exp ( X/100 * log (10))
+# or, setting the precision to 3 decimal points using bc command: Y=$(echo "e( "$X"/100 * l(10))" | bc -l)
+# The reverse transformation is XRED=$(echo "scale:0; 100 * l($YRED) / l(10)" | bc -l)
+
 export TEXTDOMAIN=xgamma-gui
 export OUTPUT_CHARSET=UTF-8
 
 TITLE="$(gettext 'Monitor Gamma calibration')"
-BACKTITLE="$(gettext 'Set percentage value for each colour,\nor adjust equally if only want to adjust\nbrightness of screen')"
+BACKTITLE="$(gettext 'Set value for each colour, or adjust equally if only want to adjust brightness of screen.')
+$(gettext 'The spinboxes are adjustable in the range -100 to +100, where -100 is darkest, 0 is default, and +100 is brightest.')"
 
 if [ "`which xgamma`" = "" ]; then
  Xdialog --title "${TITLE}" --msgbox "$(gettext 'xgamma not found.')" 0 0
  exit
 fi
 
-GAMMA='100/100/100' # percentages
-#file contains one line like this: xgamma -rgamma 1.00 -ggamma 1.00 -bgamma 1.00 #100/100/100
-#file contains one line like this: xgamma -rgamma 10.00 -ggamma 9.90 -bgamma 10.00 #100/99/100
-[ -f $HOME/.xgamma-gamma ] && GAMMA="`cat $HOME/.xgamma-gamma | cut -f 2 -d '#'`"
+#get current settings (for startup)
+YGAMMA="$(xgamma 2>&1 | tr -s ' ' | sed -e 's%[^0-9. ]%%g' | tr -s ' ')" #ex:  10.000  1.000  1.000
+
+YRED="$(echo "$YGAMMA" | cut -f 2 -d ' ')"
+YGREEN="$(echo "$YGAMMA" | cut -f 3 -d ' ')"
+YBLUE="$(echo "$YGAMMA" | cut -f 4 -d ' ')"
+
+echo $YGAMMA
+echo $YRED $YGREEN $YBLUE
+
+#transform y-->x values, 3 decimals precision, to get the current values;
+XRED=$(echo "scale=3; 100 * l("$YRED") / l(10)" | bc -l)
+XRED=$(echo "scale=0; "$XRED"/1" | bc -l) # cut decimals
+XGREEN=$(echo "scale=3; 100 * l("$YGREEN") / l(10)" | bc -l)
+XGREEN=$(echo "scale=0; "$XGREEN"/1" | bc -l) # cut decimals
+XBLUE=$(echo "scale=3; 100 * l("$YBLUE") / l(10)" | bc -l)
+XBLUE=$(echo "scale=0; "$XBLUE"/1" | bc -l) # cut decimals
 
 EXCODE="0"
+REDLABEL="$(gettext 'Red')"
+GREENLABEL="$(gettext 'Green')"
+BLUELABEL="$(gettext 'Blue')"
+
 while [ "${EXCODE}" = "0" ]; do
 
- if [ ! -z ${xGAMMA} ]; then
-  echo ${xGAMMA}
-  #xgamma -rgamma ${xGAMMA:0:1}.${xGAMMA:1:2} -ggamma ${xGAMMA:4:1}.${xGAMMA:5:2} -bgamma ${xGAMMA:8:1}.${xGAMMA:9:2}
-  rg=`echo ${xGAMMA} | cut -d '/' -f1` ; rgf=`echo "scale=3; $rg / 10" | bc -l`
-  gg=`echo ${xGAMMA} | cut -d '/' -f2` ; ggf=`echo "scale=3; $gg / 10" | bc -l`
-  bg=`echo ${xGAMMA} | cut -d '/' -f3` ; bgf=`echo "scale=3; $bg / 10" | bc -l`
-  xgamma -rgamma $rgf -ggamma $ggf -bgamma $bgf
-  sGAMMA=${xGAMMA}
-  xgamma
- #fi
- else # inclusion of this block is new
-  #echo GAMMA=$GAMMA
-  rg=`echo ${GAMMA} | cut -d '/' -f1` ; rgf=`echo "scale=3; $rg / 10" | bc -l`
-  gg=`echo ${GAMMA} | cut -d '/' -f2` ; ggf=`echo "scale=3; $gg / 10" | bc -l`
-  bg=`echo ${GAMMA} | cut -d '/' -f3` ; bgf=`echo "scale=3; $bg / 10" | bc -l`
- fi
-# xGAMMA=`Xdialog --screen-center --left --backtitle "${BACKTITLE}" --title "${TITLE}" --stdout --buttons-style "text" --icon "/usr/share/images/xgamma-gui.xpm" --ok-label "$(gettext 'Apply')" --cancel-label "$(gettext 'Exit')" \
-#--3spinsbox "" 0 0 "0" "199" "${GAMMA:0:3}" "$(gettext 'Red')" "0" "199" "${GAMMA:4:3}" "$(gettext 'Green')" "0" "199" "${GAMMA:8:3}" "$(gettext 'Blue')"`
- xGAMMA=`Xdialog --screen-center --left --backtitle "${BACKTITLE}" --title "${TITLE}" --stdout --buttons-style "text" --icon "/usr/share/images/xgamma-gui.xpm" --ok-label "$(gettext 'Apply')" --cancel-label "$(gettext 'Exit')" \
---3spinsbox "" 0 0 "0" "100" "${rg}" "$(gettext 'Red')" "0" "100" "${gg}" "$(gettext 'Green')" "0" "100" "${bg}" "$(gettext 'Blue')"`
+ XDGOUT=`Xdialog  --wrap --left --backtitle "${BACKTITLE}" --title "${TITLE}" --stdout --buttons-style "text" --icon "/usr/share/images/xgamma-gui.xpm" --ok-label "Apply" --cancel-label "Exit" \
+--3spinsbox "" 356x0 "-100" "100" "$XRED" "${REDLABEL}" "-100" "100" "$XGREEN" "${GREENLABEL}" "-100" "100" "$XBLUE" "${BLUELABEL}"`
+
+ # get exit code
  EXCODE=${?}
 
+ # only remember the output XDGOUT if "Apply" was pressed.
+ if [ "${EXCODE}" = "0" ]; then
+  XGAMMA=$XDGOUT
+ fi
+
+ # substitute >space< for >/<, otherways there are problems to parse the string properly
+ XGAMMA=$(echo $XGAMMA| sed 's:/: :g')
+ # cut in pieces (parse) and assign
+ set -- ${XGAMMA// / }
+ XRED=$1
+ XGREEN=$2
+ XBLUE=$3
+
+ # make transformation x-->y
+ YRED=$(echo "scale=3; e( "$XRED"/100 * l(10))" | bc -l)
+ YGREEN=$(echo "scale=3; e( "$XGREEN"/100 * l(10))" | bc -l)
+ YBLUE=$(echo "scale=3; e( "$XBLUE"/100 * l(10))" | bc -l)
+
+ #apply gamma values
+ xgamma -rgamma ${YRED} -ggamma ${YGREEN} -bgamma ${YBLUE}
+
 done
 
-if [ ! -z ${sGAMMA} ]; then
- #Xdialog --yesno "$(gettext 'Save current configuration?')" 0 0
- Xdialog --ok-label "$(gettext 'Yes')" --cancel-label "$(gettext 'No')" --yesno "$(gettext 'Save current configuration?')" 0 0
-  if [ ${?} -eq 0 ]; then
-   #echo -n "xgamma -rgamma ${sGAMMA:0:1}.${sGAMMA:1:2} -ggamma ${sGAMMA:4:1}.${sGAMMA:5:2} -bgamma ${sGAMMA:8:1}.${sGAMMA:9:2}"' &' > $HOME/.xgamma-gamma
-   #echo -n "xgamma -rgamma $rg -ggamma $gg -bgamma $bg"' &' > $HOME/.xgamma-gamma
-   echo -n "xgamma -rgamma $rgf -ggamma $ggf -bgamma $bgf"' &' > $HOME/.xgamma-gamma
-   echo " #${sGAMMA}" >> $HOME/.xgamma-gamma
-   #...xgamma is executed in /root/.xinitrc
-   echo "$(gettext 'Saved')"
-   #ummm, but if defaults, don't need xgamma...
-   [ "$sGAMMA" = "100/100/100" ] && rm -f $HOME/.xgamma-gamma #saves time in .xinitrc
-  fi
+# if default values we dont need xgamma at startup, so remove the file. This saves time in .xinitrc
+if [ "$XGAMMA" = "0 0 0" ]; then
+	rm -f $HOME/.xgamma-gamma
+	exit
+fi
+
+# else ask if we want to save the current values and create a startup calibration file
+Xdialog --yesno "$(gettext 'Save current configuration?')" 0 0
+if [ ${?} -eq 0 ]; then
+  echo -n "xgamma -rgamma $YRED -ggamma $YGREEN -bgamma $YBLUE"' &' > $HOME/.xgamma-gamma
+  #...xgamma is executed in /root/.xinitrc
+  echo "Saved"
 fi
 
 ###END###
+

Changes to woof-distro/Packages-puppy-noarch-official

@@ -23,11 +23,11 @@
 desk_icon_theme_smooth_color-1|desk_icon_theme_smooth_color|1||Desktop|276K||desk_icon_theme_smooth_color-1.pet||desktop and menu icons||||
 desk_icon_theme_stardust-2|desk_icon_theme_stardust|2||Desktop|292K||desk_icon_theme_stardust-2.pet||desktop and menu icons||||
 desk_icon_theme_stark042-1|desk_icon_theme_stark042|1||Desktop|492K||desk_icon_theme_stark042-1.pet|+gtk+|black-white-orange line-art style icons, based on area042 icons||||
 desk_icon_theme_malays_uniblack-1|desk_icon_theme_malays_uniblack|1||Desktop|264K||desk_icon_theme_malays_uniblack-1.pet||desktop and menu icons, black lines, put together by vicmz||||
 desk_icon_theme_malays_uniblue-1|desk_icon_theme_malays_uniblue|1||Desktop|332K||desk_icon_theme_malays_uniblue-1.pet||desktop and menu icons, pale blue lines, put together by vicmz||||
-desk_icon_theme_neon-1|desk_icon_theme_neon|1||Desktop|212K||desk_icon_theme_neon-1.pet||desktop and menu icons, put together by vicmz||||
+desk_icon_theme_neon-2|desk_icon_theme_neon|2||Desktop|224K||desk_icon_theme_neon-2.pet||desktop and menu icons, put together by vicmz. bk: saturation 100||||
 desk_icon_theme_neu-1|desk_icon_theme_neu|1||Desktop|172K||desk_icon_theme_neu-1.pet||desktop and menu icons, modern multi-color, put together by jemimah||||
 desk_icon_theme_shining_silver-1|desk_icon_theme_shining_silver|1||Desktop|272K||desk_icon_theme_shining_silver-1.pet||desktop and menu icons, silver-color with blue highlights, put together by vicmz||||
 ffconvert-1.3|ffconvert|1.3||Multimedia|368K||ffconvert-1.3.pet|+ffmpeg|FFConvert multimedia converter||||
 ffconvert_NLS-1.2.1|ffconvert_NLS|1.2.1||Multimedia|304K||ffconvert_NLS-1.2.1.pet|ffconvert|FFConvert multimedia converter||||
 firmware_linux_module_agrmodem-20121004|firmware_linux_module_agrmodem|20121004||BuildingBlock|24K||firmware_linux_module_agrmodem-20121004.pet||kernel-independent modem driver components, created by rerwin||||