-
Notifications
You must be signed in to change notification settings - Fork 0
Configuring
The following page contains information on how to configure NCDM.
For NCDM to work, you will need to add it to your /etc/inittab file. In most setups, the following line should be fine:
c1:12345:respawn:/usr/bin/ncdm tty1 linux
If you have fbterm, change linux to fbterm to get better color support and inherit the default wallpaper for people who launch fbterm sessions through NCDM as the background for the main screen:
c1:12345:respawn:/usr/bin/ncdm tty1 fbterm
You will need to set the following for both chvt and openvt, as NCDM uses these to switch console sessions and to open up a new CLI session for a user.
sudo setcap cap_dac_read_search,cap_sys_tty_config+ep /usr/bin/chvt #for switching sessions
sudo setcap cap_dac_read_search,cap_sys_tty_config+ep /usr/bin/openvt #for opening CLI sessions
Hopefully the documentation in the source code's copy of sys.cfg provides sufficient enough documentation. If not, here's a sample /etc/ncdm/sys.cfg file from my system complete with the comments in the original:
# Command to use for halting
SHUTDOWN=halt
# Command to use for rebooting
REBOOT=reboot
# Command to use for suspending
SUSPEND=/usr/sbin/pm-suspend
# Command to use for hibernating
HIBERNATE=/usr/sbin/pm-hibernate
# Establish a consolekit session if available?
# (Note: this can be toggled off by a user if they don't need it)
CONSOLEKIT=yes
# Establish a fbterm session if available?
# (Note: this can be toggled off by a user if they don't want it)
FBTERM=yes
FBIMG=/etc/splash/arch-black/images/verbose-1600x1200.png
# Log normal program operation?
# The log is stored in /var/log/ncdm.log
LOG=yes
# If logging is enabled, what should the minimum level for writing to the log be?
# levels available are the following, from lowest to highest:
# DEBUG,INFO,WARNING,ERROR,CRITICAL
LOGLVL=WARNING
# Allow root login?
ALLOW_ROOT=yes
# Users who are allowed to only have one session through this program
# Separate each user with :
LOGIN_ONCE=guest
# A message to give to anyone who sees the screen.
# The format of this is a normal python string template.
# You can use the following variables:
# node: Hostname without any domain name
# kver: The release of the kernel
# kname: The name of the kernel
# fullos: Full operating system name
# kdate: The builddate of the kernel
# pyver: The python version NCDM is running on
# This will probably be moved to title.json if I add
# markup support.
WELCOME: {kname}@{node} - Python {pyver}
# Font for the welcome message.
# Please consult urwid.get_all_fonts() for what is available on your system
# examples:
#[('Thin 3x3', <class 'urwid.font.Thin3x3Font'>),
# ('Thin 4x3', <class 'urwid.font.Thin4x3Font'>),
# ('Half Block 5x4', <class 'urwid.font.HalfBlock5x4Font'>),
# ('Half Block 6x5', <class 'urwid.font.HalfBlock6x5Font'>),
# ('Half Block Heavy 6x5', <class 'urwid.font.HalfBlockHeavy6x5Font'>),
# ('Thin 6x6', <class 'urwid.font.Thin6x6Font'>),
# ('Half Block 7x7', <class 'urwid.font.HalfBlock7x7Font'>)
FONT=Thin 6x6
# Path to a valid json file which has a valid color scheme
# When creating a *.json theme, please look at
# http://excess.org/urwid/wiki/DisplayAttributes
# for valid colors
THEME=/usr/share/ncdm/themes/default.json
# Other NCDM specific files in this folder:
#
# gui.csv - stores the list of available GUI sessions.
# Having this file not exist means that all GUI
# sessions available will be listed by default.
#
# cli.csv - stores the list of available CLI sessions.
# Since there's nothing to dynamically check what CLI sessions are available,
# not having this file means only the login shell for that user will be listed.
#
# Each line of the csv file should be listed as such:
# "Label","Command"
#
# User specific files:
# ~/.config/ncdm/{gu,cl}i.csv - User specific versions of /etc/ncdm/{gu,cl}i.csv.
#
# ~/.config/ncdm/usr.cfg - User specific version of /etc/ncdm/sys.cfg.
# Only allows overriding CONSOLEKIT, FBTERM, and FBIMG
#
# if ~/.config/ncdm isn't present for the user,
# it is overridden by the system's versions
Sample ~/.config/ncdm/usr.cfg file:
CONSOLEKIT=yes
FBTERM=yes
FBIMG=/home/shadowkyogre/Pictures/WallPaper/glowingSnakePurpleBlueCLI.jpg
~/.config/ncdm/gui.csv, ~/.config/ncdm/cli.csv, /etc/ncdm/cli.csv, and /etc/ncdm/gui.csv all share the format of the following:
"Name","Command"
<label for app>,<app to launch>
If the appropriate gui.csv does not exist, then NCDM will try to look for all available sessions in /etc/X11/sessions and /usr/share/xsessions. If cli.csv file does not exist, then NCDM will try to use the user's default login shell.
CLI sessions are launched with the following command:
openvt -ws -- <app to launch>
# or for FBTerm CLI sessions
openvt -ws -- fbterm-bi </path/to/your/image.ext> <app to launch>
GUI sessions are launched with the following command:
startx <app to launch> -- <next X display>
For this to work, either /etc/X11/xinitrc or ~/.xinitrc must have the following format since the session is passed as a parameter to either of these:
exec $1
# or
exec $*