Archive for the ‘Geek’ Category

(on Technorati ,

1024×768 Desktop

Lots of people customize their desktops. Many don’t, but I do.. a little. Here’s mine:


I actually had to remove the Time Tracker (Hamster) applet to scale my 1280×1024 desktop down to 1024, but I think that was all. And I only just decided to try moving the Tomboy and Deskbar applets over to the top-left corner… looks a little odd, but it’s much more accessible. It’s good to try out new things, right? 🙂 (When the keyboard will do, Alt+F12 and Alt+F3 for Tomboy and Deskbar, and Super(windows-key)+Space for Gnome-Do are good shortcuts to keep in mind.)

How about you? (If you run Ubuntu, read this – which is why I tried scaling my 1280 desktop to a 1024, in the first place).

WordPress 2.7

I just upgraded from 2.6.3 (using my “wp-upgrade” script), and It’s fantastic! Go watch a video about the biggest features. It even includes an “automatic upgrade!!” This pretty much deprecates my script, unless you want to maintain snapshots of each version. (I’m not sure if anyone other than me was using it to begin with… but anyhow….) 🙂

Screenshot: wp-upgrade Snapshots

Ubuntu 8.10 (Intrepid Ibex) and Tablets

I just had to mention this: The latest version of Ubuntu finally supports input hotplugging. What this means is that you can plug in your tablet at any point and start taking advantage of its pressure sensitivity, etc. Previously, it would only work correctly if Ubuntu (the X server part of it) started with the tablet plugged in. Let me just say: OMG, I’ve been waiting for this for years! Seriously. I hadn’t been keeping up with every detail on the release (and I’m surprised I hadn’t seen mention of this yet), but I always plug in my USB tablet and run a quick test with new releases. This time, it actually worked! My test turned into a quick (and random) doodle:

How to Test

Plug in your tablet.

Run GIMP (included with Ubuntu by default).
Applications > Graphics > GIMP Image Editor

Enable Extended Input devices in GIMP.
Edit > Preferences > Input Devices > Configure Extended Input Devices

Find your tablet under the Device dropdown (mine is a Wacom Graphire) and select Screen or Window for the Mode. (It defaults to disabled.)

Create a new image, select the paintbrush tool and start drawing. To play with the features of your tablet, expand the Brush Dynamics section in the paintbrush options window (should be below the toolbox, where you selected the paintbrush). Here you can adjust things that pressure of your pen will control, like size and opacity. Fun stuff!

It’s not perfect (only works with the stylus – eraser doesn’t work without configuring), but it’s a HUGE step!! 😀 And the fact that this also includes the latest version of GIMP (2.6) makes this upgrade an absolute no-brainer for linux graphic-philes. 🙂

I found the new UI in GIMP a little strange at first, because I became so accustomed to the old one, but it is much better.

Upgrade Problems

Related to the upgrade, I lost wireless connectivity with my laptop upon doing it because the hostap_cs driver is used. I forgot about this issue that I had with previous releases and my super-cheap 1000yen wireless card. Blacklisting the hostap_cs driver and forcing the orinoco_cs driver fixed my problem again. The lesson: the upgrade wasn’t perfect and it should never be assumed that they will be – please backup your stuff! But do do the upgrade! 😉

open-with for the command-line

Update 2008/11/18: Use xargs 😛

Here’s a bash script that you can pipe output into and tell it to run a specific program with the output as arguments. I’ve named it open-with and placed it in my personal script directory: /home/steve/bin/. Look within the script at a couple of the examples for how to use it.

PROG=`basename $0`
DESC="Read arguments from standard input and run a specified program
with them.  Meant to be used as output for a pipe."
# List (with details), all the files that include \"downloads\" in their name:
  find /home/ -iname \"*downloads*\" | $PROG \"ls -l\"
# Queue all AVI files in current directory in vlc:
  ls *.avi | $PROG vlc
# View all time-related icons with eye-of-gnome:
  find /usr/share/icons/gnome/ -iregex \".*[^mul]time.*\" | open-with eog
function Usage() {
  echo "DESCRIPTION: $DESC" ; echo
  echo "USAGE: $USAGE" ; echo
# Quick check to see it's being called correctly, if not, print Usage and exit
if [ ${#@} -ne 1 ]
files=()						# empty array
while read -r					# read from stdin
	files+=( "$REPLY" )			# add result of read to array
# assume $1 is a valid program
$1 "${files[@]}"				# pass arguments to specified program


You’re sitting at the command line and have a list of images (in different locations) that you would like to browse. Most image viewers let you iterate over a set of images, but only within the same directory. What would be great is if they accepted input from stdin through a pipe!

$ cat my_list_of_images | my_image_viewer

I didn’t find anything that did that, but using the open-with script, you can do something similar:

$ cat my_list_of_images | open-with my_image_viewer

Browsing a select list of images is actually kind of nice. It’s like a playlist for your image viewer – a viewlist. 🙂 Anyway, I’m sure there’s some problems with this script. Feel free to provide suggestions in the comments. But I certainly don’t want to look at it for a while….

I hate shell scripting

With a passion. It’s not a great surprise… many programmers do. I’m willing to go on record and state that I hate it even more than PERL programming. I rarely do it, and when I decide to try something that seems like it would be simple, it turns out taking forever due mostly to quirks. The rest of this post is a bit about how I went about writing this script, which ended up being mostly given to me by some #bash gurus on IRC. And it’s a bit of a rant.

Although not many GUI programs seem to accept stdin as input, most accept filenames as arguments:

$ eog image1.jpg image2.jpg image3.jpg "/home/steve/image seven.jpg"

So I figured I would just have to convert the list of images into an acceptable format: quoted, absolute filenames, separated by space. Doing this depends entirely on the format the list is currently in, but it’s likely a list of unquoted filenames separated by newlines:

/home/steve/my images/wow.jpg

For me, my test list looked like this:


I was looking for icons of clocks or representations of time, and I obtained that list using find:

$ find /usr/share/icons/gnome/ -iregex ".*[^mul]time.*"

So I can’t pipe it into my image viewer, but I can use the output as the command-line arguments if I change the newlines to spaces. find has an option for formatting the output which is perfect:

$ find /usr/share/icons/gnome/ -iregex ".*[^mul]time.*" -printf "'%p' "
'/usr/share/icons/gnome/48x48/stock/generic/stock_timezone.png' '/usr/share/icons/gnome/16x16/stock/generic/stock_timezone.png' '/usr/share/icons/gnome/16x16/stock/generic/stock_timer.png' '/usr/share/icons/gnome/16x16/stock/generic/stock_timer_stopped.png' '/usr/share/icons/gnome/16x16/stock/form/stock_form-time-field.png' '/usr/share/icons/gnome/24x24/stock/generic/stock_timezone.png' '/usr/share/icons/gnome/24x24/stock/generic/stock_timer.png' '/usr/share/icons/gnome/24x24/stock/generic/stock_timer_stopped.png' '/usr/share/icons/gnome/24x24/stock/form/stock_form-time-field.png'

That’s great for me, because I’m using find. But not very useful if I’m not, so I wanted something more generic. Of course, there are many ways to do this, and again, I’m by no means a command-line guru. But here’s how I started:

$ find /usr/share/icons/gnome/ -iregex ".*[^mul]time.*" | sed -e 's/^/"/' | sed -e :a -e '$!N;s/\n/" /; ta' | tr '\n' '"'

This wrapped the lines in double-quotes and join them together with a space in between. The find command is the same as before, minus the formatting because that’s what I was trying to find an alternative to. The output of find is piped into sed, which adds a " at the beginning of each line. This output is then sent to another sed which replaces the newline character at the end of each line with a closing double-quote and a space, joining all lines into a single line. Finally, that output is piped into tr which replaces the one remaining newline with a final double-quote.

If the files don’t include spaces or other troublesome characters (mine didn’t), then you could get away with simply changing the newlines into spaces. But again, I wanted something generic.

$ find /usr/share/icons/gnome/ -iregex ".*[^mul]time.*" | tr '\n' ' '

Anyway, now that we have something that creates the desired input, we just have to wrap it in back-ticks and put the whole mess as the argument to the image viewer! In my case, I’m using eye-of-gnome (or eog).

$ eog `find /usr/share/icons/gnome/ -iregex ".*[^mul]time.*" | sed -e 's/^/"/' | sed -e :a -e '$!N;s/\n/" /; ta' | tr '\n' '"'`

Wait a second. That doesn’t actually work. Why not? Running the backtick contents by itself seemed to produce the correct output. Copying this output verbatim as arguments to eog worked as expected. The problem was that when the quoted arguments were manually entered on the command-line, bash (silently) escapes the filenames, removing the quotes, adding backslashes before space,s etc. But when the pipeline is wrapped in backticks, the result is not escaped, and eog complains about not being able to find files that begin with quotes. Fine. I was not about to write a bash “escape” script – something like that should already exist, right? And it should be built in to bash! Perhaps it’s even called “escape“. Well, if there exists such a built-in, I couldn’t find it. But I had to be going about this the wrong way. Heading over to IRC, it was kind of difficult to explain the problem, but ferret eventually gave me the meat of the script above:

files=(); while read -r; do files+=( "$REPLY" ); done < <(find /usr/share/icons/gnome/ -iregex ".*[^mul]time.*"); eog "${files[@]}"

It worked! I thanked him and began studying it. There were still a couple things I didn’t understand:

  • Why two angle brackets with a space between them? I understand the first one is probably redirecting input, but I don’t understand that one next to the opening parenthesis.
    Answer: The <(command) actually puts command‘s output in a temporary file and produces that filename. So <(command) becomes tempfile. (Thanks, kojiro.)
  • If I open some video or audio files in totem using open-with, there’s an odd delay. Using vlc doesn’t produce a delay, however.

And to think this was originally going to be a micro-blog post in Twitter and Wow. It’s safe to say I still hate shell scripting. 🙂

What I did today – Time Tracking with hamster-applet

In GNOMEe 2.24, hamster-applet will be included by default. When I use it, I love it. I should use it more often.

I should note that “laundry” is actually inclusive to other room-cleaning activities. 🙂

Rhythmbox Plugin: Jump to Playing 0.3(.1)

Update 2012-01-29 – Deprecated:
Brief: This plugin has been deprecated. For future versions and updates, please go here.

Less Brief:If you’re using a newer version of Rhythmbox, you’ll need a newer version of this plugin. I’m not sure exactly which RB version the plugin format changed, but I am currently using Rhythmbox 2.90.1 on Ubuntu 11.10 and this plugin no longer works. However, Timo Loewe has ported jump-to-playing to Rhythmbox 3, all properly hosted and everything! Get it and any future updates here ( This is the version I’m now using. Thanks, Timo! 😀

– – – – –

The following pertains to the deprecated version of the plugin…

– – – – –

This plugin will display the View : Jump to Playing Song link as a button in the toolbar and/or as link in the Browser’s context menu. Other Rhythmbox plugins can be found here.


Using a future version of Rhythmbox – patch here – the menu item will appear in a plugin placeholder, above Properties. Otherwise, it will appear at the bottom, like previous versions.

From version 0.3, the Open Folder plugin will also be placed in the plugin placeholder.

Changes Since 0.2

Just a couple small changes since 0.2.

  • Selecting the context menu option in the preferences will now display the link in PodcastView and PlaylistView popups, as well as BrowserView and QueuePlaylistView.
  • Assuming the patch on bug 557152 is applied, this will place the context menu items in a plugin placeholder and allow the Preferences to remain the last menu item.
  • Update (Nov 10 2008): Modified version of patch has been applied to RB development trunk, so the next version of Rhythmbox will have this update. Yay! Version 0.3.1 of jump-to-playing is to account for the modifications. Please use it. 🙂


jump-to-playing-0.3.tar.gz jump-to-playing-0.3.1.tar.gz
Browse the Source: Here
Grab the Source: bzr branch ""


  1. Extract the jump-to-playing folder into your ~/.gnome2/rhythmbox/plugins/ directory (or ~/.local/share/rhythmbox/plugins/ directory, if the .gnome2 directory doesn’t exist). Completely replace any previous versions.
  2. (Re)Start Rhythmbox and enable the plugin in Edit : Plugins.


From my previous post.

  • the gconf keys in gconf-editor say they have no schema. The main plugins’ keys have a schema and don’t give a warning. Definitely not serious, though.
  • it currently adds/removes the ui string when the options are toggled in the configure dialog. I have a feeling it might be better to only add/remove them in the activation/deactivation, and just hide/show here. Maybe faster?
  • it currently hides the browser button in small display mode. That has nothing to do with the jump-to-playing button. That should be in core, if it was decided that was the desired behaviour.
  • to hide the buttons in the small display, it checks the value at activation, and it connects to the View menu’s toggleButton’s “toggled” signal. So whenever it’s toggled, the gconf value for the small display mode is checked, but I think there’s a delay sometimes. Pushing Ctrl D quickly a few times may result in incorrect UI presented. I remember deciding that this is due to a delay set on the gconf callback to overcome some other bug….

All patches are welcome! 🙂

Update 2008/10/26: Added screenshot, descriptions to screenshots, and link to main plugin page.

Update 2008/11/10: Added link to version 0.3.1 and added description.

Update 2010/12/08: Added alternative installation directory.

Jump-to-Playing Rhythmbox Plugin TODO

I haven’t looked at the plugin for a while, but I’ve been meaning to reproduce my “todo” list for it that I wrote on the rb-dev list a while back.

  • the gconf keys in gconf-editor say they have no schema. The main plugins’ keys have a schema and don’t give a warning. Definitely not serious, though.
  • it currently adds/removes the ui string when the options are toggled in the configure dialog. I have a feeling it might be better to only add/remove them in the activation/deactivation, and just hide/show here. Maybe faster?
  • it currently hides the browser button in small display mode. That has nothing to do with the jump-to-playing button. That should be in core, if it was decided that was the desired behaviour.
  • to hide the buttons in the small display, it checks the value at activation, and it connects to the View menu’s toggleButton’s “toggled” signal. So whenever it’s toggled, the gconf value for the small display mode is checked, but I think there’s a delay sometimes. Pushing Ctrl D quickly a few times may result in incorrect UI presented. I remember deciding that this is due to a delay set on the gconf callback to overcome some other bug….
  • in the context menus, ‘Properties’ should really be the last item. They need a placeholder put in the UI core. UPDATE: I’ve filed a bug with a patch attached here. Jump-to-Playing and other plugins will need to be updated when the patch is applied. I’ve just done it on my local copy w/Rhythmbox HEAD…. Looks like this:
    Before (red) and After (green) applying the patch and using an updated plugin

    Before (red) and After (green) applying the patch and using an updated plugin

  • Show the context menu item in PodcastView and PlaylistView popups, as well. I’ve added this in my local copy, already. Maybe I should just bump the version and release….

GNOME 3.0 Ideas (Intelligent Desktop)

This is based off of a Summer of Code application I made in 2007, titled “Intelligent Desktop.” Recent discussions have reminded me to at least blog about it. And given my current employment status, I have the time. 🙂

Note: You may also be interested in File List Applet filelistapplet.

Messy Desk

The desktop – this gigantic area of screen real-estate – is a mess. Some people use their desktop to dump random files that they’re working on, or have recently downloaded. Others work tirelessly to keep the pretty background picture visible with minimal icon clutter. Still others find the Desktop useless because it fills up with icons too easily. In the Nautilus Desktop (GNOME’s default), icons can get placed on top of one another either by a bug in placement or simply because there is no space left, which really deters from the usability. Personally, I clump different themed files/folders into the corners of my desktop. When a file is added to the desktop procedurally, there is no obvious place to put it and thus no obvious place to look for it. This is compounded if there is a “hole” in one of my “icon clumps,” in which case the hole may be filled with the new icon making it extremely difficult to locate by both file name and screen location. I recently gave up on having mounted drives displayed on the desktop. Anything dynamic fails miserably as their location changes each time, and sometimes they even end up overlapping other icons. In any case, it seems the desktop requires maintenance to work, when it really shouldn’t.

An Intelligent Desktop would overcome icon clutter automatically and intelligently. It would also be a starting point to looking at potential benefits of a more dynamic desktop view. I’ll explain what I mean by this in a second. This is NOT that silly little notification that your desktop has old/unused icons on it.

Automatically Sorted, Categorized, Updated and Easily Searched

The desktop is a useful place to dump files, but retrieving them is a pain. In fact, browsing the desktop for that particular file (or folder) is a pain without a lot of maintenance. My idea requires an always-visible, on-the-desktop set of UI elements that I will call the Desktop Action Window (DAW). The easiest way to think of the DAW is as a sidebar for the desktop. (Don’t stand up quite yet, sidebar haters.) But rather than the DAW being a collection of meta-information or unrelated widgets, think of it as a controller to the desktop view (formerly just a desktop). Performing actions on the desktop via the DAW simply creates a new view of the desktop. The original/default view that is customized by the user will always be available. If you think in terms of Model-View-Controller, the current desktop is essentially everything. With the DAW, the DAW becomes the controller, the desktop viewing area becomes the view, and the model is partially hidden. The DAW should allow easy management of multiple views of the desktop, some automatic (Images, Movies, Recently Modified), some static (Default, Custom).

And you shouldn’t be concerned about a sizable widget infringing on your carefully chosen background, there are ways around that: the DAW could be hidden when no mouse movement on the desktop occurs (like the controls of a photo slide show), it could be semi transparent until the mouse is over it, it’s location could be customized, etc.

Some quick ideas for different actions in the DAW include:

  • An automatically generated list of types of files on the Desktop. Selecting one of them displays all icons of that type.
  • A text entry for string pattern matching.
  • Ability to easily hide all icons, except ‘always visible icons.’
  • Ability to have custom views displaying only icons that user specifies.
  • Ability to easily open file manager and display all files
  • Some form of icon pager or scrollable desktop view to allow for arbitrary numbers of icons to be displayed per view.
  • Ability to view and manipulate an arbitrary folder, such as Home, in the same way.


This is where I stop the prose and leave you with a couple mockups. The “Overflow” view could probably be replaced with “New” or “Recent” for recently modified files. Anytime new files/folders/launchers have been added, the button could be flashing to grab the user’s attention. Better not to alter the default view at all, I think.

Update 2008/12/04: I’ve started implementing what I was thinking about with the automatic view filter as a GNOME panel applet. Check out File List Applet.


“Netbooks” are a fairly recent thing; smaller and more affordable than a regular notebook PC… What’s not to like about that?! 🙂 Asus first tapped into this market with their Eee PC and it has since gone through its second (I think) generation. Eee PC’s generally get great reviews with the one complaint being their keyboards are a little small for adult hands. Acer recently introduced their AspireOne. I picked up one of these for my mom, who was considering a cheap notebook. For what she does (email, browse the Internet, write documents, and print things), this is perfect. For myself, I installed a few extra applications on it (emacs, ssh-clients), keep some information on a USB key and I borrow it sometimes because it’s just so portable. I chose this over the Eee PC because it seemed to be a better value and has a bit larger of a keyboard (though the bilingual keyboard is kind of annoying).

The trend with netbooks seems to be that the lower end, cheaper models run some form of Linux and if you want Windows XP, then you’ll have to purchase a higher end model. What I don’t like is that sometimes it appears you can’t get the higher end models with Linux. I doubt you could get a Windows rebate for these PCs….

Just today, Dell has released their Inspiron Mini 9 and it seems to compete quite directly in terms of value with the AspireOne. It’s interesting if you compare Dell’s US offering with their Canadian offering of essentially the same thing (I hope those links work). First of all, Canadians don’t yet have the option of selecting Ubuntu Linux as the operating system, nor a model with 512MB or RAM, so I’m comparing the $400 models. (Right off the bat, Americans have the option of going with Ubuntu and 512MB for $350.) Canadians get 1GB RAM in this model whereas that will cost Americans another $25. But if we Canadians want a 0.3MP or 1.3MP web camera, we will have to pay $20 or $40 extra. The American model comes with a 0.3MP and can be upgraded to a 1.3MP for a mere $10. Also, upgrading from 8GB to 16GB will cost Canadians an extra $10 ($50 compared to $40 for US). But the funniest difference: Americans will have to pay $25 more if they want white, but we here in the Great White North don’t incur that penalty. Huh. I wonder what logic compelled these differences.

I might consider the Inspiron Mini 9 over the AspireOne for myself if I had the option of Ubuntu. Wonder when it will be available to us northern folk.

WordPress Upgrade Script

Even though the WordPress upgrade is easy, it’s troublesome. So I wrote a script to do it for me. Yep. There’s lots of these out there. And a lot of hosts (including mine) have a one-click install/update thing. But for some reason, I decided to write my own script. In python. Got to use a bunch of modules I’ve never used before, so it was a good experience.

How to Use

Run this script from the directory that contains your wordpress directory, on your server. I think it requires Python version 2.3. I ran it with 2.3.5. Use python -V to check the version. There’s two methods to run it.

With Prompts

1: Be prompted to push the Enter key to continue at each major step. Nice for the first time.


Example output:

python ../src/wp-upgrade/ 
Current WordPress Version: '2.5'
Newest WordPress Version:  2.6.1
Downloading wordpress-2.6.1.tar.gz ...
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
Create working wordpress directory... 
			[[Press Enter to Continue]]
Update Wordpress root contents...  
			[[Press Enter to Continue]]
'/tmp/tmprpJTKu/wordpress' -> 'wordpress.working'
wp-trackback.php,  wp-config-sample.php,  wp-settings.php,  wp-rss2.php,  readme.html,  index.php,  wp-links-opml.php,  wp-pass.php,  wp-feed.php,  wp-register.php,  wp-rdf.php,  wp-rss.php,  wp-commentsrss2.php,  license.txt,  wp-comments-post.php,  wp-blog-header.php,  wp-load.php,  wp-mail.php,  wp-atom.php,  wp-cron.php,  wp-app.php,  xmlrpc.php,  wp-login.php,  
Replace wp-admin and wp-includes... 
			[[Press Enter to Continue]]
Update default themes and plugins...  
			[[Press Enter to Continue]]
'/tmp/tmprpJTKu/wordpress/wp-content' -> 'wordpress.working/wp-content'
'/tmp/tmprpJTKu/wordpress/wp-content/plugins' -> 'wordpress.working/wp-content/plugins'
akismet,  hello.php,  
'/tmp/tmprpJTKu/wordpress/wp-content/themes' -> 'wordpress.working/wp-content/themes'
default,  classic,  
Backup original, Rename working....
			[[Press Enter to Continue]]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
### VISIT '' in your browser. ###
After that, you're All Done!
Go re-enable all your plugins and make sure everything works.
If you need to, you can always roll back by renaming the backup to 'wordpress'.
			[[Press Enter to Continue]]

Without Prompts

2. Do everything without a prompt. Do this by passing the -q option. The -q is for quiet and prints the same messages, but doesn’t wait for the user to press Enter. Blasts through the whole upgrade in one step.

python -q

Example output would be the same as the above, minus the “[[Push Enter to Continue]]” bits.

What’s it do?

If you look at the above output, which is from my own site, you can see what it does. It will compare your installed wordpress version and to the latest available from If your version is older, it will download the new one, extract it, perform the appropriate steps to update the old one. Note that the default themes and plugins will be overwritten, which is fine as long as you didn’t customize them. After it’s done, your wordpress directory should be up-to-date (you just have to visit the upgrade page), and you should have a wordpress 2.5 backup containing the directory as it was before running the script (and 2.5 would be the appropriate version). Also, there’s two variables you will (probably) want to customize: wpsite and wpdir. That’s it, basically.


Browse the source and download the script here.