Mandrake Linux Archives: cooker@mandrivalinux.org
Mandrake Linux: cooker@mandrivalinux.org
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- From: Loic BAUDRY
- Subject: [Cooker] Multiples Display Manager - Proposal - Patches - Integrating entrance
- Date: 27 May 2005 00:10:13 -0000
Hello cookers,
i tried to use 'entrance' ( e17 display manager ) but i faced some problems :
- drakedm ( mandriva tool to select display manager ) do not know 'entrance' existence.
- dm service don't know how to start 'entrance' because 'prefdm' only kwnows some hardcoded display managers.
- the update wmsession process ('fndSession') only know how to handle kdm & gdm updates.
To resolve theses problems, i have written some patches to set up the following process :
- each display manager should drop a config file in a special directory ( /etc/X11/dm.d/ in my patches ).
- prefdm process thoses files to know relations between a dm, a desktop and the command to execute.
- drakedm process thoses files to know description and package for each display manager.
- fndSession process thoses files to know how to update display manager wm session list ( http://qa.mandriva.com/twiki/bin/view/Main/WmsessionConfig#Adding_a_new_dm ).
Here is a description of my attachments :
Every dm should create a config file in '/etc/X11/dm.d'.
Packages :
- 'mdkkdm' for mdkkdm ( 01MDKKDM file )
- 'kdebase-kdm' for kdm ( 02KDM file )
- 'xorg-x11' for xdm ( 03GDM file )
- 'gdm' for gdm ( 04XDM file )
- 'entrance' for entrance ( 05ENTRANCE file )
The number before the DM name is important to not change prefdm default behaviour.
'/etc/X11/prefdm' should be patched to use dm config files instead of its hardcoded values.
The package is 'initscripts'.
'/usr/sbin/drakedm' should be patched to list available display managers which have droped a config
file in '/etc/X11/dm.d/'.
The package is 'drakxtools-newt'.
'/usr/sbin/fndSession' should be patched to use dm config files to know how to update wmsession list
for each display manager.
The package is 'desktop-common-data'.
What do you think of my patches ?
Especially maintainers of the quoted packages.
If you accept them and you want me to patch the package spec file, just let me know.
If you want to test, copy attachments to /tmp and do : cp /usr/sbin/drakedm /usr/sbin/drakedm.bak cp /etc/X11/prefdm /etc/X11/prefdm.bak cp /usr/sbin/fndSession /usr/sbin/fndSession.bak cat /tmp/drakedm-use-dm.d-config-files.patch | patch /usr/sbin/drakedm cat /tmp/prefdm-use-dm.d-config-files.patch | patch /etc/X11/prefdm
cat /tmp/fndSession-use-dm.d-config-files.patch | patch /usr/sbin/fndSession
mkdir -p /etc/X11/dm.d cp /tmp/01MDKKDM /etc/X11/dm.d cp /tmp/02KDM /etc/X11/dm.d cp /tmp/03GDM /etc/X11/dm.d cp /tmp/04XDM /etc/X11/dm.d cp /tmp/05ENTRANCE /etc/X11/dm.d
Loic.
--- drakedm 2005-05-26 19:38:58.000000000 +0200
+++ drakedm.new 2005-05-26 20:56:05.000000000 +0200
@@ -37,6 +37,9 @@
'XDM' => [ N("XDM (X Display Manager)"), '/usr/bin/X11/xdm', 'xorg-x11' ],
);
+# Directory in which display managers put a config file
+my $dm_dir = '/etc/X11/dm.d/' ;
+
my $dm;
foreach (cat_($cfg_file)) {
@@ -48,6 +51,23 @@
log::explanations("Defaulting to $dm for display manager")
}
+# Update default map with new display managers
+foreach my $mydmconfigfile (all($dm_dir)) {
+ my $dmname = '' ;
+ my $dmdescription = '' ;
+ my $dmexec = '' ;
+ my $dmpackage = '' ;
+ foreach (cat_($dm_dir.$mydmconfigfile)) {
+ $dmname = $1 if /^NAME=(.*)$/;
+ $dmdescription = $1 if /^DESCRIPTION=(.*)$/;
+ $dmexec = $1 if /^EXEC=(.*)$/;
+ $dmpackage = $1 if /^PACKAGE=(.*)$/;
+ }
+ $dm{$dmname}[0] = N($dmdescription) ;
+ $dm{$dmname}[1] = $dmexec ;
+ $dm{$dmname}[2] = $dmpackage ;
+}
+
my @raw_list = sort keys %dm;
my @list = $::expert ? @raw_list : (grep { -e $dm{$_}->[1] } @raw_list);
--- fndSession 2005-05-26 19:39:47.000000000 +0200
+++ fndSession.new 2005-05-26 20:56:41.000000000 +0200
@@ -1,6 +1,8 @@
#!/bin/sh
# fndSession (c) MandrakeSoft, Chmouel Boudjnah <chmouel@mandrakesoft.com>
## FindSession for kdm and gdm.
+## 20050526 Loic Baudry : Find Session for every display manager having a
+## config file in /etc/X11/dm.d/
[ -x /usr/sbin/chksession ] || {
echo "I can't find /usr/sbin/chksession"
@@ -8,10 +10,14 @@
exit 1
}
-if [ -e /usr/share/config/kdm/kdmrc ];then
- /usr/sbin/chksession -k
-fi
-
-if [ -d /etc/X11/dm/Sessions ];then
- /usr/sbin/chksession -g
-fi
+DIR_DM=/etc/X11/dm.d/
+DM_FILES=$(ls $DIR_DM | egrep -v '(\.rpmsave$|\.rpmold$|~)')
+for onedmconfigfile in $DM_FILES
+do
+{
+ if grep -cq '^FNDSESSION_EXEC=' $DIR_DM$onedmconfigfile ;
+ then
+ command=$(grep '^FNDSESSION_EXEC=' $DIR_DM$onedmconfigfile | cut -b17-)
+ $command
+ fi
+} done ;
--- prefdm 2005-05-26 19:38:47.000000000 +0200
+++ prefdm.new 2005-05-26 20:57:42.000000000 +0200
@@ -3,6 +3,7 @@
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
HOME=/root
export HOME
+DIR_DM=/etc/X11/dm.d/
# We need to source this so that the login screens get translated
[ -f /etc/profile.d/10lang.sh ] && . /etc/profile.d/10lang.sh
@@ -43,15 +44,16 @@
if [ -f /etc/sysconfig/desktop ]; then
. /etc/sysconfig/desktop >/dev/null 2>&1
[ -z "$DISPLAYMANAGER" ] && DISPLAYMANAGER=$DESKTOP
- if [ "$DISPLAYMANAGER" = "GDM" -o "$DISPLAYMANAGER" = "gdm" -o "$DISPLAYMANAGER" = "GNOME" -o "$DISPLAYMANAGER" = "gnome" -o "$DISPLAYMANAGER" = "Gnome" ]; then
- preferred=gdm
- elif [ "$DISPLAYMANAGER" = "KDE" -o "$DISPLAYMANAGER" = "kde" ]; then
- preferred=mdkkdm
- elif [ "$DISPLAYMANAGER" = "KDM" -o "$DISPLAYMANAGER" = "kdm" ]; then
- preferred=kdm
- elif [ "$DISPLAYMANAGER" = "XDM" -o "$DISPLAYMANAGER" = "xdm" ] ; then
- preferred=xdm
- fi
+ DM_FILES=$(ls $DIR_DM | egrep -v '(\.rpmsave$|\.rpmold$|~)')
+ for onedmconfigfile in $DM_FILES
+ do
+ {
+ if egrep -icq '(^NAME='$DISPLAYMANAGER'$|^DESKTOP='$DISPLAYMANAGER'$)' $DIR_DM$onedmconfigfile ;
+ then
+ preferred=$(basename $(grep '^EXEC=' $DIR_DM$onedmconfigfile | cut -b6-))
+ break
+ fi
+ } done ;
fi
# xdm-like program are launched from the console, however, the locale-setting
# can be done in a way that console is not localize, while X11 is.
@@ -63,15 +65,16 @@
if [ -z "$preferred" ] || ! which $preferred >/dev/null 2>&1; then
- if which mdkkdm >/dev/null 2>&1; then
- preferred=mdkkdm
- elif which kdm >/dev/null 2>&1; then
- preferred=kdm
- elif which gdm >/dev/null 2>&1; then
- preferred=gdm
- elif which xdm >/dev/null 2>&1; then
- preferred=xdm
- fi
+ DM_FILES=$(ls $DIR_DM | egrep -v '(\.rpmsave$|\.rpmold$|~)')
+ for onedmconfigfile in $DM_FILES
+ do
+ {
+ commandname=$(basename $(grep '^EXEC=' $DIR_DM$onedmconfigfile | cut -b6-))
+ if which $commandname >/dev/null 2>&1; then
+ preferred=$commandname
+ break
+ fi
+ } done ;
fi
if [ -n "$preferred" ]; then
NAME=KDE DESKTOP=KDE DESCRIPTION=MdkKDM (Mandriva Linux Display Manager ) EXEC=/usr/bin/mdkkdm PACKAGE=mdkkdm FNDSESSION_EXEC=/usr/sbin/chksession -k
NAME=KDM DESKTOP=KDE DESCRIPTION=KDM (KDE Display Manager) EXEC=/usr/bin/kdm PACKAGE=kdebase-kdm FNDSESSION_EXEC=/usr/sbin/chksession -k
NAME=GNOME DESKTOP=GNOME DESCRIPTION=GDM (GNOME Display Manager) EXEC=/usr/bin/gdm PACKAGE=gdm FNDSESSION_EXEC=/usr/sbin/chksession -g
NAME=XDM #DESKTOP= DESCRIPTION=XDM (X Display Manager) EXEC=/usr/bin/X11/xdm PACKAGE=xorg-x11 #FNDSESSION_EXEC=
NAME=entrance DESKTOP=E17 DESCRIPTION=ENTRANCE (E17 Display Manager) EXEC=/usr/sbin/entranced PACKAGE=entrance #FNDSESSION_EXEC=TODO
- Replies:
- Re: [Cooker] Multiples Display Manager - Proposal - Patches - Integrating entrance
- From: Frederic Lepied
- Re: [Cooker] Multiples Display Manager - Proposal - Patches - Integrating entrance
- From: Michael Scherer
- Re: [Cooker] Multiples Display Manager - Proposal - Patches - Integrating entrance
- From: Austin Acton
- Re: [Cooker] Multiples Display Manager - Proposal - Patches - Integrating entrance
- Prev by Date: [Cooker] Wiki topic changes (Mandriva Linux Development Community.Main)
- Next by Date: Re: [Cooker] Multiples Display Manager - Proposal - Patches - Integrating entrance
- Previous by thread: [Cooker] Modular runlevel S initscripts
- Next by thread: Re: [Cooker] Multiples Display Manager - Proposal - Patches - Integrating entrance
- Index(es):
Search the archive:
To (un)subscribe from/to the lists:
Fund the Mandriva Linux project
