[Kde-kiosk] how to force users to log into KDE (modify KDM menu)

Mr Wiggles astalavista.box.sk at gmail.com
Mon Jun 20 17:49:21 CEST 2005


Ok, I read that section....not sure where I was "supposed" to find it
but I googled and found it here:
http://docsrv.sco.com:8457/en/KDEdoc/kdm/different-window-managers-with-kdm.html
Basically there needs to exist a case statement as follows:

 case ${windowmgr} in
   kde|kwm|kdestart)
 	WINDOWMANAGER=startkde
 	;;
   fvwm|fvwm2)
 	WINDOWMANAGER=fvwm2
 	;;
 
   fvwm95)
 	WINDOWMANAGER=fvwm95
 	;;

Also found a sample Xsession file for SuSe here:
http://forums.suselinuxsupport.de/lofiversion/index.php/t3151.html
This appears to confirm that I need the case statement listed above to
add items to the menu.

I want to remove items so I assume I need to remove lines from this
case statement.  Since I want to remove default and custom as well as
failsafe I am looking for a line that says Custom) or custom)

I have grepped through /opt  /etc  /usr using "grep -ir custom *" and
see only one file which contains an entry in the case statement for
custom.  it is the file referenced in that SuSe sample mentioned
above.

My first thought was to set it so that no matter what they selected it
woudl load the default of KDE so I replaced the exec commands for the
various cases with "exec startkde" which is what "default" was set to.
I then figured why not remove them from the menu altogether so I
commented out the cases in the case statement.

Rebooted and I still have all the options on the menu, and they work
too (log in as custom or failsafe, not as KDE) so it would seem that
kdm is not pulling its information from this file in /opt but perhaps
from the file referenced on the kdm help site
/usr/X11R6/lib/X11/xdm/Xsession however I do not see any reference to
custom or default in this file.

Thanks for any help you can offer.......below is the contents of
/usr/X11R6/lib/X11/xdm/Xsession







#!/bin/sh
#
# Xsession:     Setup the xsession and start the xsession
#               script of the user.
#
# Copyright (c) 1998-2000 SuSE GmbH Nuernberg, Germany.
# please report bugfixes or comments at http://www.suse.de/feedback.
#
# Author: Werner Fink,   <werner at suse.de>
#

#
# What we do if we are signaled or do not leave this
# script with an appropriate exec call.
#
: ${failsafe="xterm -ls -T Failsafe -geometry 80x24+0+0"}
readonly failsafe
trap "exec $failsafe" EXIT SIGHUP SIGINT SIGPIPE SIGTERM SIGIO

#
# Save our arguments, maybe some of users call
# `set' in their profile files.
#
argv="$@"

#
# Handle the NoChange option of wdm
#
/sbin/pidof -s wdm > /dev/null 2>&1
if test $? -eq 0 ; then
    if test -z "$argv" ; then
        if test -s $HOME/.wmrc ; then
            argv=$(<$HOME/.wmrc)        #use wm from previous session
        fi
    else
        echo "$argv" > $HOME/.wmrc      #save wm
    fi
fi

readonly argv

#
# Disable graphical login if normal login is disabled
#
login=false
while read sh ; do
    if test "$sh" = "$SHELL" ; then
        login=true
        break
    fi
done < /etc/shells

if test "$login" != "true" -o "$SHELL" = "/bin/false" ; then
    trap "exec xmessage -timeout 10 -button okay:1 -center      \
        \"${0##*/}: Login for $USER is disabled.\""             \
        EXIT SIGHUP SIGINT SIGPIPE SIGTERM SIGIO
    exit 1
fi
unset sh login

#
# Some bash (1 and 2) settings to avoid trouble with
# personal profile or bashrc files and failed exec calls.
#
test -n "$BASH" && set +o posix
no_exit_on_failed_exec=1
type shopt &> /dev/null && shopt -s execfail
set +e     &> /dev/null

#
# Redirect errors to the standard user log files.
#
: ${TMPDIR=/tmp}
for errfile in  "$HOME/.xsession-errors" \
                "$TMPDIR/xses-$USER"     \
                "/tmp/xses-$USER"
