This is a text-only version of the following page on https://raymii.org:
---
Title       : 	The Common Desktop Environment (CDE) is still developed and modern in 2021
Author      : 	Remy van Elst
Date        : 	28-01-2021
URL         : 	https://raymii.org/s/blog/The_Common_Desktop_Environment_CDE_is_still_developed_in_2021.html
Format      : 	Markdown/HTML
---



![CDE on Debian 10][1]

> CDE on Debian 10 with Firefox open

While playing around with [the GUI on OpenVMS][3] I was looking for CDE
documentation and I found out CDE is still being developed and can be
installed on modern linux.  This quick post shows you how to install CDE on
Debian 10 and includes a bit on  compiling GENERIC TETRIS, the same program I
installed [on OpenVMS][3]. 

<p class="ad"> <b>Recently I removed all Google Ads from this site due to their invasive tracking, as well as Google Analytics. Please, if you found this content useful, consider a small donation using any of the options below:</b><br><br> <a href="https://leafnode.nl">I'm developing an open source monitoring app called  Leaf Node Monitoring, for windows, linux & android. Go check it out!</a><br><br> <a href="https://github.com/sponsors/RaymiiOrg/">Consider sponsoring me on Github. It means the world to me if you show your appreciation and you'll help pay the server costs.</a><br><br> <a href="https://www.digitalocean.com/?refcode=7435ae6b8212">You can also sponsor me by getting a Digital Ocean VPS. With this referral link you'll get $100 credit for 60 days. </a><br><br> </p>


Really cool to compile and run a game from 1992 on
a retro/modern desktop environment. Makes you wonder how the world could look, if everyone was on 
CDE still. Resource usage is low and everything is so snappy and quick,
it feels amazing. I might even consider switching to CDE fulltime.

![GENERIC TETRIS][10]

> Tetris from 1992 on CDE on Debian 10 in 2021

### Preparation and dependencies

[The CDE project page has great documentation][2] on installing on modern linux. This guide is specific
for Debian 10 and does not use the `dtlogin` session manager, but integrates `CDE` in the "regular"
login manager, either `lightdm`, `gdm` or `sddm`. [This guide][4] by mike632t (Mike?) was very helpful, 
but I didn't have any problems with locales. He also adds a service for `dtlogin`, which I won't, I'll 
be using the regular login manager.

I assume all steps are run as root, in root's home folder (`/root/`).

There's a whole bunch of packages you'll need to build CDE. Here's the entire bunch:

	apt install xserver-xorg xserver-xorg-core xfonts-base xinit lightdm git
	build-essential libxt-dev libxmu-dev libxft-dev libxinerama-dev libxpm-dev
	libmotif-common libmotif-dev libxaw7-dev libx11-dev libxss-dev libtirpc-dev
	x11-xserver-utils libjpeg62-turbo-dev libfreetype6-dev tcl-dev ksh m4
	ncompress xfonts-100dpi xfonts-100dpi-transcoded xfonts-75dpi 
	xfonts-75dpi-transcoded rpcbind bison xbitmaps libjpeg-dev libssl-dev x11proto-fonts-dev

The [CDE documentation][2] has information on locales, but my debian 10 XFCE install did not 
require any of those steps. 

### Get the CDE source code with git

Use `git` to get the source code for CDE:

	git clone http://git.code.sf.net/p/cdesktopenv/code cdesktopenv-code

Go into the new folder and continue on to the next section. 

	cd cdesktopenv-code/cde/


### Compile CDE

Execute the `make` command to build the desktop environment. This will take a
long time, on my virtual machine with 4 cores and 4 GB RAM it took almost an
hour. You can edit the `Makefile` and add `-j4` at the beginning of the
`MAKE_OPTS` line, which will then use more cores. Still takes long though.

	# pre 2.4.0: make World
	make

When the build finishes, use the following command to install CDE:

	# pre 2.4.0: ./admin/IntegTools/dbTools/installCDE -s /root/cdesktopenv-code/cde/
	sudo make install

Finally, copy the session file for your regular login manager. If you do this, you will be able to
select CDE next to XFCE, GNOME or whatever you currently use. 

	 cp /root/cdesktopenv-code/cde/contrib/desktopentry/cde.desktop /usr/share/xsessions/

Reboot to make this active.

Why not use `dtlogin`? That will probably mess with your current settings so
much that you will have difficulty going back. Also, in my case, `dtlogin`
sets the resolution to `800x600`, `lightdm` uses the regular resolution. You
can use `xrandr`  or `arandr` to change the resolution in CDE, but if it works
right away that's just easier.


#### checkinstall 

This is optional, but if you want to keep your system clean and be able to
remove CDE afterwards, you can use `checkinstall` to build `.deb` packages for
easy installation and removal. When building `.deb` packages for other people,
`checkinstall` is not recommended but for your own system, it helps keep things tidy.

