# Setting up Common Desktop Environment for modern use



## Ozric (Feb 6, 2019)

I have recently started using CDE and as someone that never used it back in
the 90s I really enjoy the classic look of it. Here are some tips and tricks
for setting up CDE that I have gathered from various sources online and from
my own tinkering. If any non-FreeBSD users are reading this, remember that
your dt directory is likely located in /usr/dt and not /usr/local/dt like it
is on FreeBSD.

Installing CDE
--
CDE is available in the ports tree: x11/cde


Starting the CDE login manager on boot
--
Add the following line to /etc/rc.local:

```
/usr/local/dt/bin/dtlogin
```

If you want to change the logo image on the login screen, change the following
value in /usr/local/dt/config/C/Xresources:


```
Dtlogin*logo*bitmapFile:
```

Here you can specify a direct path to a .bm or .pm file.
Instead of changing the Xresources file you can always just replace the
file it uses with another of the same name. You will find it at:
/usr/local/dt/appconfig/icons/C/FreeBSDDtlogo.pm
This image is 237x237 pixels.


Setting up the CDE Calendar
--

Add these lines to /etc/inetd.conf:

```
dtspc stream tcp4   nowait  root    /usr/local/dt/bin/dtspcd /usr/local/dt/bin/dtspcd
cmsd/2-5    dgram rpc/udp4 wait root /usr/local/dt/bin/rpc.cmsd rpc.cmsd
```

Add these lines to /etc/rc.conf:

```
rpcbind_enable="YES"
inetd_enable="YES"
```

Add this line to /etc/hosts:

```
127.0.0.1   HOSTNAME
```

(not just localhost but your actual hostname)


Configuring workspace switching with the keyboard
--

These configurations are done in ~/.dt/dtwmrc

Put these in the "Keys DtKeyBindings" section:

```
Ctrl<Key>Left root|window|icon f.next_workspace
Ctrl<Key>Right root|window|icon f.prev_workspace
```

For switching to specific workspaces:

```
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"
```

Mod4 is the Windows key.
ws0..3 are the internal names of the workspaces, so these will work regardless
of what you name the workspaces on the panel.

Adding programs to the panel
--

Download icon image file, set size to 32x32 pixels, save as .xpm
If the icon is going to be directly on the panel and not in a submenu then
make 48x48 instead
Move .xpm file to ~/.dt/icons (or wherever you want) as a .pm file
Start "Create Action" in Desktop Apps
Name the action
Enter the command to be executed when clicking the icon
Click "Edit icon"
In the Icon Editor, go to File -> Open and open the .pm icon file
Click File -> Save and close Icon Editor
In the Create Action window, click File -> Save
The new action will be saved in your home folder
Move the action file
Open the File Manager to the location of the action
Expand the Personal Applications submenu on the dock
Drag the action file from the File Manager to the Install Icon location on the submenu
Restart Workspace Manager to arrange the icon alphabetically in the submenu

The built-in CDE applications
--

Overview of some of the applications that come with CDE.

*Terminal*
- Basic terminal, works fine.

*Text Editor*
- Simple text editor.

*Calculator*
- This program crashes whenever you change modes, needs work.

*Calendar*
- Quite a robust a full-featured calendar application, has been reported to
  have some stability issues.

*Icon Editor*
- A great little program for creating icons, I recommend trying it out for
  some quick and dirty icons for applications you want to put on the panel.

*Mailer*
- This is an ancient email application that will need a lot of work to become
  usable. Technically you can set it up to work using sendmail but I have not
tried. Don't expect modern fanciness like security or HTML rendering. 

*Information Manager*
- A very impressive amount of documentation. This is one of those signs that
  this was at one point commercial software.

*Style Manager*
- This is not one program but a group of programs that change window colors,
  desktop background (or backdrop in CDE speak), screensavers etc.


Some applications to try that mesh well with CDE
--

