View RSS Feed

James' openSUSE Bash Scripting (and other things) Blog - Your Comments are Welcome!

openSUSE 12.1 SUSE KDM Login Screen User Listing

Rate this Entry
by , 03-Dec-2011 at 19:41 (4211 Views)
With the release of openSUSE 12.1, the SUSE specific KDM Login screen does not support a user listing. Apparently this was originally reported as a bug, but turns out this was done by design and some of our users have since missed this old feature. You can read about it and the proposed fix that was supplied here:

https://bugzilla.novell.com/show_bug.cgi?id=727821

What I have done is to snag the new openSUSE.xml file written by Hendrik Müller and posted it into SuSE Paste here: openSUSE.xml

And I wrote a bash script that can fetch the xml file, rename your old xml file and use the new one. Just log out to see your new user listing. If you should change your mind, just run the script again, but with the -r option and the original openSUSE.xml file will be restored. Here is the bash script for your consideration:

Code:
#!/bin/bash

#: Title       : make-kdm-user-list
#: Date Created: Sat Dec 3 19:32:49 CST 2011
#: Last Edit   : Sat Dec 3 19:32:49 CST 2011
#: Author      : You Name Here
#: Version     : 1.00
#: Description : Allow user listing in KDM Login Screen
#: Options     : make-kdm-user-list [-r]

# Bug Report was here: https://bugzilla.novell.com/show_bug.cgi?id=727821

# SuSE Paste
# Download link: http://susepaste.org/view/download/69121607
# XML Post Location http://susepaste.org/69121607

#
# This is the standard GPL Statement, leave at the top of the script.
# Just use the command show_gpl after this function for it to be shown.
#

function show_gpl {
echo ""
echo "make-kdm-user-list is a bash script file written to be used with openSUSE."
echo "Copyright (C) 2011 by You Name Here, your.email@address.com"
echo ""
echo "This program is free software; you can redistribute it and/or modify"
echo "it under the terms of the GNU General Public License as published by"
echo "the Free Software Foundation; either version 2 of the License, or"
echo "(at your option) any later version."
echo ""
echo "This program is distributed in the hope that it will be useful,"
echo "but WITHOUT ANY WARRANTY; without even the implied warranty of"
echo "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"
echo "GNU General Public License for more details."
echo ""
echo "You should have received a copy of the GNU General Public License"
echo "along with this program; if not, write to the Free Software"
echo "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA"
echo ""
}

#
# Check to see if we are root ************************************************
#
if [[ $UID -ne 0 ]]; then
  tput clear
  color 7 0 B 
  id -Gn | grep -q wheel || echo "Root User Permissions are required, Please Enter the ..."
  echo
  sudo $0 $@
  Exit_Code=$?
  show_gpl
  exit $Exit_Code
fi

#
# Main Program Starts Here **************************************************
#

if [ "$1" == "" ] ; then

  clear
  echo "This bash script will replace your openSUSE.xml file, changing the SUSE"
  echo "SuSE KDM screen to allow the disply of your user listing during login."
  echo
  echo -n "Do you wish to proceed and replace your openSUSE.xml file? (y/N): "
  read CHOICE

  if [[ $CHOICE == [Yy] ]] ; then
    mv /usr/share/kde4/apps/kdm/themes/SUSE/openSUSE.xml /usr/share/kde4/apps/kdm/themes/SUSE/openSUSE.xml.bak
    if [ -e /usr/share/kde4/apps/kdm/themes/SUSE/openSUSE.xml.bak ] ; then
      wget -nc http://susepaste.org/view/download/69121607 -O /usr/share/kde4/apps/kdm/themes/SUSE/openSUSE.xml
      if [ -e /usr/share/kde4/apps/kdm/themes/SUSE/openSUSE.xml ] ; then 
      echo "The openSUSE.xml file was successfully replaced!"
      echo
      fi
    else
      echo "Backup file was not created, file replacement was aborted!"
      echo
      exit 1
    fi
  else
    echo
    echo "The openSUSE.xml file replacement was aborted by user!"
    exit 1
  fi
fi

if [ "$1" == "-r" ] ; then
  if [ -e /usr/share/kde4/apps/kdm/themes/SUSE/openSUSE.xml.bak ] ; then
       if [ -e /usr/share/kde4/apps/kdm/themes/SUSE/openSUSE.xml ] ; then
         rm /usr/share/kde4/apps/kdm/themes/SUSE/openSUSE.xml
       fi
    mv /usr/share/kde4/apps/kdm/themes/SUSE/openSUSE.xml.bak /usr/share/kde4/apps/kdm/themes/SUSE/openSUSE.xml
    if [ -e /usr/share/kde4/apps/kdm/themes/SUSE/openSUSE.xml ] ; then
       echo
       echo "Your old openSUSE.xml file was restored successfully"
       echo
       exit 0
    fi
  else
    echo
    echo "Your openSUSE.xml Backup file was not found, file restore was aborted!"
    exit 1
  fi
fi

echo "To reverse the openSUSE.xml file replacement, just run this script"
echo "with the -r option: $0 -r"

exit 0

# End Of Script
Just copy the text in the code block above, into a text editor like kwrite and save it into your local ~/bin folder as the text file make-kdm-user-list (/home/yourname/bin/make-kdm-user-list). To use make-kdm-user-list, you must mark it executable.