`checkinstall` is not in the  [main repo's for Debian Buster][7], but is in
the backports. Add the following line to  `/etc/apt/sources.list`:

	deb http://deb.debian.org/debian buster-backports main

Do an update and then install `checkinstall` from `backports`:

	apt update
	apt install checkinstall/buster-backports

Execute `checkinstall` instead of `make install` after the `make`:

	checkinstall --pkgname=local-cde -s /root/cdesktopenv-code/cde/

Afterwards install the `.deb` package created by `checkinstall`:

	dpkg -i *.deb

### Using CDE

If you do follow [Mike's guide][4], then you can use `dtlogin` as login manager. It looks 
like this:

![dtlogin debian][6]

If you follow this guide, you'll use your regular login manager, select the CDE session in 
there to login.

After logging in the first time, a big blue screen with some version information is shown:

![version info][5]

The desktop is nice, clear and clean, with a help window popping up, just like on OpenVMS. 
The below screenshot shows a few open programs, like firefox and the Application Starter:

![cde][1]

Go play around with all the programs, like the file manager, terminal, style manager and the dock.
If you use local mail, there is a mail client and also a print program. Works with CUPS so if 
you've got a printer setup, it should be usable right away. Resource usage is low and everything
is so snappy and quick, amazing.

#### Autostart programs on CDE login

If you want to auto-start applications on CDE when logging in, you can simply open them and 
not close them before logging out, it will remember them. You can also put them in a file:

	mkdir -p ~/.dt/sessions/
	vim ~/.dt/sessions/sessionetc

Add one command per line, ending with an `ampersand` (`&`):

	firefox &

Afterwards don't forget to make the file executable:

	chmod +x ~/.dt/sessions/sessionetc

Now onto the fun part, gaming!

### GENERIC-TETRIS

After posting the [OpenVMS CDE article][3] on Lobsters, user kidon replied 
[on the tetris part][8]. It's written by Qiang Alex Zhao and although the 
`Makefile` being outdated, you can manually compile and run it. First download
the source, I mirrored it on this site:

	wget https://raymii.org/s/inc/downloads/tetris-312.zip

Unzip and go into the folder:

	unzip tetris-312.zip
	cd tetris_3_1_2

Compile it manually:

	 cc -o tetris tetris.c utils.c playing.c -lX11 -lXaw

(You do need all the CDE development package dependencies as installed in the above paragraph)

There should now be a binary in the folder which you can execute:

	remy@debian:~/tetris_3_1_2$ \ls -la ./tetris
	-rwxr-xr-x 1 remy remy 67064 Jan 28 15:35 ./tetris

Running it pops up a graphical window with the game:

	./tetris


![tetris][10]


Use the arrow keys to move the piece around, `space` to plop it down
instantly, `k` to rotate and `n` to see the next piece.

Afterwards your score is shown:

	                 GENERIC TETRIS V3.1.2
	Copyright (C) 1992-93      Q. Alex Zhao, azhao@cc.gatech.edu
	     GENERIC TETRIS comes with ABSOLUTELY NO WARRANTY.


	- Thu Jan 28 15:37:48 2021
	- Your final score is 333, at level 3 with 1 rows.



[1]: /s/inc/img/CDE-debian-2021.png
[2]: http://web.archive.org/web/20210128121747/https://sourceforge.net/p/cdesktopenv/wiki/LinuxBuild/
[3]: /s/blog/OpenVMS_CDE_Desktop_remote_x_axpbox.html
[4]: http://web.archive.org/web/20210128132330/https://mike632t.wordpress.com/2020/11/05/compiling-cde-on-debian-10-jessie/
[5]: /s/inc/img/CDE-debian-2021-2.png
[6]: /s/inc/img/CDE-debian-2021-3.png
[7]: https://serverfault.com/a/974654
[8]: https://lobste.rs/s/gzadez/openvms_cde_desktop_remote_x_session_gui#c_2indqm
[9]: https://www.cc.gatech.edu/gvu/people/qiang.a.zhao/Games.html
[10]: /s/inc/img/CDE-debian-2021-4.png

---

License:
All the text on this website is free as in freedom unless stated otherwise. 
This means you can use it in any way you want, you can copy it, change it 
the way you like and republish it, as long as you release the (modified) 
content under the same license to give others the same freedoms you've got 
and place my name and a link to this site with the article as source.

This site uses Google Analytics for statistics and Google Adwords for 
advertisements. You are tracked and Google knows everything about you. 
Use an adblocker like ublock-origin if you don't want it.

All the code on this website is licensed under the GNU GPL v3 license 
unless already licensed under a license which does not allows this form 
of licensing or if another license is stated on that page / in that software:

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Just to be clear, the information on this website is for meant for educational 
purposes and you use it at your own risk. I do not take responsibility if you 
screw something up. Use common sense, do not 'rm -rf /' as root for example. 
If you have any questions then do not hesitate to contact me.

See https://raymii.org/s/static/About.html for details.