Here are some applications that use Motif and/or mesh with the overall look
and feel of CDE:

graphics/xv
graphics/xpdf3
astro/xephem
astro/xmoontool
games/xshisen
EDIT: Some more applications to check out:
audio/xmcd
audio/xmmix
editors/nedit

Feel free to make suggestions for other applications to add to this list!

Screenshots
Some screenshots of current setup:









The color scheme I am using is one I made myself, here are the RGB codes.
Left to right, top then bottom:

```
121
174
181
-
163
174
181
-
189
189
189
-
191
192
197
-
188
188
188
-
191
192
197
-
127
127
127
-
191
192
197
```


----------



## humphrayLegare (Feb 6, 2019)

Thank you very much for your wonderful tutorial !


----------



## CrowdedNewt (Mar 5, 2019)

This port does not build for me and seems to be marked as broken :/


----------



## Ozric (Mar 5, 2019)

I noticed the very same thing yesterday when installing CDE on a testing machine. I do not know why it has been marked as broken and there is no info on freshports. I simply commented out the line in the Makefile and it built fine from what I could see. So try doing that.


```
#BROKEN=             Does not build on head
```


----------



## SirDice (Mar 5, 2019)

The port seems to incorrectly assume that everything above 1200000 is HEAD. Which was true when 12.0-CURRENT still existed. But FreeBSD 12.0-RELEASE-p3 is 1200086. 12.0-STABLE is 1200503 at the moment. 


```
.if ${OSVERSION} > 1200000
  BROKEN=         Does not build on head
.endif
```
It should probably check for 1300000 if it indeed fails to build on -CURRENT.

Those lines need to be removed from the port or at least corrected for 13.0-CURRENT.


----------



## SirDice (Mar 8, 2019)

Don't install software outside the ports/package system. Those are not registered in the package database. You will not be able to keep track of versions and you will run into a dependency hell sooner or later. Use the ports or packages, that's what they're there for. 

If the port/package is broken report the issue so it can be fixed.


----------



## skeletonboss12 (Aug 25, 2020)

I have virtualized Solaris 10 to fetch some authentic CDE icons for use with various applications, cannot seem to find where they are located though, the only *.xpm and *.pm files I cna locate on the system are for gnome.

Also, do you know how to edit the entries in application manager/desktop_apps and the likes? When i installed CDE on FreeBSD, a lot of these entries did not point to actual applications and I would like to edit them as well as change their icons to stock CDE/ solaris 10 CDE icons..


----------



## kpedersen (Aug 25, 2020)

Hmm,

It seems I made a terrible mistake with CDE back in 2012. Turns out my patch for the front panel favored the wrong color.





The panel border is using the shade color for that turquoise area (the bug my patch aimed to fix). However, it seems that the turquoise was the color that the front panel should have been.

So something like this:





Who'd have thunk that? I believe my ancient fix was somewhere in here: https://sourceforge.net/p/cdesktopenv/code/ci/master/tree/cde/programs/dtwm/WmFP.c

It looks very blue, but brings it more in-line with how it looked on AIX:


----------



## Mjölnir (Aug 25, 2020)

Kind of off-topic, but still related: here in Berlin, probably Germany & Europe (worldwide?), too, oldtimer-bicycles (& new ones with a retro-look) have become very popular recently.  Not only they look way beautiful -- they're often very ergonomic, leightweight & technically up on par with modern hardware, sometimes even better because metal is used where plastic material is used today.  E.g. I remember an article about derailleur gears: the principles of operation did not change in the past 70 years, a model from the 50ies is in practice not worse than a modern one, the only difference is they had less sprockets & the modern one is lighter (which does not matter for such a small part).
I remember we had a NextStation mid-end of the 90ies.  The UI was impressively intuitive.  It's hard to see real progress in UI implementation techniques when you compare todays frameworks like Qt with yesterdays solutions.


----------



## 20-100-2fe (Aug 25, 2020)