Open up a terminal session and run the following command:

Code:
chmod +x ~/bin/make-kdm-user-list
To use the script, open up a terminal session and run the command:

Code:
make-kdm-user-list
When you run make-kdm-user-list, you will be asked if you wish to download and replace your old openSUSE.xml file. If you agree, a backup of this file will be made for you. If later, you change your mind and wish to return to using your old openSUSE.xml file, just open up a terminal session and run the following terminal command:

Code:
make-kdm-user-list -r
For this whole thing to be useful, you need two or more users in openSUSE, a function in YaST. In the KDE Personnel Settings / Login Screen / Users Tab / User Images, you can assign each user an icon if you wish.

If you have any questions or comments about this script, just let me know.

Thank You,

Blogs: asroot : Bash : Packet Filter : C.F.U. : GPU's : FastBoot : fewrup : F.S.M. : H.I. : nVIDIA : LNVHW : MMCHECK : N.S.F. : P.B.S. : S.A.K.C.
S.W.A.T. : S.A.S.I. : S.C.L.U. : S.G.T.B. : S.K.I.M. : S.L.A.V.E. : S.L.R.C. : S.T.A.R.T. : S.U.F.F. : SYSEdit : systemd : VBoxLive : VirtualBox : YaST Power

Submit "openSUSE 12.1 SUSE KDM Login Screen User Listing" to Digg Submit "openSUSE 12.1 SUSE KDM Login Screen User Listing" to del.icio.us Submit "openSUSE 12.1 SUSE KDM Login Screen User Listing" to StumbleUpon Submit "openSUSE 12.1 SUSE KDM Login Screen User Listing" to Google Submit "openSUSE 12.1 SUSE KDM Login Screen User Listing" to Facebook Submit "openSUSE 12.1 SUSE KDM Login Screen User Listing" to Twitter

Updated 23-Dec-2011 at 22:00 by jdmcdaniel3

Categories
openSUSE Software

Comments

    Thanks for the script! This was the last project to getting 12.1 set up for me. I didn't know this was done on purpose.
    Quote Originally Posted by 67GTA
    Thanks for the script! This was the last project to getting 12.1 set up for me. I didn't know this was done on purpose.
    I was happy to help 67GTA. Don't forget the actual fix was done by Hendrik Müller and I just made it available to everyone in our forum here. It is one of those things I like to do when I see that a solution can be written that can work for us all and yet provide some protection and the possibility of reversal should you wish. I am afraid my xml skills are somewhat lacking, but as luck would have it, Hendrik came to our rescue.

    Thank You,
    It is possible to get a KDM login screen with userlist support in openSUSE 12.1 without the need to edit any XML file, as follows:

    1. in YaST, click on "System → /etc/sysconfig Editor"

    2. Expand "Desktop" then "Display manager"

    3. Make sure that the following config variables are set as follows:

    Code:
    DISPLAYMANAGER = kdm     
    KDM_USERS = (space-separated list of users to be shown)     
    DISPLAYMANAGER_KDM_THEME = (empty)
    4. Click OK.

    The next time you start X, you'll have the "traditional KDE" login screen with user list (and optionally with 3-hand analog clock).
    Thanks Tony for your suggestion which I have placed here for all to see.

    Do consider if you follow this procedure you will forgo the standard SUSE KDM login feature to change your session type. But, it is yet another method you can use.

    Thank You,
    Well after further review (And comments made by Tony), I have determined that using the above procedure, which removes the SUSE Themed Login, while keeping KDM and using the KDE default login, does provide a Session selection menu. In fact, after taking a closer look at the GDM login used by GNOME, I see a session selection menu there as well. It does seem kind of weird to login to Gnome using KDM, but it does work. So, in the end, it seems only the SUSE themed login has removed a user selection menu and you can get it back without loss of function using the default KDE or GNOME login screens.

    Thank You,
    Thanks, I have my users now :-)), but the first user (io) is shown i... instead of io, why this??
    Quote Originally Posted by pier_andreit
    Thanks, I have my users now :-)), but the first user (io) is shown i... instead of io, why this??
    So if your user name is only two characters like io, I am not sure why it would show up as i..., so can you be more specific as to the entire user name and what is shown? Most often, long names that don't fit in the space get abbreviated, but short ones should not. Considering it is an unauthorized modification, it could even have a bug perhaps, but who you going to call if that is true?

    Thank You,
    [QUOTE=jdmcdaniel3;bt297]So if your user name is only two characters like io, I am not sure why it would show up as i...,[/QUOTE]
    yes here is a screenshot:
    http://www.4shared.com/photo/tZAeFuP4/100_0423.html
    [QUOTE=jdmcdaniel3;bt297]so can you be more specific as to the entire user name and what is shown? Most often, long names that don't fit in the space get abbreviated, but short ones should not. Considering it is an unauthorized modification, it could even have a bug perhaps, but who you going to call if that is true?

    Thank You,[/QUOTE]
    my user name = "io" (without"")
    my login name = "pla" (without"")
    as you can see the second user (username "nipoti" and login name "nipoti") is correctly shown

    Thanks pla

Search Engine Friendly URLs by vBSEO 3.5.2