intertwingly

It’s just data

Making Myself at Home (temporarily) on XP


My three year old laptop has been doing a yeoman’s job... though the USB ports only work intermittently, the little nub below the screen that allows the laptop to detect when the lid is closed has worn off, and a chunk is now missing to the right of the right arrow key.

So when I heard that I could get issued a T61p, I figured it was time.

Initial observations:

What that probably means is that I will request a second hard drive and install Ubuntu on it.  That looks to be an adventure of sorts for another day.

Meanwhile, it took literally only minutes to install Cygwin, Pidgin, Firefox, and Thunderbird.  The configuration and data files for the latter three are portable across OSes.  Other programs like inkscape, gimp, and imagemagick are also available as needed.

When last I looked at Cygwin, I was unimpressed.  As a migration aide from the Windows world to the Unix world, it seemed to add a lot of conceptual complexity as you had to deal with line ending issues, slash direction issues, and artifacts like /cygdrive/c/.  And the Cygwin window was a bit anemic, and did not handle either the title bar or resizing very well.

None of this has changed, but I have, and I hadn’t previously factored in the availability of xterm.  Now that I have been immersed in the Unix world for a few years now, I now look at the cygwin view on the filesystem not as a migration aide, but as if it were a whole separate disk partition, one where the legacy Windows filesystem is pre-mounted for occasional convenience.  It takes a few symlinks to complete this illusion.  For example, on my Ubuntu laptop, I have a /home/rubys/Desktop directory.  I can achieve the same effect on Cygwin by executing the following command:

ln -s /cygdrive/c/Documents\ and\ Settings/Administrator/Desktop/

XTerm requires a bit more planning.  The provided C:\cygwin\usr\X11R6\bin\startxwin.bat batch file both starts the Cygwin/X X Server and creates an XTerm window.  That bundling is a bit odd as if you attempt to use it a second time to create a second window, you get an error message about there already being an X Server window already running.

So the plan is to start X at boot time, and create a second batch file that only creates an XTerm window.  The first is easily accomplished by creating a shortcut to startxin.bat and placing it in C:\Documents and Settings\All Users\Start Menu\Programs\Startup.

Now create a second batch file with the following:

@ECHO OFF

SET DISPLAY=127.0.0.1:0.0

SET CYGWIN_ROOT=\cygwin
SET RUN=%CYGWIN_ROOT%\bin\run -p /usr/X11R6/bin

SET PATH=.;%CYGWIN_ROOT%\bin;%CYGWIN_ROOT%\usr\X11R6\bin;%PATH%

SET XAPPLRESDIR=/usr/X11R6/lib/X11/app-defaults
SET XCMSDB=/usr/X11R6/lib/X11/Xcms.txt
SET XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
SET XNLSPATH=/usr/X11R6/lib/X11/locale

%RUN% xterm -e /usr/bin/bash -l

Create a shortcut for this batch file.  Go into the properties for this short cut, and select Change Icon.  Browse to C:\cygwin\usr\X11R6\bin\XWin.exe, open it and select the icon.  Now drag and drop the shortcut onto the Taskbar.

Finally, add the following to .bash_profile:

export PS1="\u@\h:\w\$ "

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*) 
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
    ;;
*)
    ;;
esac

All in all, cygwin is no replacement for apt, but it is something I can work with.

So for now, I have all the stability and security of Windows and the user friendliness of Unix.  And yet, somehow, those words don’t quite have the same sting they had just a few years ago.

I still need a replacement for Tomboy — a C# application that doesn’t run on Windows.  Funny that.