Alan Swanson

Not so much a programmer, as someone who fiddles with things.

These are a few Linux and Unix programs plus some application themes I've made, contributed or adjusted to suit myself. Not much original art work though: I'm just using whats available to make things that aren't! Any comments to me.



loki compatibility libraries

For running old Linux games.
Last updated 7 Feb 2012

Unknown changes in glibc 2.3 (and newer) cause problems for these old games resulting in a segmentation fault when trying to run them, the suspects are threading and C++ ABI incompatibility. Using the static binaries can be problematic as the libraries compiled into them are old and have bugs. The solution is to use an old version of glibc such as 2.2.5. However all the other libraries linked by the game must also be compiled against an equally old (or older) version of glibc.

So here is a package of up to date libraries for successfully playing old games with.


sdl key combos

Super game combos.
Last updated 31 Jan 2012

Wishing you could Alt-Tab out of fullscreen games under Linux? Also wishing you could adjust the volume from fullscreen games under Linux?

The problem is that games using SDL, or otherwise, under X11 grab all mouse and keyboard input with to lock the mouse to the window. This is desirable, but which then prevents the window managers from registering Alt-Tab or other key combinations. Unfortunately, Alt-Tab wasn't set as a standard by SDL leaving the games to support Alt-Tab themselves in their own input routines. And they mostly don't... However many do at least support Alt-Return or Alt-Enter to toggle between fullscreen/windowed and also Alt-g to enable and disable the input grab when windowed.

One solution I'd found, originally for NWN, was to patch SDL itself to intercept Alt-Enter and Alt-g requests to replicate the above. This patch here is further work and now optionally supports;

After applying the patch you'll need to regenerate the configure file with to activate XF86 vendor key symbols. Then the following command line options will activate the respective overrides above;
     SDL_OVERRIDE_SOUND=1 Note: Multimedia keys will always be overriden.
     SDL_OVERRIDE_ALL=1 Note: Will apply all the above.

I'm currently leaning towards enabling the Alt-Tab override by default as no game I've played ever supports it. However there are possible problems with OpenGL apps not reloading context and textures when switching between fullscreen, windowed and minimised so the screen gets corrupted but most appear ok though.

Plans for the future. Add a game lookup table so combos not used by the game re automatically enabled. And if somebody actually likes Pulseaudio, please send a volume control patch!

Other varieties of solutions for this problem on SDL include running a separate X server, preloading sdlhack or patching with sdl-nokeyboardgrab.

SQLite Natural Sort Collation

sqlite natural sort collation

For human sorting.
Last updated 15 Feb 2011

A collation function to use with SQLite for the natural sorting of strings, ignoring case and any leading spaces. Natural sorting is different from normal sorting by the comparision of the whole number as humans would read rather than just per character. For example;

CHARACTER SORT a0 a04 a05 a06 a1 a10 a11 a12 a2 a3 a7 a8 a9
NATURAL SORT a0 a1 a2 a3 a04 a05 a06 a7 a8 a9 a10 a11 a12

This code is GPL licenced as it uses a strverscasecmp function which has been derived from the uClibc strverscmp function which in turn was derived from glibc strverscmp function. To use in a SQLite query you need to first register the collation;
      sqlite3_create_collation(db, "naturalsort", SQLITE_UTF8, NULL, naturalsort);

And then in any query request its usage;
      SELECT * FROM table ORDER BY field COLLATE naturalsort

Gnome Touchpad

gnome 2.32 touchpad scrolling

For human sorting.
Last updated 31 Jan 2012

A couple of patches to fix Gnome 2.32 to allow use of edge and two finger scrolling, without having to run xinput or synclient every time you start a desktop session, instead of one only. Probably genuinely overlooked but given how pontificating and self important Gnome developers are, it was also possibly too confusing for users to able to use both...


xscreensaver lock window themes

Replacement for ugly password lock window.
old versions
themes & instructions
Last updated 27 Jun 2005

XScreenSaver is a ubiquitous program on Unix for preventing the pixels of your monitor from burning in, providing pretty animations and providing password protection. However, the default lock window used for password protection is bloody ugly.

The author of XScreenSaver has an explanation on why toolkits like GTK and QT are not used for the lock window and I'd agree with his points. However, why not have a built-in theme that is secure?

So what I'm providing here is a framework for creating built-in themes. (Note that themes are not run time changeable - only one can be included at any time.) The default theme is shown the above screenshot and other themes are available in the themes page. Creating a new theme requires some graphical talent (of which I have none) for the frame and logo and some programming experience if you wish to adjust the interior. Please feel free to submit themes and I will include them on the theme page.

Important: Not compatible with XScreenSaver 5.00 and newer and I am no longer using XScreenSaver so unlikely to be fixed. Sorry.
Notes: Version 1.1 patches XScreenSaver 4.22 and perhaps newer versions. (One easily fixable hunk failure against 4.21.)
Notes: Version 1.0 patches XScreenSaver 4.15 to 4.20 and perhaps older versions.

Wmfire : Burning CPU Wmfire : Mouse Over Network Monitoring


Fiery dock app.
old files
Last updated 4 Mar 2010

This is an update of the original wmfire dock applet. Like the wmufo program it uses the GDK library to improve its speed - using less than half the cpu of the original program.

