Old-school desktop using a minimal Debian Jessie installation

June 19th 2017: Stretch - Debian 9 - does not install the ifconfig package as part of a default install. This will raise issues with network configuration just after installation. See Debian Wiki Wifi page for wifi.

July 5th 2015: This page has been updated since the release of Jessie as Debian stable, and to incorporate suggestions from a brief Hacker News discussion.

Summary

This page explains how to install a minimal Debian Jessie desktop using the IceWM window manager on top of Xorg. I wanted explore the kind of desktop that you can assemble without relying on components such as dbus or systemd. The result is viable for my day to day uses.

What I use the system for

This system is installed on a Thinkpad X60 laptop. I use the laptop for Web browsing using public wifi connections, and I need LibreOffice installed along with GIMP and Audacity. I use GPicView to view images and PCManFM as a file manager. I listen to mp3 tracks bought from Amazon with mocp or mpg123. I use the R statistics package and LaTeX. I need to be able to print documents, read and print PDF files and to scan images. I use Webmail for email on this laptop. I transfer files to and from other computers using USB thumb drives with VFAT formatting. I back up my user files using an NTFS formatted USB hard drive. I like to suspend to RAM between sessions to preserve window layouts and to reduce the time needed to start working on a task.

The stages needed to support my intended uses are...

Install the Debian Jessie base system

Lots of tutorials on the Web. If you have a wifi card that does not require non-free firmware or if you can make a wired connection to your router then you can use the netinstall image. Otherwise you can do a base install from CD-1 and sort out the wifi later.

Set up a wifi connection to local router (temporary)

You may need to install wpa_supplicant and other wifi software...

# apt-get install wireless-tools
# apt-get install wpasupplicant

You may need to download a proprietary firmware package such as iwlwifi-firmware.deb for the Intel wifi cards used in older Thinkpads.

$ wget -c http://ftp.uk.debian.org/debian/pool/non-free/f/firmware-nonfree/firmware-iwlwifi_0.43_all.deb
$ su
# dpkg -i firmware-iwlwifi_0.43_all.deb
# exit

As root edit the /etc/network/interfaces file so it looks like this...

# Home wifi
auto wlan0
iface wlan0 inet dhcp
    wpa-ssid wifi-network-name
    wpa-psk wifi-password

...and reboot into your local fixed wifi. The steps to enable wifi roaming are detailed below once we have some software installed.

Replace systemd with sysvinit and alter the apt configuration (optional)

The systemd project has created a lot of discussion and some people would rather use sysvinit to load various components of the operating system as the system boots. Debian Jessie supports a choice of init systems and associated low level system control scripts. If you have no strong feelings about systemd, just ignore this section!

I followed the first two steps detailed on the without-systemd Wiki page...

# apt-get install sysvinit-core sysvinit sysvinit-utils

Reboot and...

# apt-get remove --purge --auto-remove systemd

I chose not to use the apt-pinning system to prevent any package with 'systemd' in the name being installed as a few applications have harmless libraries that talk to systemd as dependencies. I did create an apt-get configuration file in /etc/apt/apt.conf.d to set the default action to --no-install-recommends to save some typing as suggested by user icebraining on the HN discussion. As root, create the file 90norecommends (the number gives this preference priority over the other files in /etc/apt/apt.conf.d) and add the following lines...

# Puts --no-install-recommends into apt config as default
# http://superuser.com/questions/615565/can-i-make-apt-get-always-use-no-install-recommends/615583
APT::Install-Recommends "0";
APT::Install-Suggests "0";

I add a comment line with the Web address of any references I used to find the command so I know the context in the future.

I use the following commands to keep an eye on what utility libraries are pulled in as dependencies when I install software...

$ dpkg -l *dbus* | grep ii
$ dpkg -l *systemd* | grep ii

On a fully installed Old School Desktop, these commands produced the following output...

keith@moka:~$ dpkg -l *dbus* | grep ii
ii  libdbus-1-3:i386       1.8.18-0+deb8u1     i386         simple interprocess messaging system (library)
ii  libdbus-glib-1-2:i386  0.102-1             i386         simple interprocess messaging system (GLib-based shared library)
ii  libdbusmenu-glib4:i386 12.10.2-1           i386         library for passing menus over DBus
ii  libdbusmenu-gtk4:i386  12.10.2-1           i386         library for passing menus over DBus - GTK+ version
ii  libnet-dbus-perl       1.0.0-2+b2          i386         Perl extension for the DBus bindings
ii  libqt5dbus5:i386       5.3.2+dfsg-4+deb8u1 i386         Qt 5 D-Bus module
keith@moka:~$ dpkg -l *systemd* | grep ii
ii  libsystemd0:i386 215-17+deb8u1 i386         systemd utility library

