+------------------------------------------------------------------------------
| Running cde on OpenBSD
+------------------------------------------------------------------------------

Useful configuration tips are available in the Common Desktop Environment wiki:
https://sourceforge.net/p/cdesktopenv/wiki/Home/

System Configuration
====================

Entries for your hostname (NOT just localhost) must be registered in /etc/hosts.
e.g.,
127.0.0.1	localhost myhost myhost.domain.com

Then configure /etc/inetd.conf:
    # cat <<'EOF' >>/etc/inetd.conf
dtspc		stream	tcp	nowait	root	/usr/local/dt/bin/dtspcd		dtspcd
cmsd/2-5	dgram	rpc/udp	wait	root	/usr/local/dt/bin/rpc.cmsd		rpc.cmsd
# only enable if CDE messaging nor file-name mapping is required which should
# not be the case on OpenBSD
#ttdbserver/1	stream	rpc/tcp	wait	root	/usr/local/dt/bin/rpc.ttdbserver	rpc.ttdbserver
EOF

Most configuration files can be found under /usr/local/dt/config and will be
overwritten by subsequent updates. To change a configuration, its file must be
copied to /etc/dt/config for edition.

portmap(8) and inetd(8) must be enabled and running:
    # rcctl enable portmap inetd && rcctl start portmap inetd

Starting the Common Desktop Environment
=======================================

The prefered way to login and start CDE is by using xenodm(1):
    # rcctl enable xenodm && rcctl start xenodm
Then configure .xsession for you user:
    $ echo "/usr/local/dt/bin/Xsession" >>~/.xsession

Alternatively, you can use startx(1) from the glass console:
    $ startx /usr/local/dt/bin/Xsession
or
    $ echo "/usr/local/dt/bin/Xsession" >>~/.xinitrc
    $ startx

The CDE login service is also provided as another alternative:
    # rcctl enable dtlogin && rcctl start dtlogin

User Configuration
==================

To cope with the non default installation PREFIX, add the following to your
shell profile:
export PATH=${PATH}:/usr/local/dt/bin
export MANPATH=:/usr/local/dt/man

To automatically source your .profile when opening a terminal in CDE, uncomment
the last line in your user's .dtprofile file:
DTSOURCEPROFILE=true

In this package, dtmail(1) execution is disabled: it's setgid "mail" and works
with messages under /var/spool/messages which goes against OpenBSD defaults.

Key bindings for workspace switching
------------------------------------

This configuration will allow switching workspace using:
- Ctrl+left|right to circulate over workspaces (e.g., Ctrl+right)
- Windows|command+[1-4] to switch to a specific workspace (e.g., Windows+2)

    $ cp /usr/local/dt/config/C/sys.dtwmrc ~/.dt/dtwmrc

Then add the following lines to the XXX section of ~/.dt/dtwmrc:
    Ctrl<Key>Right root|window|icon f.next_workspace
    Ctrl<Key>Left root|window|icon f.prev_workspace
    Mod4<Key>1 root|window|icon f.goto_workspace "ws0"
    Mod4<Key>2 root|window|icon f.goto_workspace "ws1"
    Mod4<Key>3 root|window|icon f.goto_workspace "ws2"
    Mod4<Key>4 root|window|icon f.goto_workspace "ws3"