do
    #
    # Avoid bad symbolic links
    #
    case "$errfile" in
        /tmp/*|$TMPDIR/*) rm -f $errfile ;;
    esac
    if (rm -f -- "$errfile" && /bin/mktemp "$errfile") 2> /dev/null ; then
        exec > "$errfile" 2>&1
        break
    fi
done

#
# Danger: What will the user do with some of the used variables?
# I do not like that ... but even if we source user's files
# we want to find our files and use correct variables.
#
      __HOME="$HOME"         # Users HOME determined by xdm
   __DISPLAY="$DISPLAY"      # The DISPLAY set by xdm for this session
__XAUTHORITY="$XAUTHORITY"   # Should be empty in the most cases
readonly __HOME __DISPLAY __XAUTHORITY

#
# Read the default system settings.
#
test -r /etc/profile && { . /etc/profile > /dev/null 2>&1 ; }
set +u > /dev/null 2>&1

#
# Some system defaults
#
: ${XLIBDIR=/usr/X11R6/lib/X11}
: ${OPENWINHOME=/usr/openwin}
readonly XLIBDIR

#
# the users ~/.profile
#
test -r ${HOME}/.profile && { . ${HOME}/.profile > /dev/null 2>&1 ; }
set +u > /dev/null 2>&1

#
# Restore
#
      HOME="$__HOME"
   DISPLAY="$__DISPLAY"
XAUTHORITY="$__XAUTHORITY"
      TERM=xterm
#
export OPENWINHOME TERM DISPLAY HOME
test -z "$XAUTHORITY" && unset XAUTHORITY || export XAUTHORITY

#
# Check path (paranoid)
#
type -p xdm > /dev/null 2>&1 || PATH=$PATH:/usr/X11R6/bin

#
# Handle arguments given by xdm.
#
set -- $argv
if test $# -ge 1 ; then
    case "$1" in
        failsafe)
            shift
            exec $failsafe
            ;;
        *)
            #
            # KDM may overwrites this
            #
            WINDOWMANAGER=$1 ; export WINDOWMANAGER
            if test $# -ge 2 && test -n "$2" ; then
                LANG=$2 ; export LANG
            fi
            shift $#
            ;;
    esac
fi

#
# Some common user and system files,
# do not use `: ${xx=yy}' here.
#
  xdefaults=$HOME/.Xdefaults
 xresources=$HOME/.Xresources
    xmodmap=$HOME/.Xmodmap
    session=$HOME/.xsession
    xinitrc=$HOME/.xinitrc
    openwin=$OPENWINHOME/bin/openwin
    errinit=$XLIBDIR/xinit/xinitrc
    errsess=$XLIBDIR/xdm/sys.xsession

#
# Handle the users Xmodmap and Xresources
#
test -r "$xmodmap" && xmodmap "$xmodmap"
if   test -r "$xdefaults"  ; then
     if test -r "$XLIBDIR/Xresources"; then
        xrdb -load -retain "$XLIBDIR/Xresources"
        xrdb -I$HOME -merge "$xdefaults"
     else
        xrdb -I$HOME -load -retain "$xdefaults"
     fi
     test -r "$xresources" && xrdb -I$HOME -merge "$xresources"
elif test -r "$xresources" ; then
     if test -r "$XLIBDIR/Xresources"; then
        xrdb -load -retain "$XLIBDIR/Xresources"
        xrdb -I$HOME -merge "$xresources"
     else
        xrdb -I$HOME -load -retain "$xresources"
     fi
elif test -r "$XLIBDIR/Xresources"; then
     xrdb -load -retain "$XLIBDIR/Xresources"
fi

# User session
# If the user doesn't have their own xsession, then run
# xinitrc if they exist

readonly XSESSION_IS_UP=yes
export XSESSION_IS_UP

if   test -f $session ; then
     test -x $session && exec $session
     exec /bin/sh $session
elif test -f $xinitrc ; then
     test -x $xinitrc && exec $xinitrc
     exec /bin/sh $xinitrc
elif test -f $errsess; then
     test -x $errsess && exec $errsess
     exec /bin/sh $errsess
elif test -f $errinit ; then
     test -x $errinit && exec $errinit
     exec /bin/sh $errinit
elif test -f $openwin ; then
     test -x $openwin && exec $openwin
     exec /bin/sh $openwin
else
     test -n "$WINDOWMANAGER" && exec $WINDOWMANAGER
fi

#
# Call failsafe
#
exit 1
















On 6/17/05, Oswald Buddenhagen <ossi at kde.org> wrote:
> On Fri, Jun 17, 2005 at 09:20:42PM +0200, Waldo Bastian wrote:
> > On Friday 17 June 2005 21:12, Oswald Buddenhagen wrote:
> > > On Fri, Jun 17, 2005 at 02:52:37PM -0400, Mr Wiggles wrote:
> > > > I have posted this question everywhere I can find online and got
> > > > not a single answer.
> > >
> > > wow, and all of this even though looking into the manual would have
> > > been that simple ...
> >
> > Instead of playing the smug arrogant asshole you may want to point Mr
> > Wiggles to that part of the fine manual that explains how to do this.
> >
> help:kdm
> => 7. Supporting multiple window managers
> 
> wow, _that_ was hard. i think i must apologize for making fun of
> somebody just because he did not exhibit the extraordinary intelligence
> that would have been required for finding the answer. oh, wait,
> actually, it was only mr.-never-sounding-arrogant who was implying that
> it might be necessary to name a chapter of the fine manual.
> seriously, if one can't laugh about himself doing something ... uhm ...
> suboptimal, i can only pity him. and also those, who think i should be
> considerate of the former.
> 
> --
> Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
> --
> Chaos, panic, and disorder - my work here is done.
> _______________________________________________
> kde-kiosk mailing list
> kde-kiosk at kde.org
> https://mail.kde.org/mailman/listinfo/kde-kiosk
>


More information about the kde-kiosk mailing list