It can monitor the average cpu load, or individual cpu load on SMP computers. Additionally it can monitor the memory, network load, a file or just be set to show a pretty flame. On entering the dock a burning spot replaces the cursor, and after two seconds symbols to represent the current monitor are "burnt" onscreen. The flame colour can also be changed.

Old versions (including the original XLIB version) can be found here.

Changelog 1.2.4: Fix linking math library with --no-add-needed or --as-needed
Changelog 1.2.3: Add sticky option and fix regression causing second window
Changelog 1.2.2: Added file monitoring and GTK 2.4 docking fix
Changelog 1.2.1: Fix memory leak

Wmlife Wmlife 2 Wmlife 3


Life and death.
old files
Last updated 18 Feb 2012

Wmlife is a dock app running Conway's Game of Life (and program launcher). Life is played on a grid of square cells where a cell can be either live or dead. In the rules, you count the number of live neighbours for each cell to determine whether a cell lives or dies;

Birth A dead cell with exactly three live neighbours becomes a live cell.
Survival A live cell with two or three live neighbours stays alive.
Overcrowding / Loneliness In all other cases, a cell dies or remains dead.

Normally Life is implemented on an infinite board but due to size restraints wmlife implements the grid as a torus. In a torus, the grid wraps at the edges from top to bottom and left to right.

Changelog 1.0.1: Add sticky option, fix regression causing second window and disable GDK client-side rendering
Changelog 1.0.0: Initial release

Wminet : Default


Network connection monitor.
Last updated 22 Nov 2001

Very useful dock app for monitoring internet connections to and from your computer. The number of connections can be filtered based on local and remote addresses and ports, on either tcp or udp. It can also display hostname and number of processes.

This new version uses a lot less CPU and allows greater configuration. The original program can be found here. However, I have removed the ability to monitor httpd and ftpd processes, nfs mounts and lpd queues.

Wmtop : Default


Visual process monitor.
Last updated 19 Jan 2001

Very useful dock app for monitoring the top three processes using cpu or memory. The wmtop homepage is here.

Wmseti : Info Wmseti : Info Two Wmseti : Alien Face Wmseti : Alien Face Two


For monitoring and the control of upto 10 SETI@home processes.
old files
local files
Last updated 27 Feb 2003

For monitoring and the control of upto 10 SETI@home processes. It can display various statistics and can pause/continue or kill/run the program. It can be compiled with or without graphics showing alien faces coming out of the shadows as the workunit progresses, with a progress bar that is green for running, yellow for paused, and red when not running.

Statistics for display are;

Controls available;

Downloads and CVS are available at the SourceForge wmseti site. Downloads can also be found locally.

Wmufo : Frame Animation Wmufo : Frame Animation 2


Extra eye candy included.
old files
local files
Last updated 4 Dec 2005

This is wmseti on steroids! This application contains the same statistic display as wmseti but with animation instead of alien faces. Imagine the above snapshots with a flowing starfield, a spinning saucer UFO and various alpha blended glowing ball UFOs travelling back and forth across the window.

The sprite routine is developed from wmfishtime which is a dock app with swimming fish, an anti-aliased analog clock, and alpha blended bubbles. While providing fluid animation the routine does not use up cpu time - much less than other dock apps using the wmgeneral library as it uses the GDK library (part of GTK) to draw complete buffers onto the screen rather than individually drawing each pixel. More is less!

Downloads and CVS are available at the SourceForge wmseti site. Downloads can also be found locally.

Notes: Still a pretty UFO even if it no longer supports newer SETI@home control.
Changelog 1.2.3: Add sticky option and fix regression causing second window
Changelog 1.2.2: Fix for undocumented change in libgtop 2.8.0
Changelog 1.2.1: Fix memory leak, fix GTK 2.4 docking, move UFO's vertically when uploading or downloading workunits.

BrushedMetalNew : Main BrushedMetalNew : Alternative Aliens : Main Aliens : Alternative

gkrellm skins

Themes for GKrellM.

These are two skins for GKrellM based on themes for the Enlightenment window manager of (nearly) the same names.

GKrellM is probably the best usable monitoring eyecandy for Unix just now. The homepage for GKrellM can be found here and the theme site here.

Last updated: brushedmetalnew 19 Jan 2001
Last updated: aliens 19 Jul 2003

Disk IO Patch

diskio patch

Linux kernel 2.4 patch - disk I/O.
old versions
Last updated 21 Aug 2004

The 2.4.X kernel doesn't report disk IO in /proc/stat for any devices over either major 16 or minor 16. This inclues /dev/hdb and /dev/hdd. This patch changes the system from using a memory wasting array to a more intelligent list system. It is marginally more expensive in overhead processing for each disk IO.

PRO Less memory required, faster /proc/stat, all block devices recorded.

CON Timing critical section? Negligible for desktop user, and minimal impact for a server with umpteen SCSI arrays.

Since version 2.4.20 the kernel can now optionally report disk statistics in /proc/partitions for all drives and each individual partition. I'll still be keeping this patch upto date as I use it for GKrellM and for any other programs that use /proc/stat. To its advantage, reading /proc/stat uses much less overhead than reading /proc/partitions ten times a second.

Notes: The patch-diskio-2.4.27-1 file patches kernels 2.4.19 to 2.4.27
Notes: The patch-diskio-2.4.18-1 file patches kernels 2.4.14 to 2.4.18
Notes: Patch now supports DAC960, SMART2 and CISS devices if compiled as module or into kernel

the end