You are not logged in.

#1 2011-01-31 21:15:09

tarsius
Member
From: Basel, Switzerland
Registered: 2010-10-09
Posts: 110

Inital ebuild for x11-misc/cdm the "Console Display Manager"

I have pushed an ebuild for cdm to my overlay, so it should appear in the funtoo tree no later than in 12 hours.

Cdm has a few issues some of which I have fixed in my fork at https://github.com/tarsius/cdm. The ebuild uses a tarball created from that repository instead of one from upstream and then applying patches in the ebuild. I have done so because I plan to actually write a replacment for cdm if I can not get upstream to merge my changes (some of which are still outstanding).

The major remaining issues in cdm are:

(1) uses it's own xinitrc by default

    This is bad because all other xdm do the same making it hard for users to
    figure out which is in use without time consuming investigation.

(2) ~/.xinitrc or /etc/X11/xinit/xinitrc can be used but to be adjusted

    This is not actually an issue in cdm rather the default xinitrc that comes
    with x11-apps/xinit is just not ready for it. Basically what has to be changed
    is that xinitrc should use the session specified by $1 if that is set.

    After you have made that change you also have to set usexinit=yes in
    /etc/X11/cdm/cdmrc.

    Here is an xinitrc that you can use to replace the existing /etc/X11/xinit/xinitrc:

#!/bin/sh

userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/Xresources
sysmodmap=/etc/X11/xinit/Xmodmap

# merge in defaults and keymaps

[ -f $sysresources ]  && xrdb -merge $sysresources
[ -f $userresources ] && xrdb -merge $userresources
[ -f $sysmodmap ]     && xmodmap $sysmodmap
[ -f $usermodmap ]    && xmodmap $usermodmap

# select an xsession

if [ -n "$1" ]
then
    xsession=$1
elif [ -n "`/etc/X11/chooser.sh`" ]
then
    xsession="`/etc/X11/chooser.sh`"
fi

# load additional configuration

if [ -d /etc/X11/xinit/xinitrc.d ]
then
    for f in /etc/X11/xinit/xinitrc.d/*
    do
        [ -x "$f" ] && source $f
    done
    unset f
fi

# start the selected xsession

if [ -n "$xsession" ]
then
    exec $xsession
else
    twm &
    xterm -geometry 80x50+494+51 &
    xterm -geometry 80x20+494-0 &
    exec xterm -geometry 80x66+0+0 -name login
fi

    It is a cleaned up version of that file with the $1 thing added.
    startx should still work as before with that file.

(3) started in yet another way

    X11 is normally started using startx manually after login or by rc
    if xdm was added to the default runlevel.

    While cdm is advertized as the "Console Display Manager" it actually
    is just a wrapper around startx.

    To implement the display manager part a file is added to /etc/profile.d
    which checks whether the current shell is a "console login shell" and if
    so starts cdm.

    This is disabled on funtoo by default. If you want to use cdm as a startx
    replacement just type cdm instead of startx. If however you want it to
    behave it as much as possible like a proper xdm move
    /usr/share/cdm/zzz-cdm-profile.sh to /etc/profile.d.

(4) does not use ~/.xserverrc or /etc/X11/xinit/xserverrc

I plan to write a replacement for startx which incorporates some ideas from cdm but can actually be used as a proper xdm. Maybe it will have to be split into two executables to serve both as a startx and xdm replacement.

However because I want to work on other things first I have added cdm in it's current form to the tree. One of these "other things" is creating ebuilds for various window managers and here the functionality provided by cdm will come in quite handy.

By the way /usr/bin/startx begins with this comment:

#
# This is just a sample implementation of a slightly less primitive
# interface than xinit.  It looks for user .xinitrc and .xserverrc
# files, then system xinitrc and xserverrc files, else lets xinit choose
# its default.  The system xinitrc should probably do things like check
# for .Xresources files and merge them in, startup up a window manager,
# and pop a clock and serveral xterms.
#
# Site administrators are STRONGLY urged to write nicer versions.
#

Also whitespace in startx and other files belonging to x11-apps/xinit is messed up the way it is because these files are actually created using the C preprocessor. Before working on xstart (working name for the startx replacement) I will first cleanup these files (even if all I do is fix whitespace but there are other things that have to be fixed also).

I will also look into whether xdm/gdm/kdm/slim... can use files from /etc/X11/xinit instead of providing their own versions.

For more information about cdm see:

https://wiki.archlinux.org/index.php/CDM and
https://bbs.archlinux.org/viewtopic.php?id=84408

Last edited by tarsius (2011-01-31 21:28:16)

Offline

Board footer

Powered by FluxBB