Re: [Vlad Harchev <hvv hippo ru>] problem with session management ingnome-1.4beta1



On Tue, 6 Mar 2001, Vlad Harchev wrote:

 Sorry, here is an updated version with confusing comments removed, slightly
reogranized and one possible bug fixed. No known bugs left :) Though I didn't
try to use funny session names containing special shell characters. Tested on
RH62.

 I think it's best to name this session script Gnome-MultiSessioned so that 
users who don't need this advanced functionality will be able to use
plain "Gnome" session script and won't be presented with choice
dialog (that slowdowns session startup since input is expected).

 What do you think about this?

> On Mon, 5 Mar 2001, Vlad Harchev wrote:
> 
>  Hi,
> 
>  Here is a Gnome session script (based on Gnome session script from the GDM
> from 1.4beta1) that allows user to select which gnome session to load (a list
> of gnome sessions is presented in GtkCList, default session is marked with "*"
> and can be activated by pressing "Cancel" or hitting Escape).
> 
>  Unfortunately gdialog is slightly broken - it doesn't allow to prevent
> displaying "tag" field in a serparate column, to interpret doubleclick
> as shorthand for "OK", and to disallow "Cancel" button. But it could be fixed
> - at least in gnome mode, and even without fixing it the selection is fairly
> usable.
> 
>  To George: what do you think about including this script with GDM (may be
> under the name "Gnome-Multisessioned")?
> 

 Best regards,
  -Vlad
#!/bin/bash -login

for errfile in "$HOME/.gnomerc-errors" "${TMPDIR-/tmp}/gnomerc-$USER" "/tmp/gnomerc-$USER"
do
	if ( cp /dev/null "$errfile" 2> /dev/null )
	then
		chmod 600 "$errfile"
		exec > "$errfile" 2>&1
		break
	fi
done

sessfile=$HOME/.gnome/session
if which gdialog >/dev/null 2>&1 && [ -f $sessfile ] ; then
    #by Vlad Harchev <hvv hippo ru>
    #provide a selection of sessions to load.
    selected=$(
    grep '^\[' $sessfile  | sed -e 's/^\[\(.*\)\]$/\1/' | sort | 
    (
	args="--title 'Select gnome session to restore' \
    	    --radiolist 'select a gnome session to restore' 100 100 20 "
        if [ -r  $sessfile-"options" ]; then
	    #determine default session
    	    defaultsession=`grep "CurrentSession" $sessfile-"options" | 
	    sed  -e 's/^CurrentSession=//'`
	fi
	    
	while read S; do
	    if [ x"$defaultsession" = x"$S" ]; then
		#mark default session with this
		tag="*"
	    else
		tag=""
	    fi
    	    args="$args '""$S""' '$tag' 1"	
	done
        if ! eval gdialog "$args" 2>&1 
	then
	    echo "$defaultsession"
	fi
    ) )
    if [ -z "${selected}" ]
    then
	exec /usr/bin/gnome-session 
    else
	exec /usr/bin/gnome-session --choose-session "${selected}"
    fi
else
    exec /usr/bin/gnome-session --choose-session Nautilus
fi



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]