Enough plumbing, now we need some applications to run...

Install X and install and configure IceWM

I decided to use the venerable IceWM window manager as it comes with applications for displaying desktop wallpaper and is relatively easy to configure with plenty of information just a Web search away. The result looks sufficiently like Windows XP that casual users don't have to ask too many questions. Explaining my other favourite window manager might take a bit longer.

Install the X server and IceWM using the following command as root...

# apt-get install xorg icewm

I like to install all the X drivers for various supported video cards as I sometimes move my operating systems between computers. Some people like to install just the drivers they need for their specific hardware. A Web search will bring up many recipes. I don't bother with a desktop manager such as xdm or slim, I just use a .xinitrc file in the root of my home drive as follows...

keith@moka:~$ cat .xinitrc
xrdb ~/.Xresources
icewmbg &
icewm

The .Xresources file is used to set preferences for xterm which I use as my terminal. I pinched this file from somewhere on the Web and tweaked a few settings...

keith@moka:~$ cat .Xresources
! Use a nice truetype font and size by default... 
xterm*faceName: DejaVu Sans Mono Book
xterm*faceSize: 11

! Every shell is a login shell by default (for inclusion of all necessary environment variables)
xterm*loginshell: true

! I like a LOT of scrollback...
xterm*savelines: 16384

! double-click to select whole URLs :D
xterm*charClass: 33:48,36-47:48,58-59:48,61:48,63-64:48,95:48,126:48

! DOS-box colours...
xterm*foreground: rgb:a8/a8/a8
xterm*background: rgb:00/00/00
xterm*color0: rgb:00/00/00
xterm*color1: rgb:a8/00/00
xterm*color2: rgb:00/a8/00
xterm*color3: rgb:a8/54/00
xterm*color4: rgb:00/00/a8
xterm*color5: rgb:a8/00/a8
xterm*color6: rgb:00/a8/a8
xterm*color7: rgb:a8/a8/a8
xterm*color8: rgb:54/54/54
xterm*color9: rgb:fc/54/54
xterm*color10: rgb:54/fc/54
xterm*color11: rgb:fc/fc/54
xterm*color12: rgb:54/54/fc
xterm*color13: rgb:fc/54/fc
xterm*color14: rgb:54/fc/fc
xterm*color15: rgb:fc/fc/fc

! right hand side scrollbar...
xterm*rightScrollBar: true
xterm*ScrollBar: true

! stop output to terminal from jumping down to bottom of scroll again
xterm*scrollTtyOutput: false

A default install of IceWM is not pretty. The default themes look a little too much like Windows 95 by today's standards. I found the 'Shades of Grey' theme for IceWM which provides a nice flatish looking set of window borders. Installing a theme in IceWM is a case of unpacking the archive in the ~/.icewm/themes directory. The theme then becomes available in the Menu | Settings | Themes list.

The .icewm configuration folder contains a number of files that can be used to customise IceWM...

keith@moka:~$ ls .icewm
menu  preferences  prefoverride  theme  themes  toolbar  winoptions

Below are the entries in these files that I have used. First the menu file...

keith@moka:~$ cat .icewm/menu
#/usr/share/icewm/menu
#keith@moka:~$ cat /usr/share/icewm/menu
# This is an example for IceWM's menu definition file.
#
# Place your variants in /etc/icewm or in $HOME/.icewm
# since modifications to this file will be discarded when you
# (re)install icewm.
#
prog "Xterm" "xterm" xterm
prog "Files" "/usr/share/icons/Tango/32x32/apps/file-manager.png" pcmanfm
prog "Firefox" "/home/keith/firefox/browser/icons/mozicon128.png" /home/keith/firefox/firefox
prog "Chrome" "/opt/google/chrome/product_logo_48.png" /opt/google/chrome/chrome
prog "Office" "/usr/share/icons/gnome/128x128/apps/libreoffice-main.png" /usr/lib/libreoffice/program/soffice
prog "Leafpad" "/usr/share/icons/hicolor/32x32/apps/leafpad.png" leafpad
prog "Images" "/usr/share/icons/hicolor/48x48/apps/gpicview.png" gpicview
prog Gimp gimp gimp
prog Hugin /usr/share/pixmaps/hugin.png hugin
prog Audacity /usr/share/icons/hicolor/48x48/apps/audacity.png audacity
separator
menuprog Gnome folder icewm-menu-gnome1 --list 
menuprog Gnome folder icewm-menu-gnome2 --list 
menuprog KDE folder icewm-menu-gnome --list /usr/share/applnk/
menufile Programs folder programs
menufile Tool_bar folder toolbar

Then the preferences file...

keith@moka:~$ cat .icewm/preferences
#  Desktop background image
DesktopBackgroundImage = "/home/keith/Pictures/tetris_wall_piet.png"

