Difference between revisions of "CDM"

From ArchWiki
Jump to: navigation, search
m
(wikify some external links, use https for archlinux.org)
(29 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{i18n|SLiM}}
+
[[Category:Display managers]]
[[Category:Boot process (English)]]
+
[[cs:CDM]]
[[Category:Display managers (English)]]
+
{{Article summary start}}
[[Category:Eye candy (English)]]
+
{{Article summary text|Describes installing, configuring and using CDM, minimalistic replacement for login-managers.}}
[[Category:HOWTOs (English)]]
+
{{Article summary heading|Related articles}}
'''[http://cdm.ghost1227.com CDM]''' is a minimalistic, yet full-featured replacement for login-managers like [[slim]], [[Automatic_login_manager_startup#Installation|kdm]], [[Automatic_login_manager_startup#Installation|gdm]] and [[qingy]] that provides a fast, dialog-based login system without the overhead of the X Window System or the instability of qingy. Written in pure bash, CDM has no other dependencies, yet supports multiple users/sessions and can start virtually any DE/WM.
+
{{Article summary wiki|Display Manager}}
 +
{{Article summary end}}
 +
'''CDM''' is a minimalistic, yet full-featured replacement for login-managers like [[slim]], [[Automatic_login_manager_startup#Installation|kdm]], [[Automatic_login_manager_startup#Installation|gdm]] and [[qingy]] that provides a fast, dialog-based login system without the overhead of the X Window System or the instability of qingy. Written in pure bash, CDM has almost no dependencies, yet supports multiple users/sessions and can start virtually any DE/WM.
  
A package is available in the [http://aur.archlinux.org/packages.php?K=cdm AUR].
+
==Installation==
  
==Configuration==
+
Install the {{AUR|cdm-git}} package which is available in the [https://aur.archlinux.org/ AUR].
 
+
You can configure CDM by editing {{Filename|/etc/cdmrc}}. It is fully documented and should be relatively easy to figure out.
+
  
 +
After installing CDM you should edit {{ic|/etc/inittab}} or {{ic|/etc/rc.conf}} to make sure no other display managers get started.
  
At least these should be edited before you start using CDM:
+
*{{ic|/etc/inittab}}
wmbinlist=(awesome openbox-session '''startkde startxfce4 gnome-session''')
+
+
wmdisplist=(Awesome Openbox '''KDE Xfce Gnome''')
+
Add whatever WM/DE you have.
+
 
+
 
+
===/etc/inittab or /etc/rc.conf===
+
After installing CDM and configuring it to your liking, you should edit {{Filename|/etc/inittab}} or {{Filename|/etc/rc.conf}} to make sure no other display managers get started.
+
 
+
*{{Filename|/etc/inittab}}
+
 
  #x:5:respawn:/usr/bin/xdm -nodaemon
 
  #x:5:respawn:/usr/bin/xdm -nodaemon
 
  #x:5:respawn:/usr/sbin/gdm -nodaemon
 
  #x:5:respawn:/usr/sbin/gdm -nodaemon
Line 30: Line 21:
 
They should all be commented.
 
They should all be commented.
  
*{{Filename|/etc/rc.conf}}
+
*{{ic|/etc/rc.conf}}
 
  DAEMONS=(... !gdm)
 
  DAEMONS=(... !gdm)
 
gdm (or kdm, or xdm, ...) should be disabled or removed from your DAEMONS array.
 
gdm (or kdm, or xdm, ...) should be disabled or removed from your DAEMONS array.
  
==Starting X==
+
==Invocation==
  
Login to the console and select your prefered session (or console, if allowed) from the menu.
+
To run cdm, use
 +
$ cdm [RCFILE]
  
Additional users may be logged in by switching to tty1 (ctrl+alt+f1). If the user is already logged in, CDM will automatically activate their pre-existing session.
+
To autostart cdm when you log in your account, copy the following to the tail of your shell profile ({{ic|$HOME/.profile}}, {{ic|$HOME/.zlogin}}, etc.):
 +
<nowiki>
 +
if [[ "$(tty)" == /dev/tty* ]]; then
 +
    [[ -n "$CDM_SPAWN" ]] && return
 +
    [[ -z "$DISPLAY$SSH_TTY" ]] && exec cdm
 +
fi</nowiki>
  
==Own commands==
+
==Configuration==
{{Note|CDM now has an option to enable built-in shutdown support, however, this section is left as a general reference.}}
+
  
If you want to add entries like shutdown which needs parameters you have to save the command in an executable script and add the script with full path to the wmbinlist array.
+
You can configure CDM by editing {{ic|/etc/cdmrc}}. It is fully documented and should be relatively easy to figure out. You can also have user specific config files by copying {{ic|/etc/cdmrc}} to {{ic|$HOME/.cdmrc}}.
E.g. shutdown:
+
*/script/shutdown
+
#!/bin/bash
+
+
shutdown -h now
+
  
*/etc/cdmrc
+
===Menu items===
wmbinlist=( ... /script/shutdown ... )
+
  
==More resources==
+
Menu items are configured using three arrays: '''binlist''', '''namelist''' and '''flaglist'''. Order of items in these arrays is important, items with the same index describe the same menu item. '''binlist''' contains commands which are executed, '''namelist''' contains names which are shown in the menu and '''flaglist''' contains type of the programs specified in '''binlist''', either 'X' for X sessions or 'C' for console programs. Basically X sessions are started using [[startx]] (the item in '''binlist''' is argument of '''startx''' command) and console programs are started using '''exec'''.
[http://cdm.ghost1227.com Homepage (Standard)] / [http://cdm.ghost1227.com/X11 Homepage (Graphic)]
+
  
[http://bbs.archlinux.org/viewtopic.php?id=84408 The Console Display Manager] - Archlinux Forums thread about CDM
+
There is a sample configuration:
 +
binlist=(
 +
  "~/.xsession"                                  # Launch your X session,
 +
  "/bin/bash --login"                          # or just execute your shell,
 +
  "/usr/bin/fbterm"                            # or start a frame buffer console,
 +
  "/usr/bin/cdm ~/.submenu.cdmrc"  # or go to a submenu :)
 +
)
 +
namelist=("X session" Console FBTerm "Sub menu")
 +
flaglist=(X C C C)
  
[http://aur.archlinux.org/packages.php?ID=31879 Aur package]
+
===Theming===
 +
 
 +
Themes are located in {{ic|/usr/share/cdm/themes}}, all you have to do is pass full path of the theme file to '''dialogrc''' variable in {{ic|/etc/cdmrc}}, for example
 +
dialogrc=/usr/share/cdm/themes/cdm
 +
 
 +
The theme syntax is fairly self explanatory, the best way to start a new theme would be to duplicate and edit an existing theme.
 +
 
 +
===Starting X===
 +
 
 +
You can affect the process of starting X server in several ways - use of [[ConsoleKit]] is optional, you can specify on which tty the X server will be started (specify either number or 'keep' if you want to run X server on current tty), and finally you can specify custom X server arguments.
 +
 
 +
==Custom commands for power operations==
 +
 
 +
If you want to add entries for power operations, like shutdown, reboot etc., you can include them in '''binlist''' array.
 +
 
 +
===ConsoleKit method===
 +
 
 +
If you use [[ConsoleKit]] for session authentication, see [[ConsoleKit#Use_dbus_for_power_operations]].
 +
 
 +
===systemd method===
 +
 
 +
If you use [[systemd]], see [[Systemd#Power_Management]].
 +
 
 +
==More resources==
 +
*[https://bbs.archlinux.org/viewtopic.php?id=84408 The Console Display Manager] - Archlinux Forums thread about CDM
 +
*Aur package:{{AUR|cdm-git}}
 +
*[https://github.com/ghost1227/cdm GitHub page]

Revision as of 15:52, 4 December 2012

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary end CDM is a minimalistic, yet full-featured replacement for login-managers like slim, kdm, gdm and qingy that provides a fast, dialog-based login system without the overhead of the X Window System or the instability of qingy. Written in pure bash, CDM has almost no dependencies, yet supports multiple users/sessions and can start virtually any DE/WM.

Installation

Install the cdm-gitAUR package which is available in the AUR.

After installing CDM you should edit /etc/inittab or /etc/rc.conf to make sure no other display managers get started.

  • /etc/inittab
#x:5:respawn:/usr/bin/xdm -nodaemon
#x:5:respawn:/usr/sbin/gdm -nodaemon
#x:5:respawn:/usr/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >& /dev/null

They should all be commented.

  • /etc/rc.conf
DAEMONS=(... !gdm)

gdm (or kdm, or xdm, ...) should be disabled or removed from your DAEMONS array.

Invocation

To run cdm, use

$ cdm [RCFILE]

To autostart cdm when you log in your account, copy the following to the tail of your shell profile ($HOME/.profile, $HOME/.zlogin, etc.):

 if [[ "$(tty)" == /dev/tty* ]]; then
     [[ -n "$CDM_SPAWN" ]] && return
     [[ -z "$DISPLAY$SSH_TTY" ]] && exec cdm
 fi 

Configuration

You can configure CDM by editing /etc/cdmrc. It is fully documented and should be relatively easy to figure out. You can also have user specific config files by copying /etc/cdmrc to $HOME/.cdmrc.

Menu items

Menu items are configured using three arrays: binlist, namelist and flaglist. Order of items in these arrays is important, items with the same index describe the same menu item. binlist contains commands which are executed, namelist contains names which are shown in the menu and flaglist contains type of the programs specified in binlist, either 'X' for X sessions or 'C' for console programs. Basically X sessions are started using startx (the item in binlist is argument of startx command) and console programs are started using exec.

There is a sample configuration:

binlist=(
  "~/.xsession"                                   # Launch your X session,
  "/bin/bash --login"                           # or just execute your shell,
  "/usr/bin/fbterm"                             # or start a frame buffer console,
  "/usr/bin/cdm ~/.submenu.cdmrc"  # or go to a submenu :)
)
namelist=("X session" Console FBTerm "Sub menu")
flaglist=(X C C C)

Theming

Themes are located in /usr/share/cdm/themes, all you have to do is pass full path of the theme file to dialogrc variable in /etc/cdmrc, for example

dialogrc=/usr/share/cdm/themes/cdm

The theme syntax is fairly self explanatory, the best way to start a new theme would be to duplicate and edit an existing theme.

Starting X

You can affect the process of starting X server in several ways - use of ConsoleKit is optional, you can specify on which tty the X server will be started (specify either number or 'keep' if you want to run X server on current tty), and finally you can specify custom X server arguments.

Custom commands for power operations

If you want to add entries for power operations, like shutdown, reboot etc., you can include them in binlist array.

ConsoleKit method

If you use ConsoleKit for session authentication, see ConsoleKit#Use_dbus_for_power_operations.

systemd method

If you use systemd, see Systemd#Power_Management.

More resources