Brian's lovable online gazette

Tuesday, December 15, 2009

GNOME with Fluxbox

I've mentioned before that I'm a big fan of Fluxbox. Nevertheless, I'm also a big fan of the GNOME project and Gtk. I like gnome-panel, gnome-keyring, gnome-power-manager, and a whole host of programs that run as part of a GNOME session. I just happen to not like Metacity and Nautilus--or maybe it's just that I like Fluxbox a lot. I also love gnome-settings-daemon and having a nice way to set backgrounds and nice looking themes (something that Fluxbox is missing).

Here's some boring history... Feel free to skip it.

I've always had trouble getting GNOME and Fluxbox to play nicely. I could just be dumb, but GNOME doesn't make it very easy on me either. For a while I used the 'gnome-session-remove' tool to remove metacity and nautilus and then I would start Fluxbox. This worked well, but gnome-session-remove was removed from GNOME, apparently without a replacement. Then I started digging around in the gconf-editor. When I found the /desktop/gnome/applications/window_manager directory, I thought I had found what I needed. Alas, every single key in that directory has been depcrecated since GNOME 2.12, and they don't appear to do anything anymore. For a while I got by just hacking together an .xinitrc to load everything I wanted, but, for me it was a pain to even get all the correct GNOME pieces--especially when working on my laptop--so that everything worked as expected (my main issues were with gnome-keyring, and the gnome power daemons). Additionally, audio no longer works in openSUSE in runlevel 3, so the .xinitrc solution was out the door. (I probably could have hacked together something in .xsession or some other level 5 voodoo, but I doubt this would have resolved the other issues.)

Fluxbox didn't make it very easy on my either. I finally just started loading a standard GNOME session and then killing Nautilus and Metacity and then starting Fluxbox. This worked quite well, but the Fluxbox toolbar would always steal the "system tray" (I don't know what we really call it) icons from the gnome-panel, and I like my little applet icons. I supposed I could have just made both panels visible, but that would just be redundant and silly. This, however, caused me to stumble onto an actual solution, which was to compile Fluxbox without its toolbar. After that, I just need to find a decent way to tell GNOME to load Fluxbox instead of Metacity.

The exciting part...

Here's how you can get Fluxbox and GNOME to play nicely (with only a minor hack):

  1. Get the Fluxbox source. I used the current Git code.
  2. Configure Fluxbox with --enable-toolbar=no during the configuration step.
  3. Run gconf-editor and replace the value of the /desktop/gnome/session/required_components/filemanager key with an empty string (the default is "nautilus").
  4. And here is the minor hack: Run (as root) 'echo "exec startfluxbox" > /usr/bin/gnome-wm' (after backing up the gnome-wm file, of course). I label this a hack, because the file says not to edit it.