# 1 for centre, 0 for tiling - had to put in prefoverrides
# DesktopBackgroundCenter="0"

#  Workspaces on task bar
WorkspaceNames=" 1 ", " 2 ", " 3 ", " 4 "

#  Clock stuff
TaskBarShowClock = 1
TimeFormat="%H%M"

Some preferences have to be put in prefoverrides because of the theme clobbering the preferences...

keith@moka:~$ cat .icewm/prefoverride
# overriding the shades of grey theme...
DesktopBackgroundColor = "#300002"

# 1 for centre, 0 for tiling
DesktopBackgroundCenter="0"

I've slightly customised the toolbar (bottom panel)...

keith@moka:~$ cat .icewm/toolbar
prog "XTerm" "xterm" xterm
prog FTE fte fte
prog IceCat "/home/keith/icecat/browser/icons/mozicon128.png" /home/keith/icecat/icecat
prog Firefox "/home/keith/firefox/browser/icons/mozicon128.png" /home/keith/firefox/firefox
prog Chrome "/opt/google/chrome/product_logo_48.png" /opt/google/chrome/chrome

And I have one entry in winoptions to get rid of the toolbar on LibreOffice...

keith@moka:~$ cat .icewm/winoptions
# WM_CLASS(STRING) = "libreoffice"
# Found using the xprops utility over a libreoffice window
# You might need the WM_NAME as well as WM_CLASS depending on prog.

# No title bar on LibreOffice
libreoffice.dTitleBar: 0

One hidden gem in IceWM is the way you can navigate the menu by keystrokes - IceWM automatically assigns hotkeys to each entry in the menu. I can launch LibreOffice Impress by hitting mod4 | O | Alt-N | I.

Add command line applications such as locate and updatedb

I just installed some old friends...

# apt-get install powertop curl ssh updatedb locate rdesktop rsync htop alsa-base alsa-utils mpg123 lame moc R texlive gnuplot

Add graphical applications including a Web browser

I decided to run Firefox-ESR and Chrome as user from the binaries downloaded direct from mozilla and google. See the IceWM config files for how to create toolbar launchers and menu entries. Other graphical applications were installed as below...

# apt-get install mtpaint gimp scrot hugin audacity libreoffice pcmanfm geany leafpad tango-icon-theme myspell-en-GB 

The tango-icon-theme package (or any other set of GTK2 icons you like) is needed for the graphical PCManFM file manager to display some icons. You also have to add a gtkrc-2.0 file with the following line in...

keith@moka:~$ cat .gtkrc-2.0
gtk-icon-theme-name = "Tango"

Music: as jackalope pointed out on the HN page, you can run mpg123 with the -C option and use keyboard shortcuts to control volume and pause...

$ cd Music
$ mpg123 -C *.mp3

Then press h for a help screen within mpg123 like this...

Terminal control enabled, press 'h' for listing of keys and functions.

Playing MPEG stream 1 of 55: 36-layla.mp3 ...

MPEG 1.0 layer III, 32 kbit/s, 44100 Hz stereo


 -= terminal control keys =-
