Good virtual desktops for Windows

I would like to thank Blissex for pointing out to me a project called VirtuaWin. It's a virtual desktop program for Windows which is much, much better than the MSVDM crap Microsoft gives away.

Seriously, VirtuaWin just puts MSVDM to shame. I've only been using it for one day, but I can say that with confidence. For one thing, it works reliably and doesn't corrupt my windows. It also is much more configurable, allowing you to define your own hotkeys and change the number of virtual desktops, among other things. It also has edge flipping, which I personally hate, but is missing from MSVDM.

The other great thing about VirtuaWin is that is supports extension modules. The one absolutely essential module is the "Cool Desktop Switcher" module, which basically implements a simple pager (same style as MSVDM) in the notification area (a.k.a. the system tray). This also has various cool configuration options, including custom icons for the pager buttons. Once you have this module, you have the perfect replacement for MSVDM.

So, if you want virtual desktops on Windows, check out VirtuaWin. It's really great and it's free software. What more could you possibly want? Thank you VirtuaWin developers! Your hard work is greatly appreciated.

More auto-run success

I'm back from a week in an ocean-side cabin on Cape Cod, and I'm feeling refreshed. So refreshed, in fact, that I dusted off my rusty C++ skills and did some hacking on autorun.

For those who don't know about it, autorun is a little program that detects when you insert a CD into a CDROM drive and automatically mounts it and pops up a file manager at the mount point. Yes, this is essentially the same thing I did with udev just a couple of weeks ago. The difference is that since the CDROM devices aren't created dynamically (they're always there, like the hard drives), udev doesn't create anything when you insert a disc. Thus we need a separate program to check if the contents of the drive have changed, which is where autorun comes in.

Now, there's only one problem with autorun: it isn't designed to work with autofs. In fact, half the point of autorun is to automatically mount a CD when it is inserted. Now, in my case, I don't want it to do that, because autofs takes care of that for me. Furthermore, autorun detects mount points from /etc/fstab, which doesn't really work that well for autofs. Thus the need to hack on it.

So, I re-worked autorun a bit so that it now works well with my automounting CDROM and DVD-ROM drives. You pass it the device files on the command line and, if automount is running, it will check /etc/auto.master and get the mount points from the map files listed there. It will also refrain from trying to mount the medium and will just run the notification commands (e.g. kfmclient for data discs and kscd for audio discs) when the medium is changed. This gets me the ability to run commands on a CDROM change, yet still allows me to use automount. Cool.

I realize I'm probably the only person in the world who cares about this, but if you happen to be curious, you can download the patch file here. For those who don't like to deal with patches, I also put up a full patched source archive. If you get an error due to not having xmltoman installed, you can just run touch autorun.1 to update the modtime on the man page and bypass that step of the build.

Pop up the file manager

The other day, I posted about Xandros popping up the file manager on a USB drive insert. Well, I looked into it, and I figured out how they did it. In fact, I wrote up a little article explaining how I got my Slackware system to do this. I even included the script I wrote for it.

So now I can insert my USB thumb drive into my system, wait a second, and Konqueror will automatically launch and show me the contents of the drive. It turns out it wasn't even that hard to set up. It's all done through udev, so all you need to know is how to write a shell script and which directory to put it in.

For some reason, I'm awfully pleased with myself for figuring this out. Now it's time to move on to setting this up to work with my MP3 player (which can't be mounted as a block device).

How does Xandros do it?

You know one of the really nice features in Xandros? When you insert a USB pen drive or some such removable media, it pops up a file manager window for it, kind of like Windows. I find this to be a really nice feature, because, when you think about it, how often do you insert removable media and not want to work with it right away?

The only question is, how the heck do they do it? I suspect it must have something to do with hotplug, but I have no idea how that works. I'd love to make this work on Slackware, but I think this will take some research. Does anyone else have any ideas?

A new addiction

I've recently acquired a new favorite game: Konquest. It's one of the games that ships as part of KDE, and it has that wonderful addictive quality to it - for me, at least.

For those who don't know it, Konquest is a "galactic strategy game" which is incredibly simple to play. You compete against any number of other players for control of a galaxy consisting of any number of planets. Once controlled by one of the players, each planet builds a given number of space ships each turn. These ships have a combat rating determined by their planet of origin. The idea is that as you create ships, you send them out to conquer other planets. How successful you are depends on how many ships you can build and how strong they are in battle.

To me, this game has the same feel as Bandit Kings of Ancient China. I think it's the combination of a strategic element with simple game play. It's kind of like chess (which I'm rotten at, by the way) - the rules of the game are quite simple, but coming up with a winning strategy can be quite difficult.

Of course, I'm not trying to put Bandit Kings and Konquest on the same level as chess, but all three have fairly simple rules that make them fun to play. Sure, maybe Bandit Kings stretches the analogy a bit, but compared to some of the newer crop of strategy games, it's child's play. I've played a few that, in an effort to be as "realistic" as possible, included so many features and nuances that figuring them out was more like work than play. That might be great for the hard-core gamer type, but if I want to work, I'll fire up a code editor. Games are supposed to be for relaxing.

On Virtual Desktops

Some time back, I mentioned the suckiness of MSVDM. For those who don't know, MSVDM is Microsoft's Virtual Desktop Manager. It's one of the "Power Toys" for Windows XP, and is basically a poor copy of the virtual desktop pagers that have been available in UNIX window managers for years. It's basically an unnecessarily large label with five buttons after it: a "preview" button that shows nice, scaled previews of all the desktops and lets you select one, and then one button to switch to each of the four available desktops. Incidentally, Microsoft applied for a patent related to this.

The first time I heard of this, I thought it sounded great. I've been completely hooked on virtual desktops ever since I started using them in AfterStep. This is probably due to the fact the virtual desktop handling in AfterStep (and most UNIX window managers, for that matter) is quite good. In AfterStep, you can configure virtually every aspect of virtual desktops, from number of desktops and pages to which applications open on which deskotp. It also has a really nice pager program.

I continued using virtual desktops when I switched to Sawfish and ROX, and then when I switched then to KDE, although the quality of virtual desktop support was reduced with each change. KDE's virtual desktop support is OK, but not nearly as nice as AfterStep's. However, it's still a lot better than what Microsoft has.

Unless you've used both MSVDM and the pagers for UNIX window managers, it's hard to describe how truly bad MSVDM is. For one thing, that big "MSVDM" label takes up a lot of space in the taskbar, and as far as I know, there's no setting to turn it off. (Edit: actually, you can - see the comment here.) Sure, you can do what I did and hack the DLL in a hex editor (the string is at 0x71C, and you can't make it NULL - the first character has to be something, e.g. a pipe |), but the point is, you shouldn't have to. Although on the up side, they did provide configuration dialogs to change the hotkeys and per-desktop wallpaper.

The second crumby thing about MSVDM is that it has a nasty tendency to screw things up. I'm not entirely sure how it works, but it appears to involve minimizing windows and hiding their taskbar entries when you leave a desktop. How do I know this? Because you can see the windows and taskbar icons flash. Not that that bothers me - it's just the programs that aren't restored correctly that get on my nerves. For example, using Visual Basic 6 in SDI mode seriously screws up the display when you switch back to it. Basically, you end up with a bunch of empty borders where child windows should be. Plus Visual Studio .NET doesn't come back at the right size if you had it maximized. And did I mention that if you're doing any heavy processing in the background, it has a tendency to temporarily freeze up between switches, leaving you caught in desktop limbo? Or that the Visual Basic .NET upgrade wizard crashes if you switch desktops while it's running? And let's not forget how it loses the toolbar in Excel.

So, basically, the only things that MSVDM has going for it are that it's free and marginally better than nothing. In fact, many of the "Power Toys" seem to work that way. That wouldn't be a problem if they were open-source, because I could just fix them. But that's not the Microsoft Way. Sigh.... That's why I've switched to VirtuaWin.

The Marble Mouse scroll buttons finally work!

Well, it's probably been over a year since I looked for an answer, but I felt lucky tonight. And lucky I was.

You see, I've been using trackballs for years. Yeah, I know people complain that they're clunky and slow, but I don't care. I think they're more comfortable than using a mouse, so that's what I use. Messes up anyone else who tries to use my computer, though.

Anyway, about two or three years ago I invested in a Logitech Marble Mouse USB. It's one of those with the marble in the center the you control with your index and middle fingers. It has no scroll wheel, but four buttons - the two "main" buttons and two small scroll buttons. Well, they're scroll buttons on Windows, at least. I couldn't get XFree86 to recognize them. Or, more to the point, I couldn't get it to recognize them as the scroll buttons. It quite happily used them as redundant second and third buttons.

However tonight, with nothing more than a quick Google search, I have found an answer. I simply changed the mouse section of my /etc/X11/xorg.conf to read as follows:
Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "ExplorerPS/2"
Option "Device" "/dev/input/mice"
Option "Buttons" "7"
Option "ZAxisMapping" "6 7"
EndSection

Now it finally works! A few modifications to my ~/.Xmodmap (I use it left-handed) and I was good to go. However, it's still not perfect, as you have to keep clicking to scroll. It would be much nicer if holding the scroll button would keep scrolling, but I'll live. It's certainly better than the two useless buttons I had before.