diff options
author | George Lebl <jirka@5z.com> | 2003-06-10 00:05:53 +0000 |
---|---|---|
committer | George Lebl <jirka@src.gnome.org> | 2003-06-10 00:05:53 +0000 |
commit | 360ab4aedc84c5bb5bd01483740b80748a37d7bc (patch) | |
tree | e81271fc039c3f2038eb2ce73c74863e7b780504 /config | |
parent | 321b5a36a9dca2940ec25821c6128b8c8664804b (diff) | |
download | gdm-360ab4aedc84c5bb5bd01483740b80748a37d7bc.tar.gz |
use $HOME/.face by default
Mon Jun 09 17:01:27 2003 George Lebl <jirka@5z.com>
* daemon/slave.c, gui/gdmphotosetup.c: use $HOME/.face by default
* daemon/slave.c: when no home dir, try /tmp as the home and not /
* config/*, daemon/gdm.[ch], gui/gdmlogin.c,
gui/greeter/greeter.c, gui/greeter/greeter_action_language.c,
gui/greeter/greeter_configuration.h,
gui/greeter/greeter_session.[ch]: Rework the session setup as
discussed with Oswald Buddenhagen, the kdm maintainer. Now the
sessions are .desktop files and we have one happy Xsession file
which parses that .desktop file and runs the appropriate command.
Also store preferences such as last session and language in .dmrc.
The session desktops are now in /etc/X11/dm/Sessions since they can
be shared by kdm as well in the future. The setup needs a bit
more tuning I think and it's not all tested.
Diffstat (limited to 'config')
-rwxr-xr-x | config/Gnome.in | 130 | ||||
-rw-r--r-- | config/Makefile.am | 41 | ||||
-rw-r--r-- | config/Xclients.desktop.in | 10 | ||||
-rwxr-xr-x | config/Xsession.in | 133 | ||||
-rw-r--r-- | config/gdm.conf.in | 12 | ||||
-rw-r--r-- | config/gnome.desktop.in | 8 | ||||
-rw-r--r-- | config/gnomerc.in | 13 |
7 files changed, 113 insertions, 234 deletions
diff --git a/config/Gnome.in b/config/Gnome.in deleted file mode 100755 index 9e8b3fd6..00000000 --- a/config/Gnome.in +++ /dev/null @@ -1,130 +0,0 @@ -#!/bin/sh - -# -# Distributors: -# You should modify the paths here to fit your distro -# If you need to do so, send me (jirka@5z.com) a patch -# and I'll try to make the script detect the distro stuff -# - -userresources=$HOME/.Xresources -usermodmap=$HOME/.Xmodmap -userxkbmap=$HOME/.Xkbmap - -sysresources=/etc/X11/Xresources -sysmodmap=/etc/X11/Xmodmap -sysxkbmap=/etc/X11/Xkbmap - -rh6sysresources=/etc/X11/xinit/Xresources -rh6sysmodmap=/etc/X11/xinit/Xmodmap - -if [ -x "$HOME/.gnomerc" ]; then - command="$HOME/.gnomerc" -elif [ -x @EXPANDED_SYSCONFDIR@/gdm/gnomerc ]; then - command="@EXPANDED_SYSCONFDIR@/gdm/gnomerc" -else - # as fallback in case the config is screwed - command=`which gnome-session` -fi - -sshagent=`which ssh-agent` -if [ -n "$sshagent" ] && [ -x "$sshagent" ] && [ -z "$SSH_AUTH_SOCK" ]; then - command="$sshagent -- $command" -fi - -# merge in defaults -if [ -f "$rh6sysresources" ]; then - xrdb -merge "$rh6sysresources" -fi - -if [ -f "$sysresources" ]; then - xrdb -merge "$sysresources" -fi - -if [ -f "$userresources" ]; then - xrdb -merge "$userresources" -fi - -# merge in keymaps -if [ -f "$sysxkbmap" ]; then - setxkbmap `cat "$sysxkbmap"` - XKB_IN_USE=yes -fi - -if [ -f "$userxkbmap" ]; then - setxkbmap `cat "$userxkbmap"` - XKB_IN_USE=yes -fi - -# -# Eeek, this seems like too much magic here -# -if [ -z "$XKB_IN_USE" ] && [ ! -L /etc/X11/X ]; then - if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f /etc/X11/XF86Config ]; then - xkbsymbols=`sed -n -e 's/^[ ]*XkbSymbols[ ]*"\(.*\)".*$/\1/p' /etc/X11/XF86Config` - if [ -n "$xkbsymbols" ]; then - setxkbmap -symbols "$xkbsymbols" - XKB_IN_USE=yes - fi - fi -fi - -# xkb and xmodmap don't play nice together -if [ -z "$XKB_IN_USE" ]; then - if [ -f "$rh6sysmodmap" ]; then - xmodmap "$rh6sysmodmap" - fi - - if [ -f "$sysmodmap" ]; then - xmodmap "$sysmodmap" - fi - - if [ -f "$usermodmap" ]; then - xmodmap "$usermodmap" - fi -fi - -unset XKB_IN_USE - -# Normalize languages, some places/distros screw us up in /etc/profile, -# so in case the user did select a language -if [ -n "$GDM_LANG" ]; then - LANG=$GDM_LANG - export LANG - - if [ -n "$LC_ALL" ]; then - if [ "$LC_ALL" != "$LANG" ]; then - LC_ALL=$LANG - fi - else - unset LC_ALL - fi - - if [ -n "$LANGUAGE" ]; then - if [ "$LANGUAGE" != "$LANG" ]; then - LANGUAGE=$LANG - fi - else - unset LANGUAGE - fi - - if [ -n "$LINGUAS" ]; then - if [ "$LINGUAS" != "$LANG" ]; then - LINGUAS=$LANG - fi - else - unset LINGUAS - fi -fi - -# run all system xinitrc shell scripts. -if [ -d /etc/X11/xinit/xinitrc.d ]; then - for i in /etc/X11/xinit/xinitrc.d/* ; do - if [ -x "$i" ]; then - . "$i" - fi - done -fi - -exec $command - diff --git a/config/Makefile.am b/config/Makefile.am index a5596a7e..a5504cad 100644 --- a/config/Makefile.am +++ b/config/Makefile.am @@ -1,7 +1,7 @@ pixmapdir = $(datadIR)/pixmaps confdir = $(sysconfdir)/gdm localedir = $(sysconfdir)/gdm -sessdir = $(sysconfdir)/gdm/Sessions +sessdir = $(sysconfdir)/dm/Sessions initdir = $(sysconfdir)/gdm/Init authdir = $(localstatedir)/gdm gnomercdir = $(sysconfdir)/gdm @@ -14,15 +14,15 @@ noinst_DATA = gdm.conf EXTRA_DIST = \ gdm.conf.in \ - Gnome.in \ - gnomerc.in \ + gnome.desktop.in \ + Xclients.desktop.in \ Xsession.in \ gdm \ gdm-autologin \ locale.alias \ - Default \ - PostSession \ - PreSession \ + Default.in \ + PostSession.in \ + PreSession.in \ PostLogin \ XKeepsCrashing \ gettextfoo.h \ @@ -31,7 +31,9 @@ EXTRA_DIST = \ gettextfoo.h: XKeepsCrashing cat $^ | $(srcdir)/extract-shell.sh > gettextfoo.h -install-data-hook: gdm.conf gnomerc Gnome Xsession +@INTLTOOL_DESKTOP_RULE@ + +install-data-hook: gdm.conf Xsession gnome.desktop Xclients.desktop Default PostSession PreSession if test '!' -d $(DESTDIR)$(confdir); then \ $(mkinstalldirs) $(DESTDIR)$(confdir); \ chmod 755 $(DESTDIR)$(confdir); \ @@ -46,6 +48,7 @@ install-data-hook: gdm.conf gnomerc Gnome Xsession $(INSTALL_DATA) gdm.conf $(DESTDIR)$(confdir)/factory-gdm.conf $(INSTALL_SCRIPT) $(srcdir)/XKeepsCrashing $(DESTDIR)$(confdir)/XKeepsCrashing + $(INSTALL_SCRIPT) $(srcdir)/Xsession $(DESTDIR)$(confdir)/Xsession -if test -f $(DESTDIR)$(localedir)/locale.alias; then \ cp -f $(DESTDIR)$(localedir)/locale.alias $(DESTDIR)$(localedir)/locale.alias.orig; \ @@ -57,22 +60,15 @@ install-data-hook: gdm.conf gnomerc Gnome Xsession chmod 755 $(DESTDIR)$(sessdir); \ fi - -if test -f $(DESTDIR)$(sessdir)/Xsession; then \ - cp -f $(DESTDIR)$(sessdir)/Xsession $(DESTDIR)$(sessdir)/Xsession.orig; \ - fi - $(INSTALL_SCRIPT) Xsession $(DESTDIR)$(sessdir)/Xsession - - -if test -f $(DESTDIR)$(sessdir)/Gnome; then \ - cp -f $(DESTDIR)$(sessdir)/Gnome $(DESTDIR)$(sessdir)/Gnome.orig; \ + -if test -f $(DESTDIR)$(sessdir)/Xclients.desktop; then \ + cp -f $(DESTDIR)$(sessdir)/Xclients.desktop $(DESTDIR)$(sessdir)/Xclients.orig; \ fi - $(INSTALL_SCRIPT) Gnome $(DESTDIR)$(sessdir)/Gnome + $(INSTALL_SCRIPT) Xclients.desktop $(DESTDIR)$(sessdir)/Xclients.desktop - -if test -f /usr/bin/switchdesk; then \ - if test -f $(DESTDIR)$(sessdir)/Default; then \ - cp -f $(DESTDIR)$(sessdir)/Default $(DESTDIR)$(sessdir)/Default.orig; \ - fi; \ - $(LN_S) -f Xsession $(DESTDIR)$(sessdir)/Default; \ + -if test -f $(DESTDIR)$(sessdir)/gnome.desktop; then \ + cp -f $(DESTDIR)$(sessdir)/gnome.desktop $(DESTDIR)$(sessdir)/gnome.orig; \ fi + $(INSTALL_SCRIPT) gnome.desktop $(DESTDIR)$(sessdir)/gnome.desktop if test '!' -d $(DESTDIR)$(initdir); then \ $(mkinstalldirs) $(DESTDIR)$(initdir); \ @@ -112,11 +108,6 @@ install-data-hook: gdm.conf gnomerc Gnome Xsession chmod 755 $(DESTDIR)$(gnomercdir); \ fi - -if test -f $(DESTDIR)$(gnomercdir)/gnomerc; then \ - cp -f $(DESTDIR)$(gnomercdir)/gnomerc $(DESTDIR)$(gnomercdir)/gnomerc.orig; \ - fi - $(INSTALL_SCRIPT) gnomerc $(DESTDIR)$(gnomercdir)/gnomerc - if test '!' -d $(DESTDIR)$(authdir); then \ $(mkinstalldirs) $(DESTDIR)$(authdir); \ chown gdm.gdm $(DESTDIR)$(authdir); \ diff --git a/config/Xclients.desktop.in b/config/Xclients.desktop.in new file mode 100644 index 00000000..f1025759 --- /dev/null +++ b/config/Xclients.desktop.in @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +# The names/descriptions should really be better +_Name=Standard Xclients +_Comment=This is the standard Xclients session +Exec=Xclients +# The Xclients Exec is a very special one and is handled specially in +# the Xsession script +Icon= +Type=Application diff --git a/config/Xsession.in b/config/Xsession.in index dee50102..7ff14d52 100755 --- a/config/Xsession.in +++ b/config/Xsession.in @@ -1,14 +1,51 @@ #!/bin/sh +# +# Note that this is SORT OF LIKE an X session, but not quite. You get a +# .desktop file as the first argument. You must here then parse the +# Exec= line out of this file and use that. +# As a special case, the Exec line can be: +# failsafe - Run an xterm only +# Xclients - Run the appropriate Xclients startup (see the code below) +# +# You should also handle an argument of 'failsafe' +# +# Note that output is ALREADY redirected to .xsession-errors in GDM. This way +# .xsession-errors actually gets more output such as if the PreSession script +# is failing. We wish to be robust don't we? +# +# Also note that this is not run as a login shell, this is just executed. +# This is why we source the profile files below. +# +# based on: # $XConsortium: Xsession /main/10 1995/12/18 18:21:28 gildea $ -case $# in -1) - case $1 in - failsafe) - exec xterm -geometry 80x24+0+0 - ;; - esac -esac +# First read /etc/profile and .profile +test -f /etc/profile && . /etc/profile +test -f $HOME/.profile && . $HOME/.profile +# Second read /etc/xprofile and .xprofile for X specific setup +test -f /etc/xprofile && . /etc/xprofile +test -f $HOME/.xprofile && . $HOME/.xprofile + +zenity=`which zenity` + +command= +if [ -z "$1" ] || [ x"$1" = xfailsafe ] ; then + command=failsafe +else + # Here we parse the .desktop file + command=`grep 'Exec=' "$1" | sed 's/^Exec=//'` +fi + +if [ -z "$command" ] ; then + command=failsafe +fi + +if [ x"$command" = xfailsafe ] ; then + if [ -n "$zenity" ] ; then + $zenity --info --text "This is the failsafe xterm session. Windows now have focus only if you have your cursor above them. To get out of this mode type \"exit\" in the window in the upper left corner" + fi + exec xterm -geometry 80x24+0+0 +fi # Note: ~/.xsession-errors is now done in the daemon so that it # works for ALL sessions (except ones named 'Failsafe') @@ -18,8 +55,6 @@ if which freetemp 2> /dev/null ; then freetemp fi -startup=$HOME/.xsession - userresources=$HOME/.Xresources usermodmap=$HOME/.Xmodmap userxkbmap=$HOME/.Xkbmap @@ -126,56 +161,30 @@ if [ -d /etc/X11/xinit/xinitrc.d ]; then done fi -# now, we see if xdm/gdm/kdm has asked for a specific environment -case $# in -1) - if [ -x "/usr/share/apps/switchdesk/Xclients.$1" ]; then - exec /bin/sh "/usr/share/apps/switchdesk/Xclients.$1"; - fi; - - case $1 in - failsafe) - exec xterm -geometry 80x24+0+0 - ;; - gnome) - exec -l $SHELL -c "gnome-session" - if [ -x "$HOME/.gnomerc" ]; then - exec $HOME/.gnomerc - elif [ -x @EXPANDED_SYSCONFDIR@/gdm/gnomerc ]; then - exec @EXPANDED_SYSCONFDIR@/gdm/gnomerc - else - # as fallback in case the config is screwed - exec gnome-session - fi - ;; - kde|kde1|kde2) - if [ -x "/usr/share/apps/switchdesk/Xclients.kde" ]; then - exec "/usr/share/apps/switchdesk/Xclients.kde" - else - #fallback for non-redhat - exec startkde - fi - ;; - twm) - # fall back to twm - if [ -x "/usr/share/apps/switchdesk/Xclients.twm" ]; then - exec "/usr/share/apps/switchdesk/Xclients.twm" - else - #fallback for non-redhat - exec twm - fi - ;; - esac -esac - -if [ -x "$startup" ]; then - exec "$startup" -elif [ -x "$HOME/.Xclients" ]; then - exec "$HOME/.Xclients" -elif [ -x /etc/X11/xinit/Xclients ]; then - exec /etc/X11/xinit/Xclients -elif [ -x /etc/X11/Xclients ]; then - exec /etc/X11/Xclients -else - exec xsm +if [ "x$command" = "xXclients" ] ; then + if [ -x "$HOME/.Xclients" ]; then + command="$HOME/.Xclients" + elif [ -x /etc/X11/xinit/Xclients ]; then + command="/etc/X11/xinit/Xclients" + elif [ -x /etc/X11/Xclients ]; then + command="/etc/X11/Xclients" + else + echo "Cannot find Xclients" + fi fi + +# add ssh-agent if found +sshagent=`which ssh-agent` +if [ -n "$sshagent" ] && [ -x "$sshagent" ] && [ -z "$SSH_AUTH_SOCK" ]; then + command="$sshagent -- $command" +fi + +exec $command + +echo "Executing: $command failed, will run xterm" + +if [ -n "$zenity" ] ; then + $zenity --info --text "I could not start your session and so I have started the failsafe xterm session. Windows now have focus only if you have your cursor above them. To get out of this mode type \"exit\" in the window in the upper left corner" +fi + +exec xterm -geometry 80x24+0+0 diff --git a/config/gdm.conf.in b/config/gdm.conf.in index c11bab5b..d26cedd8 100644 --- a/config/gdm.conf.in +++ b/config/gdm.conf.in @@ -33,7 +33,6 @@ AlwaysRestartServer=true # The gdm configuration program that is run from the login screen, you should # probably leave this alone Configurator=@EXPANDED_GDMCONFIGDIR@/gdmsetup --disable-sound --disable-crash-dialog -GnomeDefaultSession=@EXPANDED_DATADIR@/gnome/default.session # The chooser program. Must output the chosen host on stdout, probably you # should leave this alone Chooser=@EXPANDED_BINDIR@/gdmchooser @@ -86,7 +85,14 @@ HaltCommand=/usr/bin/poweroff;/sbin/poweroff;/sbin/shutdown -h now;/usr/sbin/shu SuspendCommand= # Probably should not touch the below this is the standard setup ServAuthDir=@EXPANDED_AUTHDIR@ -SessionDir=@EXPANDED_SYSCONFDIR@/gdm/Sessions/ +# This is our standard startup script. A bit different from a normal +# X session, but it shares a lot of stuff with that. See the provided +# default for more information. +BaseXsession=@EXPANDED_SYSCONFDIR@/gdm/Xsession +# This is a directory where .desktop files describing the sessions live +SessionDesktopDir=@EXPANDED_SYSCONFDIR@/dm/Sessions/ +# This is the default .desktop session. One of the ones in SessionDesktopDir +DefaultSession=gnome.desktop # Better leave this blank and HOME will be used. You can use syntax ~/ below # to indicate home directory of the user UserAuthDir= @@ -257,8 +263,6 @@ BackgroundProgram= # if this is true then the background program is run always, otherwise # it is only run when the BackgroundType is 0 (None) RunBackgroundProgramAlways=false -# Show the chooser (you can choose a specific saved gnome session) session -ShowGnomeChooserSession=true # Show the Failsafe sessions. These are much MUCH nicer (focus for xterm for # example) and more failsafe then those supplied by scripts so distros should # use this rather then just running an xterm from a script. diff --git a/config/gnome.desktop.in b/config/gnome.desktop.in new file mode 100644 index 00000000..ae27a3a0 --- /dev/null +++ b/config/gnome.desktop.in @@ -0,0 +1,8 @@ +[Desktop Entry] +Encoding=UTF-8 +_Name=GNOME +_Comment=This session logs you into GNOME +Exec=gnome-session +# no icon yet, only the top three are currently used +Icon= +Type=Application diff --git a/config/gnomerc.in b/config/gnomerc.in deleted file mode 100644 index 87b7a03e..00000000 --- a/config/gnomerc.in +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# Do we have gnome-volume-control? -# If so we should run it to load the gnome-volume-control settings -#if command -v gnome-volume-control > /dev/null 2>&1; then -# gnome-volume-control -i -#elif [ -x @EXPANDED_BINDIR@/gnome-volume-control ] ; then -# @EXPANDED_BINDIR@/gnome-volume-control -i -#fi - -# path takes precedence -exec gnome-session -exec @EXPANDED_BINDIR@/gnome-session |