Check-in [128b3464d3]
Not logged in

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

Overview

SHA1 Hash:128b3464d36fffb102340d9d39a2fdab81334520
Date: 2012-10-19 15:15:41
User: BarryK
Comment:fixed xgamma-gui, some more

Tags And Properties
Changes

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

@@ -31,10 +31,13 @@
 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 ' ')"
+inYRED="$YRED"
+inYGREEN="$YGREEN"
+inYBLUE="$YBLUE"
 
 echo $YGAMMA
 echo $YRED $YGREEN $YBLUE
 
 #transform y-->x values, 3 decimals precision, to get the current values;
@@ -48,25 +51,27 @@
 EXCODE="0"
 REDLABEL="$(gettext 'Red')"
 GREENLABEL="$(gettext 'Green')"
 BLUELABEL="$(gettext 'Blue')"
 
+APPLIEDFLAG='no'
 while [ "${EXCODE}" = "0" ]; do
 
  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
-
+ XGAMMA=$XDGOUT
  # substitute >space< for >/<, otherways there are problems to parse the string properly
  XGAMMA=$(echo $XGAMMA| sed 's:/: :g')
+
+ [ "${EXCODE}" != "0" ] && break
+
+ APPLIEDFLAG='yes'
+
  # cut in pieces (parse) and assign
  set -- ${XGAMMA// / }
  XRED=$1
  XGREEN=$2
  XBLUE=$3
@@ -84,10 +89,18 @@
 # 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
+if [ "$inYRED" = "$YRED" ];then
+ if [ "$inYGREEN" = "$YGREEN" ];then
+  if [ "$inYBLUE" = "$YBLUE" ];then
+   exit
+  fi
+ fi
+fi
+[ "$APPLIEDFLAG" = "no" ] && exit
 
 # 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