[s] or [ ]      interrupt/restart playback (i.e. '(un)pause')
[f]     next track
[d]     previous track
[b]     back to beginning of track
[p]     loop around current position (don't combine with output buffer)
[.]     forward
[,]     rewind
[:]     fast forward
[;]     fast rewind
[>]     fine forward
[<]     fine rewind
[+]     volume up
[-]     volume down
[r]     RVA switch
[v]     verbose switch
[l]     list current playlist, indicating current track there
[t]     display tag info (again)
[m]     print MPEG header info (again)
[h]     this help
[q]     quit
[c] or [C]      pitch up (small step, big step)
[x] or [X]      pitch down (small step, big step)
[w]     reset pitch to zero
[k]     print out current position in playlist and track, for the benefit of some external tool to store bookmarks

Also, the number row (starting at 1, ending at 0) gives you jump points into the current track at 10% intervals

Set up wpa_supplicant and wpa_gui to allow use of public wifi connections

I used a post on the XRunHProf blog to set up wifi roaming using wpasupplicant and wpa_gui. There is a useful background page on the aptosid wiki. I'm putting an outline of the instructions here in case of bit rot. According to the comments on the xrunhprof page, these steps have been in use since Squeeze.

Alter /etc/networking/interfaces so it has the lines shown below...

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

#wpagui section
auto wlan0
iface wlan0 inet manual
    wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

Then make a basic wpa_supplicant.conf file using nano with the two lines below (to start with).

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

Your user needs to be in the netdev group (usually is when using Debian Installer to set up a user). The first line allows your default user to run wpa_supplicant itself. The second line makes it possible to save configurations to the .conf file. You will still need to run wpa_gui as root, so I will probably install sudo and add a sudo permission line to start wpa_gui from the default user account.

Then install the wpagui package

# apt-get install wpagui

Then either restart networking or reboot and bring up DWM or IceWM. Running wpa_gui from a terminal as root will bring up a window that has a list of existing connections, and buttons for connecting, disconnecting and scanning for new networks. Click the scan button. A new window appears, click the scan button in that second window and the various networks available appear. Double click on the line showing the network you want to connect to and the details are transferred to a third window. Close the second scanning window at this point. In the third window, add the PSK pass phrase if it isn't an open connection. and then click Done. You will find the new network listed in the first window. Select it there and click connect. The network will connect, and the configuration will be stored in the wpa_supplicant.conf file. Pass phrases are stored in plain text so the blog page (and man pages) suggest setting file permissions 600 on the wpa_supplicant.conf file.

When you have connected successfully, closing the window results in wpa_gui minimising to the system tray area on the IceWm bottom bar, or just disappearing if you are using DWM. The connection will actually continue to run if you quit wpa_gui from the terminal using Ctrl-C. When a network in a large building has a large number of access points at different frequencies and signal strengths, leaving the scanning window open seems to result in rapid reconnection and 'AP failed to connect' messages. I close the scanning window once a connection has been chosen. I have my home connection and half a dozen open wifi access points in the wpa_supplicant.conf file now, and they will connect automatically when found.

Install pmount to mount usb drives

Any form of automounting of USB sticks brings in the mudball. I use the pmount package to allow mounting from my user account at least. Simple install...

apt-get install pmount

...and simple commands to use if a bit fiddly. First you need to know where your usb stick is in the /proc system. I plug it in and use dmesg

dmesg | tail

Typical output looks something like this...

keith@kona:~/Music$ dmesg | tail
[10376.405727] sd 6:0:0:0: [sdb] Write Protect is off
[10376.405738] sd 6:0:0:0: [sdb] Mode Sense: 23 00 00 00
[10376.406486] sd 6:0:0:0: [sdb] No Caching mode page found
[10376.406495] sd 6:0:0:0: [sdb] Assuming drive cache: write 
through
[10376.410508] sd 6:0:0:0: [sdb] No Caching mode page found
[10376.410518] sd 6:0:0:0: [sdb] Assuming drive cache: write 
through
[10376.532018]  sdb: sdb1
[10376.534725] sd 6:0:0:0: [sdb] No Caching mode page found
[10376.534732] sd 6:0:0:0: [sdb] Assuming drive cache: write 
through
[10376.534737] sd 6:0:0:0: [sdb] Attached SCSI removable disk

So I know the usb stick partition that I want to read and write to is at /dev/sdb1

pmount /dev/sdb1

And then I can see my files at /media/sdb1

keith@kona:~/Music$ ls /media/sdb1
brahms_o36.mp3  brahms_op115.mp3  brahms_Op88.mp3  Documents  text

The mount command reassures me that I have read/write access

keith@kona:~/Music$ mount | grep sdb
/dev/sdb1 on /media/sdb1 type vfat 
(rw,nosuid,nodev,noexec,relatime,uid=1000,gid=1000,fmask=0177, \
dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,quiet,\
utf8,errors=remount-ro)

You have to unmount the usb drive using the command pumount. I always run the mount command after that to check the drive has been unmounted.

keith@kona:~/Music$ pumount /dev/sdb1
keith@kona:~/Music$ mount | grep sd
keith@kona:~/Music$ 

Notice my grep search pattern. Just in case I plug two usb sticks in (/dev/sdb1 and /dev/sdc1).

Install sudo and pm-utils to allow suspend to RAM and shutdown as user

Install sudo and pm-utils. The sudo package allows us to define a limited number of commands that the user can run as root without needing to set a password. First install the sudo and pm-utils packages then add your user(s) to the sudo group...

# apt-get install sudo pm-utils
# usermod -a -G sudo keith

Then you need to become root and edit the file at /etc/sudoers.d/local. My sudoers file looks like this (I need to add wpa_gui)...

root@moka:/home/keith# cat /etc/sudoers.d/local
keith ALL = (ALL)ALL
keith ALL=NOPASSWD:/usr/sbin/pm-suspend, /usr/sbin/reboot, /sbin/shutdown

I've aliased pm-suspend to zzz in my .bashrc file as below (pinching an idea from the OpenBSD default install). I need to research detecting lid-close events so that I can run sudo pm-suspend when closing the lid.

# alias for suspend function
function zzz {
sudo pm-suspend
}

Worth it?

If you follow these instructions, you get a functioning Old School Desktop. You will find that you spend longer typing stuff into terminal windows to carry out routine operations. But then wifi connects in an instant, and memory use is very low. It is a personal choice after all.