I suggest everyone try this; it's quite nice ;) I have all the GNOME nicities, with all of the Fluxbox simplicity, power, and productivity enablement. Here are some things that I consider nice about Fluxbox:

  • Instead of having a "Start" menu, right clicking anywhere on the desktop produces the (highly configurable) menu.
  • Alt+LeftClick moves a window (same as Metacity), and Alt+RightClick resizes a window. Metacity has the resize feature as an option in gconf, but Fluxbox is much more configurable because of its keys file. For example, I prefer to resize the window in the same way, regardless of where my mouse is positioned on the window.
  • Scrolling with the mouse anywhere on the desktop swaps workspaces
  • Very customizable menu
  • Double clicking on menu bar "collapses" the window like a window shade, only leaving the title bar. Clicking on the title bar a second time expands the window. This is also an option in GNOME from the gnome-control-center.
  • A window can be dragged between workspaces (a feature in Compiz, and maybe somewhere in GNOME).
  • Window title bars take up much less space and can be configured to be even smaller (or configured in a number of different ways).
  • Some people like the Fluxbox slit, but I don't use it.
  • Window tabbing, which allows multiple windows to share the same window and tabbing to occur at the title bar (so that a tabbed window doesn't take up any more space than an non-tabbed window). Behold:


And here is a screenshot of the entire desktop:

From Linux

Hopefully there is an even better solution and someone can enlighten me.

Friday, December 12, 2008

Database Design Final Project

Yesterday, I took my last final exam for my Bachelor's of Science in Computer Science from Utah State University. I have been working at Novell for the last 2 years (that went quickly) and I'm glad they were willing to hire the unlearned me and reimburse my tuition and text book costs for the last bit of my degree. Anyway, that's not what this blog is about...

I finished my "Database Design" final project this Monday. Normally I don't blog about things like this, but I thought this particular case was kind of neat. The project requirements were to provide an application and database that allows the following use case using some provided USGS text-file data (and some other data):
The user searches the database by college/university name or zip code. Then, the database returns the information on the nearest five nearest features for each feature type (e.g., colleges/universities, towns, airports, hospitals, streams, etc.) selected by the user with each feature's name, rank, city, state, zip code, and distance.
I liked the open-endedness of the problem; the only restriction I can think of was that we were restricted to (PostgreSQL, MySQL, or SQL Server).

My idea was to first create a Python command-line interface that prints output to a terminal and optionally writes output in XML, and then create a front-end GUI using PyGTK that executes the CLI program, parses its XML, and displays it in a nice GUI environment.

The point is that I was able to do a major final project for a major university using 100% free open source software. Here is a list of the software that I used and what it was used for. Thanks to everyone who made it possible! Behold the power of open source!
  • mdbtools - to extract some needed data from a Microsoft Access database file
  • PostgreSQL (including psql and pgadmin3) - to store and manage the data
  • PostGIS - support for geographic objects to PostgreSQL
  • openSUSE 11.0 - to operate my system
  • PostgreSQL Autodoc - to generate documentation and diagrams for my database
  • OpenOffice - to write my final report and summary.
  • Python - to code
  • Gtk+ and PyGTK - to code the GUI
  • The Gimp - to create a GUI model and take screenshots for my write-up
  • Fluxbox - to manage my windows
  • GNOME - duh!
  • Glade - to design my GUI
  • Firefox - to display my XML using XSLT and CSS
  • PyGreSQL - to interface with Postgres
  • vim - to write the code
  • Evince - to read the assignment
  • Others I'm sure, including all of the GNU core utils we always take for granted ;)
I never had to turn on a Windows machine. I didn't have to port it to Windows or even test it on Windows like I have had to do several times in the past. We were even asked to submit the write-up in OpenOffice format. I'm sure many of you have done this before and I'm happy for you, but having been a Linux user for 11 years now, I am very pleased to see its evolution (in most respects) and its acceptance. The future is definitely open.

Being a Database Design class, the bulk of the work involved getting the appropriate data into the database (I used PostgreSQL), getting the database normalized, adding constraints, etc. This left me with basically two days to hack together the application. With the limited time I had, I didn't quite get the CLI and the GUI as integrated as I would have liked, and there is some weirdness in the GUI code, but that's okay; I was pretty happy with the results:

Here are a couple of other screenshots:
And here's the code and database diagram if anyone cares. It's only useful for educational purposes, because we weren't required to determine which zip code the features are actually *in*, we only had to determined the nearest zipcode centroid to the latitude/longitude point of a feature. This means zip codes, cities, and possibly states can be wrong. The didn't get the GUI as complete as I had hoped, the idea was to parse the XML results and display the actual results in the right pane of the GUI; however, I ran out of time so I simply dumped the path to the XML output file to the GUI instead. I'm sure there are lots of other bugs and hacks, etc. etc. I don't think I normalized the entire database either.

Thursday, August 21, 2008

Nethack on the iPhone

Within the last few weeks several SSH clients have popped up on the App Store. From the looks of things, none of them are really great yet and none of them are free. Regardless, yesterday I finally broke down and purchased one: TouchTerm for $2.99. Anyway, here is a screenshot of me SSHed into my laptop (from an unjailbroken iphone), playing nethack inside of a screen session. Not perfect, but not too bad:

One thing you will want to do is remove the number_pad option from /etc/nethack/nethackrc.tty or ~/.nethackrc (if it's there). This let's you move around in Nethack when your keyboard doesn't have a number pad.

Also, here's a review of the four SSH clients currently (08/22/2008) available at the app store. While the author recommends TouchTerm, I have only skimmed through it; I chose TouchTerm based on the reviews in the app store.

Wednesday, August 13, 2008

Strongwind Basics

ABSTRACT: New introductory Strongwind tutorial called Strongwind Basics.

A big portion of our work on the Mono UI Automation team involves making Mono WinForms applications accessible through AT-SPI. Gtk+ applications are already accessible through AT-SPI, thanks to a bridge that connects AT-SPI and Atk. Screen readers like Orca, and other accessibility tools can then use AT-SPI to access GUI controls (widgets). This allows the accessibility tool to get information from a widget and even perform actions--like clicking a button. Because widgets are made available this way, working with accessibility lends itself extremely well to automated testing.

Several GUI application automation frameworks use AT-SPI to access widgets. For example, LDTP, Dogtail, and Strongwind all access widgets through AT-SPI. On our team, we're using Strongwind to ensure that we're doing a good job of making MonoWinforms applications accessible.

Strongwind is pretty small, simple, and it has some neat logging features. The Strongwind code is located on the GNOME SVN servers and they are the "strongwind" product on GNOME's Bugzilla. The IRC channel is #strongwind on

One small downside is that Strongwind is relatively new; there aren't many users and not much documentation or tutorials. I decided that writing an introductory tutorial would (hopefully) be a good reference for current and future teammates. Hopefully it will be useful to others, too! It's called Strongwind Basics, and I've been writing way too many wikis lately.

On a related note, I made a couple of diagrams for the wikis and for the UTOSC coming up later this month. One diagram is specifically for Strongwind and the other shows how we implemented a harness to run several Strongwind tests on several machines and log the results. Feedback is appreciated, but this is my first real attempt with Inkscape, so don't bust my chops too much :)

pssst, we still have job openings

Friday, July 11, 2008

Building Accerciser from Source (on openSUSE)

I have been using Accerciser for a few months now to aid in my Mono accessibility work, but until now I had been using it in openSUSE 10.3. With the release of openSUSE 11, I had to rebuild it from source. Of course, that meant figuring out all the dependencies again. Since this will happen every time we get a new openSUSE release to test on, I decided to make of note of things this time to reference in the future.

All I did was created a tiny shell script that uses zypper to install the packages that I needed to have in order for Accerciser to configure and compile correctly. Of course, this is openSUSE specific, but it probably useful for other distros (in that you might be able to determine which packages you possibly need):


zypper in gconf2-devel orbit2-devel indent libidl-devel popt-devel glib2-devel pcre-devel libstdc++-devel glib-devel libstdc++43 glibc-devel glib linux-kernel-headers automake autoconf m4 intltool gettext-tools cvs libgomp43 gnome-common gnome-doc-utils-devel libxml-devel ncurses-devel readline-devel tack gcc gcc43 libmudflap43 make zlib-devel IPython
Then just grab Accerciser ( svn co svn+ssh://[login@] accerciser ) and run configure, make, and make install! Note that these are the packages that are needed after a default install of openSUSE 11 on my test machines; Accerciser has other requirements, many of which were installed on the OS by default.

By the way, Accerciser 1.34 was released semi-recently (June 16). Accerciser is an interactive Python accessibility explorer for the GNOME desktop. It uses AT-SPI to inspect and control widgets, allowing you to check if an application is providing correct information to assistive technologies and automated test frameworks. I recommend it for anyone involved with accessibility, but also anyone who develops or tests applications! For a good introduction on accessibility and to see how Accerciser can be used, check out Steven Lee's article entitled "Python Powered Accessibility." The article was published recently in Python Magazine;

Friday, June 27, 2008

VMWare (Workstation 6) on openSUSE 11

EDIT July 13th 2008: Thanks to Tony Barnard who pointed me to Cameron Seader's blog entry that has a fix for the vmware-vmblock module problem described in this blog entry.


ABSTRACT: ignore the inaccurate gcc version warning and run '' in the vmware-any-any-update117.tar.gz

I ran into a few kinks while installing VMWare on my new openSUSE 11 install. They are fairly minor, but here's some info that should get you up and running.

First of all, the script told me that it couldn't find a suitable vmmon module for my kernel. No problem, that's normal, the script will just compile one for me like always correct? Well, correct for the most part; after affirming that I wanted the script to try and build the vmmodule, I got the following message:

Your kernel was built with "gcc" version "4.3.1", while you are trying to use
"/usr/bin/gcc" version "4.3". This configuration is not recommended and VMware
Workstation may crash if you'll continue. Please try to use exactly same
compiler as one used for building your kernel. Do you want to go with compiler
"/usr/bin/gcc" version "4.3" anyway? [no]
I found this message a little odd and unsettling since I had just installed the system and hadn't messed with updates yet. I decided to investigate whether the script was even telling me the truth or not.
bean@cobweb:~> gcc --version
gcc (SUSE Linux) 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036]
The version looked right to me and I wondered where was getting its information. After browsing the gcc manual, I found the -dumpversion option and tried it out...

bean@cobweb:~> gcc -dumpversion
This appeared to be the problem. Sure enough, line 3266 of runs gcc with the -dumpversion option. So this really wasn't anything to be worried about, while it is apparently a gcc bug, it's safe to just respond "yes" to the prompt.

I didn't get very far after that, however. The vmmon module fails to build almost immediately. Coincidentally, a weak or so earlier I had been installing VMware on a Slackware machine and had learned about the vmware-any-any-update patches. These are unsupported and apparently third-party updates for vmware. The newest update I found was vmware-any-any-update117.tar.gz. I download it and ran the '' script, which updates the source of the modules.

So after ignoring the inaccurate gcc version warning and running the vmware-any-any-update117.tar.gz, I now have a running (and unsupported :)) VMware setup.

As a side note I didn't find that some of the vmware-any-any-update files claimed to be 117, but were really no different than the 115 versions. I'm not sure what's up with that, but it threw me off for a while. I uploaded the good one I found. Also, the vmblock module still fails to build, it would be nice to find a fix for this.

Thursday, April 10, 2008

Cute 'lil laptop

I just noticed the new HP 2133 Mini-Note PC is available on on HP's site. It looks pretty neat. Basically it's a mini-laptop with a 8.9-inch diagonal WXGA (1280 x 800 resolution) screen and a "92% full-size" keyboard. Additionally, it has an external VGA port that supports resolutions up to 2048 x 1536 at 75 Hz. The thing weighs 2.8 lbs. It has a VIA C7-M processor (1.0, 1.2, or 1.6 Ghz options). The coolest part is that is ships with Windows Vista (boo!) or SUSE Linux Enterprise Desktop (SLED) 10 installed (yay!). Ordering it with SLED10 will save you $50. Here's a picture:

Oh, and they won't ship the 1.0 Ghz version with Vista. I wonder why? [ 1 | 2 ]

Pretty cool device at a reasonable price; just for fun, I configured a 1.2 Ghz model with SLED10 and 2GB of RAM for $618. Pricing starts at $499. Here are the detailed specs.

I don't know if it's as cool as Sony's VAIO UX, but it sure is a lot cheaper and probably quite a bit more practical for most people.