mjollnir said:


> It's hard to see real progress in UI implementation techniques when you compare todays frameworks like Qt with yesterdays solutions.




Our biology hasn't changed much since the NextStation days, it's no wonder the way we interact with our computers doesn't need any progress.


----------



## kpedersen (Aug 25, 2020)

If anything it looks as though there is a little bit more of a push back to the command line for casual users with "innovations" such as Microsoft's improved command prompt (with tabs!!).


----------



## skeletonboss12 (Aug 25, 2020)

I am trying to be more productive with CDE. I could use some information on how I might get things like copy pasting in dtterm working
Also, outside workplace switching, are there other window management functions that I can bind to keys?

Furthermore I see I am no longer executing my xresources when starting this via dtlogin or xdm, since my xsession is linked to dt's

Any way around this?


----------



## skeletonboss12 (Aug 26, 2020)

Weird. I tried this on another machine and running dtlogin like this is preventing other daemons from starting.


----------



## Mjölnir (Aug 26, 2020)

skeletonboss12 said:


> I am trying to be more productive with CDE. I could use some information on how I might get things like copy pasting in dtterm working.  Any way around this?


Hmm.  I guess _dtterm_ is a terminal application for X11?  E.g. under _KDE_ I have sophisticated _copy & paste_ facilities built into x11/konsole (incl. URL detection, i.e. then I have an additional command "Open URL").  Follow-up goes here.  I guess it's easier to build a _Motif/CDE_ design/theme for _KDE Plasma_ (sophisticated tools built-in), than to patch all the features you want into an outdated _CDE_.  Just my 2¢.


----------



## kpedersen (Aug 26, 2020)

