summaryrefslogtreecommitdiff
path: root/config/PreSession.in
diff options
context:
space:
mode:
authorBrian Cameron <brian.cameron@sun.com>2006-01-30 21:44:42 +0000
committerBrian Cameron <bcameron@src.gnome.org>2006-01-30 21:44:42 +0000
commitb45f562715f17968e24385aeb0181d7954415cba (patch)
tree2391c349b349b1f6a15bc37d379bcb2f3db07242 /config/PreSession.in
parent6df255b43576e3c57c8c30b3ac54b1d7478df6a3 (diff)
downloadgdm-b45f562715f17968e24385aeb0181d7954415cba.tar.gz
Fix so it no longer tries to access the config file via grep/sed. Now it
2006-01-30 Brian Cameron <brian.cameron@sun.com> * config/PreSession.in: Fix so it no longer tries to access the config file via grep/sed. Now it calls 'gdmflexiserver --command="GET_CONFIG"', which is a much cleaner way to get the info in needs to set the background color.
Diffstat (limited to 'config/PreSession.in')
-rwxr-xr-xconfig/PreSession.in35
1 files changed, 28 insertions, 7 deletions
diff --git a/config/PreSession.in b/config/PreSession.in
index 44ee9607..e2e7e50c 100755
--- a/config/PreSession.in
+++ b/config/PreSession.in
@@ -25,21 +25,42 @@ gdmwhich () {
echo "$OUTPUT"
}
+# Set background color
XSETROOT=`gdmwhich xsetroot`
if [ "x$XSETROOT" != "x" ] ; then
- # Try to snarf either the plain or themed background color from the config file
- if [ "x$GDM_GREETER_TYPE" = "xPLAIN" ]; then
+
+ CHECKBACKCOLOR="OK"
+ if [ "x$GDM_GREETER_TYPE" = "xTHEMED" ]; then
+ BACKCOLOR=`gdmflexiserver --command="GET_CONFIG greeter/GraphicalThemedColor"`
+
+ CHECKBACKCOLOR=`echo $BACKCOLOR | sed 's/^\([^ ]*\) .*$/\1/'`
+ if [ "x$CHECKBACKCOLOR" = "xOK" ]; then
+ BACKCOLOR=`echo $BACKCOLOR | sed 's/^.* \(.*\)$/\1/'`
+ else
+ BACKCOLOR=""
+ fi
+ fi
+
+ # If we tried to load the themed backgroundcolor, but failed, then try loading plain color
+ if [ "x$CHECKBACKCOLOR" != "xOK" ] || [ "x$GDM_GREETER_TYPE" = "xPLAIN" ]; then
+
# Background type can be 0=None, 1=Image & Color, 2=Color, or 3=Image
- BACKTYPE=`grep '^BackgroundType' @EXPANDED_SYSCONFDIR@/gdm/gdm.conf | sed 's/^.*=\(.*\)$/\1/'`
+ BACKTYPE=`gdmflexiserver --command="GET_CONFIG greeter/BackgroundType"`
# Skip if background type does not include a color
- if [ "x$BACKTYPE" != "x0" ] && [ "x$BACKTYPE" != "x3" ]; then
- BACKCOLOR=`grep '^BackgroundColor' @EXPANDED_SYSCONFDIR@/gdm/gdm.conf | sed 's/^.*=\(.*\)$/\1/'`
+ if [ "x$BACKTYPE" = "xOK 1" ] || [ "x$BACKTYPE" = "xOK 2" ]; then
+ BACKCOLOR=`gdmflexiserver --command="GET_CONFIG greeter/BackgroundColor"`
+
+ CHECKBACKCOLOR=`echo $BACKCOLOR | sed 's/^\([^ ]*\) .*$/\1/'`
+ if [ "x$CHECKBACKCOLOR" = "xOK" ]; then
+ BACKCOLOR=`echo $BACKCOLOR | sed 's/^.* \(.*\)$/\1/'`
+ else
+ BACKCOLOR=""
+ fi
fi
- elif [ "x$GDM_GREETER_TYPE" = "xTHEMED" ]; then
- BACKCOLOR=`grep '^GraphicalThemedColor' @EXPANDED_SYSCONFDIR@/gdm/gdm.conf | sed 's/^.*=\(.*\)$/\1/'`
fi
+ # Default value
if [ "x$BACKCOLOR" = "x" ]; then
BACKCOLOR="#76848F"
fi