How to make a minimalist desktop

There are many different desktop environments available for Linux (and other platforms with X11). These range from the more well-known, newbie-friendly, featureful options such as KDE and GNOME, to a vast array of more esoteric alternatives. If you've used something like KDE for a while and you feel that:

then you might like to try some of these alternatives.

One of the first things to realise is that under X11, there are many small, co-operating tools. This is the case even under KDE, it's just that normally you don't see the separate programs unless you look for them. This separation provides a high degree of flexibility and choice, since for the most part you can choose any combination of utilities and they will work together.

The Easy Way

If you want less of a kit-car approach, but still want a faster, less bloated environment, you could use one of these:

Window manager

This is the program that draws borders on windows, controls which of your windows has focus (receives key presses), and usually provides you with a way of switching between them (e.g. Alt-Tab). There are various good choices here, depending on just how minimal/fast you want things to be.

Gtk application theming

To make Gtk applications look nice while using a minimalist window manager, you can install and use a theme. On Debian:

aptitude install gtk-theme-switch gtk2-engines

then run:

switch2

(From http://www.earth.li/~noodles/blog/pretty-gtk.html)

Launching and switching programs

Especially if your window manager doesn't do this itself (e.g. evilwm), you might want some other means of launching programs.

Simple keyboard shortcuts: xbindkeys

A program like xbindkeys (available in most distributions) will simply sit in the background and watch for keyboard shortcuts. The config file looks like this:

# ~/.xbindkeysrc
# Mod4 is usually meta, which for me is the windows key
# Terminal on Ctrl-Alt-Return (evilwm already does this, uncomment if needed)
#"xterm &"
#                Mod4 + Return
"irate-client &"
                  Mod4 + a
"mozilla-firebird &"
                  Mod4 + e
"xmms &"
                  Mod4 + m
# OpenOffice writer
"oowriter &"
                  Mod4 + o
"xfrun4 &"
                  Mod4 + r
# Monkey Island and other games
"cd ~/backups/scummsaves; scummvm &"
                  Mod4 + s
"gtetrinet -c som.uwcs.co.uk -n cmb &"
                  Mod4 + t
# News reader
"xterm -e slrn &"
                  Mod4 + period
# instant messaging
"ebqt &"
                  Mod4 + slash
"xautolock -locknow &"
                  Mod4 + semicolon
"xautolock -exit &"
                  Mod4 + Backspace

This goes in /home/yourusername/.xbindkeysrc. There are several other examples on the xbindkeys home page, demonstrating extra features like selecting keys by numeric keycode, reacting to modifiers alone, and the use of e.g. numlock as a modifier.

More of the same: keylaunch

You could use keylaunch instead, although it's a bit less versatile (this link is to the debian package, the original homepage appears to be dead). The config file looks like this:

# Format:
# key=...KeyName:Command
#
# ... No modifier
# *.. Shift
# .*. Ctrl
# ..* Alt

# Terminal on Ctrl-Alt-Return (evilwm already does this, uncomment if needed)
# key=.**Return:xterm
# Calculator on Ctrl-Alt-C
key=.**c:xcalc
# Run dialog on Shift-Ctrl-Alt-R
key=***r:xfrun4
# Kill xautolock (should end the session) on Shift-Ctrl-Backspace
key=**.Backspace:xautolock -exit

This goes in /home/yourusername/.keylaunchrc

Run dialog: XFrun4

This is the run dialog from XFCE. It's sometimes useful to have if you don't want to bring up a full terminal emulator just to run one command.

Panels and taskbars

There are panels available that read a small config file in your home directory and give you icons to click on, again nowhere near as featureful as KDE's panel. Some of them provide a taskbar as well, which you may want. I personally just do without, since I don't tend to forget what's running (it's usually not a lot) and to switch tasks I can just use Alt-Tab. There are various bits you can use, some from lightweight desktop environment suites, others written in isolation to fill this kind of need.

Security and screen savers

xtrlock

Larger desktop environments come with screen savers, which can be set to require a password. You can do this with much less window-dressing using xtrlock. It simply changes the cursor to a padlock icon and ignores all keyboard and mouse events except your password being entered, at which point it exits, releasing the X11 server. All the running applications can still be seen, which you may regard as an advantage if for example you want to leave your machine across the room, safely locked, but still be able to see when some long-running operation has completed. To engage this automatically after some idle time, use xautolock as below.

xlock / xlockmore

xlock is more of a traditional screensaver, hiding your session behind one of several animations (compiled into xlock). Again, this does not engage automatically and you'll need something like xautolock.

XScreensaver

XScreenSaver is a larger more versatile big brother to xlock. This one *does* engage automatically, and has a graphical config editor, animations as separate programs, and various other extra features.

xautolock

xautolock will watch for inactivity and launch some predefined program. It doesn't have to be something that locks the screen, but that's its usual use. It can also trigger this when the mouse is left in a corner for some number of seconds. It can be disabled, enabled or told to exit from the command line. If xautolock is used as the one program left in the foreground of an xsession (holding the session open, see below), it ensures that your session always has a lock on it (or else it ends).

Miscellaneous

Setting the background

You can use xsetroot (which comes with X11), but for that your background must be an X bitmap, i.e. you have to keep a very large file lying around. I prefer Esetroot, which comes with Eterm (a terminal emulator with many shiny graphics features). This can handle Know.JPEG (jpg) files, which is much more convenient.

Keeping an eye on your machine

If you haven't already tried it, I highly recommend GKrellM, a kind of tall stack of system monitors (graphs, sliding meters, "LEDs", etc) showing CPU usage, process forks, disk usage, network traffic, mail, laptop battery power, you name it. There are also plugins for a vast range of other tasks, and if your needs are obscure enough to want something that it can't do yet, chances are you know enough C to write a plugin yourself (it's not difficult).

Joining it all together

When you run startx, or log in using a display manager (graphical login dialog) such as xdm, kdm or gdm, by default it will look for a file /home/yourusername/.xsession which you should set executable (chmod 755 ~/.xsession) and which it will run as a shell script (what happens if that's not there varies between display managers). This script should launch all the programs that you want started when you run X11, and then it should stay running, because when this script ends, your session is considered to have ended, and you will be logged out. Thus you might want to launch most things with & (to background them) except one program on the last line. Here is an example xsession with comments:

# EvilWM with Ctrl-Alt-Enter mapped to xterm
evilwm -term xterm &
# xbindkeys (configured in ~/.xbindkeysrc)
xbindkeys
# Set the background
Esetroot /home/cmb/media/pics/wallpaper/machall195wp.jpg
# Make sure the default cursor is sensible
xsetroot -solid black -cursor_name left_ptr
# System activity monitors
gkrellm &
# Run xtrlock after 3 minutes inactivity or when the cursor is left in the bottom 
# right for 1 second. When xautolock exits, the session is considered to have ended 
# cleanly, so you can have a keylaunch binding for xautolock -exit as a means of 
# properly ending your session.
exec xautolock -time 3 -locker /usr/X11R6/bin/xtrlock -corners 000+ -cornerdelay 1

If your session fails or one of the programs crashes during your session, you can find the output from stderr in /home/yourusername/.xsession-errors


Chris Boyle and PlanarPlatypus


CategoryTutorial

Wiki: MinimalistDesktop (last edited 2009-02-17 15:52:28 by localhost)