Dtterm should support copy and paste. You should be able to find it in the program "Edit" menu (https://docs.oracle.com/cd/E19253-01/806-4743/images/ugdtterm.tiff.gif) or if you have hidden that, right click to get the following context menu (https://docs.oracle.com/cd/E19253-01/806-4743/images/ugtermpopup.tiff.gif).



mjollnir said:


> _Motif/CDE_ design/theme for _KDE Plasma_ (sophisticated tools built-in), than to patch all the features you want into an outdated _CDE_.  Just my 2¢.


The problem with that even though it looks like CDE, it would still be slow and inefficient. Especially over X11 forwarded connections. The entirety of CDE, Motif, Xt and libX11 is smaller than Qt for example.


----------



## skeletonboss12 (Aug 30, 2020)

kpedersen said:


> Dtterm should support copy and paste. You should be able to find it in the program "Edit" menu (https://docs.oracle.com/cd/E19253-01/806-4743/images/ugdtterm.tiff.gif) or if you have hidden that, right click to get the following context menu (https://docs.oracle.com/cd/E19253-01/806-4743/images/ugtermpopup.tiff.gif).
> 
> 
> The problem with that even though it looks like CDE, it would still be slow and inefficient. Especially over X11 forwarded connections. The entirety of CDE, Motif, Xt and libX11 is smaller than Qt for example.



Thanks.


I am working on themes for gtk3, qt4 and qt5 so the apps can blend in with CDE, sort of. I am color blind though so this is hard, anyone here tried this?


----------



## Márcio Rezende (Feb 2, 2021)

Awsome post. I'm having a good time here installing CDE but I cannot figure out how to set up Brazillian Portuguese. Any idea how to do it ? (It seems there are only 5 languages out of the box: EN, DE, FR, IT and ES). Thx.


----------



## Mjölnir (Feb 2, 2021)

I guess you have to search the net or do the translations yourself.  AFAIK it should be fairly easy to translate ES -> PT_br.  Maybe you can set up a fallback mechanism PT_br - PT - PT_any - ES - ES_any - EN.


----------



## orhankur (Apr 11, 2021)

Thank you for the info. Here is a screenshot of my customised desktop.


----------



## cmoerz (Apr 30, 2021)

I've got to admit, I'd love to check this out. On the other hand, what's you guys' take on the security aspect of running CDE? Obviously there's a bunch of CVEs for CDE that are probably still applicable? Or are those ports patched to close those issues?

Source - first google result, for example:





						CDE : Security vulnerabilities
					

Security vulnerabilities related to CDE : List of vulnerabilities 			related to any product of this vendor. Cvss scores, vulnerability details and links to full CVE details and references



					www.cvedetails.com


----------



## SirDice (Apr 30, 2021)

cmoerz said:


> Or are those ports patched to close those issues?


I'm going to say no:


> Security Note
> 
> CDE has had quite a few known security vulnerabilities in it, and it is likely that several more unknown ones still exist. Don't expose it to the Internet. In fact, never expose any desktop to the Internet.
> 
> ...








						CDE - Common Desktop Environment / Wiki / Home
					






					sourceforge.net


----------



## Alain De Vos (Apr 30, 2021)

I don't like open ports. The alternative is  kde/gnome/xfce/openbox with CDE-look-and-feel.


----------



## kpedersen (Apr 30, 2021)

cmoerz said:


> I've got to admit, I'd love to check this out. On the other hand, what's you guys' take on the security aspect of running CDE? Obviously there's a bunch of CVEs for CDE that are probably still applicable? Or are those ports patched to close those issues?


At this point I am inclined to say that CDE has the potential to be more secure than Gnome / KDE on many installations. Mainly because even though CDE receives less support it is much simpler. It also receives less "fiddling".

However almost certainly disable the components that involve root.

dtlogin
sulog from dtaction
dtspcd
tooltalk (only keep the user run service around)
Many of thse just require you hacking the install script a bit to remove setting of setuid bits.


----------



## Fuzzbox (Apr 30, 2021)

This thread reminds me running xfce3.8.18 back in the days, originally a CDE clone with xft fonts in the latest versions.


----------



## cmoerz (Aug 10, 2021)

Late to the game, but I'd like to add that I finally managed to port x11-wm/nscde to FreeBSD. If you like to run in an old school desktop environment, it's the next best thing - modern technology under the hood but the look and feel is all CDE:






						FreshPorts -- x11-wm/nscde: Modern CDE clone based on fvwm
					

NsCDE is a retro but powerful UNIX desktop environment which resembles CDE look (and partially feel) but with a more powerful and flexible framework beneath- the-surface, more suited for 21st century unix-like and Linux systems and user requirements than original CDE.  NsCDE can be considered as...




					www.freshports.org


----------



## SanPollo (Nov 3, 2022)

skeletonboss12 said:


> Weird. I tried this on another machine and running dtlogin like this is preventing other daemons from starting.


I've got this issue on my machine. It's like as soon as it runs dtlogin it stops executing the startup scripts - even sshd wasn't running. I tried it with an & after it but then it says "The X-server can not be started on display :0..." when it finishes booting.

Does anyone have any idea how to fix this?


----------



## SanPollo (Nov 3, 2022)

Okay, so removing "/usr/local/dt/bin/dtlogin" from /etc/rc.local and adding "dtlogin_enable="YES" to /etc/rc.conf fixed the issue.

I've realised that this guide is missing a few steps that probably weren't necessary when it was written. If you want to try this out then make sure you also follow the steps in the pkg-message.


----------



## kpedersen (Nov 4, 2022)

SanPollo said:


> Okay, so removing "/usr/local/dt/bin/dtlogin" from /etc/rc.local and adding "dtlogin_enable="YES" to /etc/rc.conf fixed the issue.


Running dtlogin (or startx) from /etc/rc.local causes a race condition between what starts first; the X11 session or tty login. If the tty login starts *after*, it steals input so keyboard doesn't work, and it is fairly difficult to even exit X11.

Not quite what you seemed to experience but another reason why /etc/rc.local should be avoided for autostarting X.


----------

