diff options
author | Brian Cameron <brian.cameron@sun.com> | 2006-01-30 21:44:42 +0000 |
---|---|---|
committer | Brian Cameron <bcameron@src.gnome.org> | 2006-01-30 21:44:42 +0000 |
commit | b45f562715f17968e24385aeb0181d7954415cba (patch) | |
tree | 2391c349b349b1f6a15bc37d379bcb2f3db07242 | |
parent | 6df255b43576e3c57c8c30b3ac54b1d7478df6a3 (diff) | |
download | gdm-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.
-rw-r--r-- | ChangeLog | 13 | ||||
-rwxr-xr-x | config/PreSession.in | 35 |
2 files changed, 39 insertions, 9 deletions
@@ -1,5 +1,13 @@ 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. + +2006-01-30 Brian Cameron <brian.cameron@sun.com> + * gui/greeter/themes/happygnome/options.png, gui/greeter/themes/happygnome-list/options.png: Adding back the previous sessions.png as @@ -106,8 +114,9 @@ 2006-01-18 Brian Cameron <brian.cameron@sun.com> - * daemon/gdm.c, daemon/slave.c, gui/greeter/greeter.c, gui/greeter/greeter_system.c: - Use "reboot" instead of "restart". Fixes bug #327583. + * daemon/gdm.c, daemon/slave.c, gui/greeter/greeter.c, + gui/greeter/greeter_system.c: Use "reboot" instead of "restart". Fixes + bug #327583. 2006-01-17 Brian Cameron <brian.cameron@sun.com> 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 |