Posts categorized “Linux”.

Ubuntu One beta

Cool, the first bit of Ubuntu One is released, which is the project I’ve been working on since I started at Canonical. We’re currently in a beta test for the file sharing part of U1; I haven’t been working on that much, but the team who have are some cool guys. You can sign up for an invite at ubuntuone.com.

I’m looking forward to more stuff happening. I was interviewed along with Matt Griffin by the Ubuntu UK podcast guys last night about the project and what we’ve done so far (and they’ve got invites to give away, too). I’m also speaking about Ubuntu One at OSCON, and the abstract for my talk seems to be being passed around as information about what might be coming up in the future :-) Cool times ahead, especially since today I came a step closer to achieving enlightenment with lazr.restful, one of the libraries I’m using.

Auto-discoverable local websites

Epiphany, the Gnome web browser, has a nice feature where it will automatically discover websites on your local network and add them to your bookmarks list. It occurred to me that this would be useful for a workshop I’m running later this week; have some materials in a website, and then everyone at the workshop will just have it appear in their bookmarks. Well, they will if they’re using Epiphany, or Konqueror, and (since most of them will likely be Mac people) they will in Safari as well (I think).

So, I thought: I want a piece of that action. I want to create such a website and have Safari etc pick it up. But how do you do that? Ross Burton to the rescue; Ross explains how to advertise a website over Zeroconf (Bonjour for Mac people, but it’s all the same technology). So, just drop a file in that /etc/avahi/services folder and it all works.

And then I thought: how do I test it works? (I don’t use Epiphany, I use Firefox.) BonjourFoxy to the rescue too; it browses the local network for websites that are so advertised and displays them in a sidebar; works for all platforms.

So, this oughta work. (People with both Macs and Ubuntu; I’d appreciate it if you could use Ross’s docs to advertise a local webpage with a specific path on the Ubuntu box and then see if Safari on the Mac picks it up.)

Publishing screenshots and files quickly

I’ve just looked at Skitch after someone used it to share a screenshot with me, and thoughts floated across my head about how I might use that too. Then I thought, now, hang on a second, I already have a website to publish images on, but I have to save them, then scp them up, and so on, and that’s fiddly and annoying. Then I thought, this could be easier.

So, Places > Connect to Server, and fill in SSH details for kryogenix.org, with the folder being my “random” folder on the website, and tick “add bookmark” with the bookmark name being “kryogenix random folder”. Now, to take a screenshot and publish it, I just hit Print Screen (which takes a screenshot and offers to save it), say “Save”, and pick “kryogenix random folder” from the drop-down list of where to save it to. Publishing screenshots with three clicks. That’ll do nicely.

(Skitch does other stuff, as I understand it, like cropping images and adding annotations. It would be cool if the Gnome screenshot tool allowed these things too, but I can live without them.)

Music and movies on the TV

I have a reasonably large collection of music and movies. In my lounge, there’s a big computer with a 1TB drive in it, which is where all the movies and music live. It’s running MythTV, and plugged into the television. Upstairs, there’s a second MythTV box, a front-end only, which I use for watching TV in bed. My laptop runs Banshee, and can see the music and films through gvfs and SSH to the main MythTV box.

This all works fine. But it’s annoying. I don’t really like MythTV’s interface much. Creating playlists in Banshee is great and easy, but those playlists don’t appear in MythTV. I have to import new music twice, once into Banshee and once into Myth. I want to be able to do it all from one place, and have it all work.

So: what should I do? I’m happy to change almost everything about the setup, with the one hard-and-fast requirement that every component needs to run on Ubuntu, and I’d much rather run stuff that’s packaged for Ubuntu. I’d prefer to use Gnome apps and GStreamer apps where possible, but if I have to step away from that I’ll think about it.

I’ve had various thoughts about this; I don’t know whether any of these are realistic, and I’d happily hear your thoughts on any of these or on anything else that I haven’t mentioned:

  1. Make MythTV a UPnP server, keep Myth on the main machine and the upstairs frontend, and use a UPnP client on my laptop. Flaws with this: I don’t know whether UPnP does playlists, I don’t know whether you can edit a playlist over UPnP, Banshee doesn’t have UPnP support afaik, Rhythmbox does but doesn’t play videos.
  2. Investigate the mythtv:// source in GStreamer and build a Banshee plugin for it. Downside: I’m not very good with Mono stuff, so writing a Banshee plugin is hard. Rhythmbox would be easier (I’m fine with Python), but again, Rhythmbox doesn’t do videos
  3. Use Elisa on the server instead of MythTV. Flaws: not sure how this helps the edit-playlists-on-my-laptop problem; see above issues about UPnP; Elisa doesn’t actually work very well, or it didn’t last time I tried it (it was very slow, and the UI is slickish but doesn’t actually seem much easier than Myth); Elisa doesn’t record stuff off DVB (although I could keep mythbackend running, but how would I configure it?)
  4. something else I haven’t thought of

Lazyweb, tell me what to do…

YUI3 and Launchpad

For the last week I’ve been in Berlin with the Launchpad JavaScript team building a set of cool widgets using YUI3 that will gradually start to appear in Launchpad and make its UI nicer. The LP guys have started to write up the things that they’re doing over on the Launchpad blog. I’ve learned quite a lot about YUI3 in this week; I need to do a writeup (or more probably a set of individual writeups and tips about stuff I’ve learned).

Now is not the best time, though, since YUI is being incredibly frustrating with its widgets; they don’t clean up after themselves, so if your widget creates HTML then it’s your responsibility to remove that HTML from the document later. And my widget seems to be creating its HTML twice, which is less than excellent. Frustration abounds.

That aside, though, this has been a good week; got a lot done, and I want to see Canonical be part of the web community like we’re already part of the Gnome/Linux community. Building cool stuff and talking about it and releasing it is going to help, there.

Cutting off your nose

“Doctor, Doctor, my toe hurts.”
(Doctor amputates patient’s leg, and his right hand and his nose into the bargain.)

The solution to “my audio isn’t working right” is not “uninstall PulseAudio”. Nor is it to complain that your distro didn’t give you an “uninstall PulseAudio” button. Stop suggesting it. I ran into one small audio problem and half the responses to other people mentioning it were “you need to completely remove PulseAudio”. Stop recommending that to people.

This has been a party political broadcast on behalf of the “there’s a time in the evolution of everything that works when it didn’t work” party.

More thoughts on Linglish

I still don’t have a decent name for “Linglish”, the toy scripting language for the Linux desktop that I was playing around with a couple of days ago. I’ve added a couple more features to satisfy my curiosity about how hard it would be to do, and I’ve read the comments on the previous post with a great deal of interest. Thanks to everyone who chimed in with thoughts.

First, what Linglish can now do:

tell screensaver to lock

A simple command: just tell one application to do one thing.

ask banshee’s engine for uri

Request the value of something from an application. If you do this from the command-line, the value is printed out:

$ python linglish/runner.py -c "ask banshee's engine for uri"
file:///home/aquarius/Music/New%20Order%20-%20World%20in%20Motion).MP3

tell banshee’s engine to pause
tell screensaver to lock

Run more than one command in a script

tell tomboy to FindStartHereNote
tell tomboy to displaynote with the result

Call a command which returns something and then do something based on that: Tomboy has no “show the Start Here note” function, but this does it fine by getting a reference to the Start Here note and then displaying it. The latter command could also have been written as tell tomboy to displaynote it or tell tomboy to displaynote FindStartHereNote

wait for banshee’s eventchanged
ask banshee for currenturi
tell tomboy to createnote with it

Wait for an application (Banshee) to send a signal (a song has stopped playing or started), then when it happens ask for the value of a property (the path to the currently-playing song), and finally call a different app (Tomboy) to create a note with that path as its name. This example will then exit: if you want to create a new note every time the song changes, then wait repeatedly for the signal rather than just waiting for it.

Next, some musings:

One thing that this has revealed to me is that there are quite a few apps which I’d like to interact over D-Bus with which don’t provide an API to do so. The glaringly obvious example here is Nautilus (and indeed there is a bug requesting a D-Bus API), and a part (a small part) of why I’ve built this is that if there’s an easy way to encourage people to write little programs controlling their desktop then that will encourage application developers to build APIs to their apps. Zenity doesn’t have one either, which makes interaction from these little Linglish scripts a bit difficult; I suppose I could build “display dialog” commands into the language but that seems a bit off. On the other hand, one of the advantages here is that there’s nothing stopping someone building a thing which is just a D-Bus API and which then calls out to Zenity to do the work.

A second is that our D-Bus APIs are not necessarily brilliant. Picking a silly example, if you want to find Tomboy’s version using Linglish you have to tell tomboy to version, which sounds rather stupid; it should be “ask tomboy for version”, but Version() is a method rather than a property in Tomboy’s D-Bus API. (I’m not picking on Tomboy here; they have a pretty comprehensive API, and I’ve been testing and developing Linglish using primarily Tomboy and Banshee.) Linglish is sort of designed with the conceit that methods are verbs, hence the “tell someapp to dosomething” syntax, which sounds deeply weird if your methods are not actually a verb.

It’s also jolly hard to work out what D-Bus APIs are actually available. Well, that’s not true: if you’re me, or a hacker like me, then you can use J5’s fantastic D-Feet D-Bus browser. I think this problem is best solved with tools used to create the language rather than the language itself, although there’s more on this in the future-development section below.

There were plenty of comments on the last post saying that this was a stupid idea and that it made much more sense to have a syntax like screensaver/lock or screensaver.lock() rather than tell screensaver to lock. I, personally, do not agree with that. I’m not necessarily suggesting that I’m right and they’re wrong, or that neophytes will indeed find my way easier: just that this is an alternative way. If you think that Python or Smalltalk or any one of a dozen others are a better approach, go for it: I’m certainly not stopping you.

Thirdly, questions about what it might do in the future and whether those things are a good idea:

The original conception I had for this in my head is now basically done. You can send commands to programs, you can tie programs together, you can get info out of a program and print it out. It would be able to do half the little scripty tasks I want to do on my desktop (assuming that the APIs existed to do them, which they mostly do not). Here are future things it could do, in rough order from small to big:

  1. Be cleverer about calling methods on applications with more than one object. At the moment you have to tell banshee's engine to pause, because Banshee exports more than one object. Since only one of those objects actually has a Pause() method, tell banshee to pause makes more sense.
  2. Have Linglish be able to document an application. ask linglish about tomboy which then prints out Tomboy commands you could use by introspecting Tomboy’s D-Bus API would be pretty nice. One big problem with this is that for most apps they need to be running to find out what API they offer, so ask linglish about banshee would start it up.
  3. There are currently no control statements. This is a problem if you want to do anything even semi-complicated in a script, especially since the common approach to D-Bus signals in Linux apps seems to be to generate a SomethingHasChanged and then pass a whatchanged parameter; Banshee fires StateChanged('paused') and StateChanged('playing') rather than Playing and Paused signals. NetworkManager has something similar. It’s understandable why: you get one signal in a few different flavours rather than a multitude of signals. Inconvenient for this, though, because to vary what the script does based on a parameter you have to have an if statement (or something similar). I’ve been thinking about this: I do not want to build a proper language. If you want that, learn Python. But…maybe it needs control statements. I don’t know. I’m against it, but if this is useless without them then that’s a strong argument that the effort is not worth it.
  4. A script editor. This would allow people to write scripts without having to know the names of any of the functions you need to call — popup completions and the like. This is even more problematic than ask linglish about whatever, since there’s no way of saying “which apps in the world offer a D-Bus API?” — most apps do not install an activation file, which means they must be running for any script editor to even know they exist. It’s also a lot of work, although most of the heavy lifting is done by GtkSourceView.
  5. Packaging and stuff. If this is likely to be useful I should make .debs of it and so on and make it easy for people to install and everything.

And finally…

The overarching question: is doing more of this a good idea and worth the effort? Your comments gratefully accepted.

Linglish, or, some thoughts on a scripting language for the Linux desktop

After a few hours of fiddling around, I’ve come up with a thing I’m calling “Linglish”: it’s a very simple scripting language for the Linux desktop. It looks a lot like AppleScript, and it’s nowhere near finished. It basically allows you to write in a sort of bastardised English which then calls D-Bus functions, so you can say things like:

  • tell screensaver to lock
  • tell banshee’s window to present
  • tell banshee’s playerengine to pause
  • tell tomboy to createnamednote withMy Named Note
  • tell guake to add_tab
  • wait for tomboy’s noteadded then tell banshee’s playerengine to toggleplaying
  • wait repeatedly for tomboy’s noteadded then tell banshee’s playerengine to toggleplaying
  • wait 6 times for tomboy’s noteadded then tell banshee’s playerengine to toggleplaying

Like I say, it isn’t finished yet (the above all works, but there’s lots more that needs to happen). At the moment, for example, there’s no way to run more than one command, or to get a return value from any function and react on it. The question is, is this a good idea that’s worth pursuing? This will never be (and is obviously never intended to be) a replacement for a proper language; if you want to do something semi-complicated, drop into Python or JavaScript or Vala or C and make the D-Bus calls yourself. However, I can see it being useful to help people who don’t want to get to grips with proper programming but still want to control their applications.

If you think it’s a bad idea, please let me know why and what you think should happen instead. If you think it’s a good idea, then here are a couple of other thoughts that I’ve had on how it might evolve:

  • A script editor program would be nice, which could dynamically inspect D-Bus to help you write scripts. It could compile a script to an executable that wouldn’t need the script runtime either without too much difficulty (one big Python script, perhaps, or using glick to make an actual executable).
  • Obviously it needs to be able to run multiple commands, and have later ones react to what happened in earlier ones. I’m imagining an ask banshee's engine for position sort of sentence, which would get the Position property and then stash it in an invisible result variable, meaning that the next command could be tell banshee's playerengine to seek to the result + 20 or something similar.

Key question is: is this worth pursuing? Or is it reasonable to demand that people who want to script our desktop should learn a more real programming language?

Code (written in Python) in svn at http://svn.kryogenix.org/svn/linglish/; it’s only half a dozen files. If you want to fiddle with the grammar to add new ways of parsing commands you’ll need yapps2 (in Ubuntu as yapps2), and you’ll need the yapps2 runtime to actually run any commands (in Ubuntu as yapps2-runtime).

Syntax: python linglish/runner.py -c "tell tomboy to createnamednote with 'named note'"

A nice remote for my TV

My television is run by the MythTV PVR software, which I use for watching films and recording TV and playing music and the like. Now, Myth is sort of organised around having a horrible massive remote control with a million buttons on it, which I can’t stand. I want something nice and simple (Apple Remote sort of thing), but I wanted it to not use infrared (because IR is a pain in the arse, and you have to be pointing it at the TV, and apparently there are different sorts of IR which are incompatible (you can’t buy an Apple Remote and point it at any IR receiver you like and have it work, much to my disgust)).

TomTom make a Bluetooth remote control for their high-end satnav units. (It’s available at Amazon for thirty quid, which is a bit steep; I think I paid a bit less for it.) Anyway, owing to the wonders of Bluetooth and the Linux Bluez software all working nicely, just pairing with the remote means that it works like a keyboard and everything’s perfect.

If you see any guides out there on the web telling you to use “hidd” on the command line to set this sort of thing up, they are wrong and out of date. Use the Bluetooth icon on your Gnome panel to pair with the remote, and then use Preferences to connect to it. That’s all.

How my desktop looks

This is more for my benefit than anyone else’s.

So, it’s now early 2009, and after a bout of tweaking how my desktop looks, I’m pretty happy with it.

My Ubuntu desktop, January 2009

That’s the DarkRoom Gtk theme and my own Prelude-dark Metacity theme (a darkened brown version of the Prelude Metacity theme that Thomas Thurman made for me), with the gorgeous Smokikon icon set, all application, desktop, and document fonts set to Salem 8 point (from the ttf-arabeyes package), with subpixel smoothing turned on, and my simple-but-I-like-it inspired-by-the-Mac-bootsplash desktop background*.

So now when I buy a new laptop (it’s gonna be the Dell M1330 with Ubuntu on it unless anyone comes up with a reason why not before the end of the month), I’ll know how to make it look like this.

The length of the taskbar

Alberto Ruiz talks about the taskbar in Gnome wasting a lot of space, and how launchers, applets and notifications could all be merged (in a post which sounds rather like a pitch for OS X’s Dock, or at least a pitch for awn, which is rather like it).

I personally turned off my taskbar (and the whole bottom panel) ages ago, because I want more screen room. Instead, I added a Window Selector to the top panel, on the far right-hand-side. To switch between apps by name, therefore, I just throw the mouse up and right into the corner and click, and then choose an app from the menu I then get. I really haven’t noticed the lack of the taskbar at all.

Gnome panel window selector

(To be honest, I don’t even do that most of the time; I alt-tab between apps. To be truly honest, now what I do is throw my mouse at the bottom left corner which does Compiz’s scale plugin (the OS X Exposê thing), but not everyone’s running Compiz.)

(An extra note here: OS X has a nice trick where you can click on the window list you get from holding down alt-tab. Can we do that?)

I’m not sure about merging launchers and notification icons, though. There’s stuff that I want a notification icon for (XChat-Gnome, the new mail notifier, Pidgin) that I don’t need a permanently-visible launcher for because I hardly ever start them up (once at the beginning of a session, or not at all because they start themselves).

My window theme

Thomas Thurman, champion that he is, took my request for a theme for Metacity that clones the XFCE Prelude theme and went ahead and did it. What a hero.

Anyway, I’ve tweaked his work a little to make it closer to the XFCE theme (primarily making the border thinner and nudging some of the colours, and hiding the buttons on inactive windows) and you can grab the theme file. Save it as $HOME/.themes/Prelude/metacity-1/metacity-theme-1.xml, then say System > Preferences > Appearance > Customise > Window Border and choose Prelude.

Some questions that might spring to mind:

How do you move windows around when there’s no title bar?
Hold down Alt and drag them
How do you know the title of a window when there’s no title bar?
It turns out I very rarely actually need that. If I really desperately need it then I just throw the mouse at the bottom-left corner which shows me all the windows (it’s a clone of Exposê on the Mac) and that shows the titles of every window.
How do you close a window when the close button is so small? Don’t you know anything about Fitts’ law?
Alt+F4 or Ctrl-Q, normally.
Isn’t having to use keyboard shortcuts annoying and slow and wrong and bad and anti-Tognazzini’s advice?
Yep. I wouldn’t give Prelude to a new user, absolutely not. I’m not a typical user.
Why do this at all?
Because I think it looks pretty. If you don’t then don’t use it.

Back from UDS

Last week I was at the Ubuntu Developer Summit, the six-monthly big meetup for Canonical employees and the Ubuntu community to get together and work out what’s in the next version of Ubuntu Linux and how to do it. It was fascinating meeting everyone and seeing it all up close. Lots of stuff went on: I got interviewed by the Ubuntu UK guys for their podcast; I caught up with a few people I hadn’t seen for a while and lots of people I’d never met face-to-face before; I threw together a quick “lifestream” bit of JavaScript which would track a tag across various sites and it ended up on Launchpad (so if you want a trivial way to display a lifestream for a conference, grab the script and make it better); I asked everyone I could think of whether I should insist on buying a laptop with Ubuntu on it and which one I should get; we went to the Computer History Museum and indulged in the geek oneupmanship game of saying “owned one of those, owned one of those, wanted one of those” (apparently the PlayStation 1 is now Computer History); and I drank a fair amount of beer. Was a good week.

I was there because I was paid to be so by Canonical. I start work for them at the beginning of January. While there I met the people who will be my team when I start, and saw some of what they’re working on, and I’m really rather excited. I’m going to be part of Online Services. Can’t wait to get going on it. I get to make the desktop I use be better.

What I’ve got open

Rather a lot, I find myself having to save a file somewhere temporary like my desktop just in order that I can immediately upload it to some website, or attach it to an email, or something similar. It’s irritating. I have to explicitly save it; I have to think up a name for it; then I have to switch to my mail client or my web browser and browse back to the file I’ve just saved and choose it by name to upload/attach it; then I have to browse to it again in the file manager and delete it. Now, there’s lots of talk about draggable icons for files and so forth, so I can just drag the save icon out of, say, the Gimp directly into the browser. The ROX apps do this; Risc OS did it too. That’s a nice long-term goal, but it requires touching every app in the universe, and it’s hard.

I had a thought about a workaround. It’d be quite cool to have a folder called “Open Documents” which, when opened, showed an icon for each document available in each application. Then, when you pick a “file” from this “folder”, it tells the relevant application “save it as some random temporary name” and then attaches/uploads some random temporary name. So you don’t ever have to manually do the save/delete thing.

I only really strictly need this for the Gimp, to be honest; I don’t upload textual files, I cut-and-paste them. So, a rather crufty approach:

  1. Download gimpdbusapi.py and put it in $HOME/.gimp-2.6/plug-ins/ and mark it executable. It’s a Gimp extension which makes two functions available over D-Bus: image_list and save_as. (This could be the starter for making all Gimp functions available over D-Bus, with a __getattr__ hook, the gimp.pdb object, and a bit of introspection.)
  2. Download gimpfs.py, a Fuse filesystem in Python, which talks to the Gimp extension via D-Bus to get the list of currently open images in the Gimp (even if they haven’t been saved).
  3. Create an empty folder ($HOME/Open?) and python gimpfs.py $HOME/Open to mount the view of Gimp open documents on that folder.

There might be better ways to do this, with gvfs and so on, and it would be way better if it didn’t have to use tempfiles, and so forth, but this is a proof of concept. What would need to happen to have all Gnome apps’ currently open documents automatically appear in a folder ready for choosing?

MythTV alarm clock

This morning my alarm clock didn’t go off, and I didn’t make it to work. That’s gotta be fixed. Since this weekend I got a whizzy new MythTV setup around my house, that seems like the ideal thing to wake me up.

However, MythTV plugins are written in C++, and I don’t do C++ because I’m a Python guy.

So, something of a hack. It is possible to add a menu item to MythTV which runs an external program. So, thought I, that’d be one way to do it, and indeed it works. You create a new “menu theme” which launches an external program by name. The Myth menu theme development guide explains how. Then, write a small program to accept user input to set an alarm (I used pygame, which seems more in keeping with the MythTV approach than Gtk), and pow, Bob’s your uncle.

Actually, I used pygame primarily because I needed the MythTV keys to navigate around the little alarm-setting program. I’ve got some weird keys bound to do navigation in MythTV (2, 4, 6, 8 for up, left, right, down) and I’ve got no idea how you can make the 6 key mean “go to the next field” like Tab does in a Gtk application. In pygame that’s easy, so I did it that way; at some point in the future it should also allow me to theme the app so it looks like your MythTV theme, but I didn’t get around to that.

The way it actually creates alarms is by putting them in your crontab, which is easy and satisfying and what cron is for.

Anyway, code in Subversion at http://svn.kryogenix.org/svn/mythtv-alarm-clock/ if you want to have a play.

I suspect the MythTV people would be horrified by this approach. A few of them tried to convince me that I should learn C++ because it’s not that hard…

Setting an environment variable for all your apps

In the New World Order, Linux apps should all store their user-specific data according to the FreeDesktop Base Directory specification, which in practice means that config details for myapp end up in $HOME/.config/myapp. All well and good. However, I don’t like having configuration stored in dotfiles; I like to be able to get at it more easily, so I want it in $HOME/Settings. The XDG spec provides for this: you set an environment variable XDG_CONFIG_HOME (which defaults to $HOME/.config) and then everything uses it. Great! But…where do I set this variable so that all the apps get it?

Some suggestions:

  • $HOME/.bashrc, $HOME/.bash_profile, $HOME/.profile — as far as I can tell, these aren’t run as part of the login process, so they’re no good. They get run when you start bash, which means when you first fire up a terminal.
  • $HOME/.gnomerc — gets run by gdm. Might be a Debianism, and doesn’t work if I change away from gdm a few months from now
  • $HOME/.xinitrc, $HOME/.xsession — get run if you’re in X but not if you’re running over SSH, and .xsession is a Debianism
  • /etc/xdg/user-dirs.conf — this will change it for all users on the machine, not just me
  • Something in PAM. Perhaps. It’s not clear what, though.
  • A file of my choice, which I then source from all of the above places. This is doable but seems stupid to me, and I’m bound to miss something.
  • Something else. This is where you come in; where am I meant to set the environment so that everything gets access to it?

Answers on a postcard…

Gaming competition at LugRadio Live this weekend

Cool. We have confirmation that Matt Bloch and the gang at Bytemark have put together an uber-flashy gaming rig to bring to LugRadio Live this weekend.

They’ve written about this gaming server, and they’re going to be running a set of gaming competitions on it over the course of the weekend. Those of you who are gamers are going to enjoy this.

YeahConsole: a dropdown Linux terminal that’s better than Tilda

I’ve been a big fan of Tilda, the dropdown terminal window for Linux, for a long while; pressing F2 to grab a terminal is hardwired into my fingers now, and I’m crippled without it. However, Tilda’s been getting steadily shitter as time’s gone on; more crashy, more unresponsive. Recently, it stopped taking keyboard focus when you brought it up, which has led more than once to me pressing F2 and then typing half the shell command I wanted into my (still focused) Firefox window. Not only is this incredibly annoying, but at some point I’m going to type my password into an IRC channel. It’s gotta stop.

The obvious replacement is yakuake, the KDE dropdown terminal. However, I hate it. I don’t even know why, to be honest; it just feels weird to me in a way that Tilda doesn’t. So I looked around for alternatives, and found two: Guake, which is supposedly a better Tilda and Yakuake for the Gnome desktop, and yeahconsole. Sadly for the Guake team, I found yeahconsole first, so that’s what I’m using. Actually, I rather like the out-and-out simplicity and bare-bones nature of yeahconsole, which is why I’m sticking with it; when I need to do shell things, I don’t want flashy features, I want a shell. I don’t use tabbed terminal windows, for example. Just simplicity, that’s what I want.

Yeahconsole is available in the Ubuntu repositories (click to install on Ubuntu). Here’s how I set it up.

First, it needs to run every time I log in. So, go to System > Preferences > Session, select Startup Programs, click Add, and add a new command, name “YeahConsole”, command “yeahconsole”.

Next, it looks a bit rubbish when you start it up. Here’s how bare-bones yeahconsole is: you configure it with X resources. Party like it’s 1989! I had to go look up how to do this; for the more tender in years among us, X resources were a sort of central configuration for all your apps, round about the same time that humanity was fighting off sabre-toothed tigers and wondering whether that hot flamey thing in the corner could actually be useful. On Ubuntu, you need to edit (actually, you probably need to create) a file called .Xresources in your home folder*. In that file, you put the configuration for yeahconsole, like this:

yeahconsole*toggleKey: None+F2
yeahconsole*consoleHeight: 20
yeahconsole*aniDelay: 0
yeahconsole*stepSize: 10
yeahconsole*faceName: ProFontWindows:style=Regular
yeahconsole*faceSize: 9

The toggleKey one is the important one: it sets which key you use to summon the terminal. I like F2, myself, but pick whatever. What all this stuff means is documented in the man page (man yeahconsole), apart from which font to use. This is the faceName and faceSize options above, and here you have to delve a bit (I told you this was old-fashioned; I started writing a yeahconsole-properties configuration utility that did all this for you, but couldn’t be bothered). In a terminal, run fc-list. This lists all the TrueType fonts that you can use in an xterm. Choose one, and put it in faceName above.

Now, simply start yeahconsole for the first time (press Alt+F2, type yeahconsole), and then press F2 (or your key of choice). Pow, a dropdown terminal, like Tilda, but one that won’t keep crashing and make you cry.

One other thing: if you hit Ctrl-D to log out by mistake, it’ll close yeahconsole (tilda did this too), and that’s really irritating. To fix this, put the following in a file called bashloop in your home folder:

#!/bin/bash
while true; do bash; done

and change your Startup Programs command above to be yeahconsole -e /home/username/bashloop. Now Ctrl-D won’t close yeahconsole. Win.

Coming to America

I’ve been noodling about in Inkscape, and reading The Order Of The Stick, a webcomic. It’s got a unique visual style, which always makes me laugh, and I thought (despite my lack of artistic ability): I wonder if I could do that?

LugRadio Coming to America

(there’s the SVG too to look at, which is a better size, although it’s 1MB because of the embedded images)

I’m not brilliantly happy with Chris or Adam, but I think Jono and I came out OK :)

Maybe I should do a LugRadio webcomic.

Inkscape’s a really good tool, by the way. The people who do it should feel very proud. I am distinctly short of artistic ability, and I’ve barely used Inkscape before, and I managed to put that together in relatively short order. Good work, Inkscape team.

Oh, yes, and LugRadio Live USA is this Saturday. We’re coming to America. Get ready.

Editing a PDF (sorta) on Ubuntu

I have more than once had to fill in a paper form for people in America. Obviously, doing such things is a huge pain, because actual paper mail — with stamps — isn’t just so last century, it’s the century before that. You know, the one with robber barons and Lord Kelvin and workhouses. Put a stop to it. Email. Email, I tell you. It’s gonna catch on, just you wait.

Anyway, a fair few American corporations (and, wouldjabelieveit, the American government too) provide PDF versions of their forms so you can download them and print them out at your leisure. They’re still designed to be printed and written on, though — they’re not officially PDF “forms” in the sense that the PDF reader can give you textboxes and an FDF file to fill them in, they’re just PDF documents. Nonetheless, I find myself wanting to be able to open them up in OpenOffice.org and edit them.

Now, you can’t do that. (Well, you might be able to, but it’s hard.) All I actually need to do is overtype them. So what I do is:

  1. Convert the PDF to an EPS file with pdftops: pdftops -eps AmericanGovernmentForm.pdf (the pdftops program is in the poppler-utils package)
  2. Create a new empty document in OpenOffice.org and drag the new .eps file onto it, which will embed it as an image
  3. Use Insert | Frame to draw a text frame on top of the new image (set it to have no border; set the background colour to anything other than No Fill and transparency to 100%)
  4. Overtype onto the form in the text frame
  5. Export as PDF to get a PDF version with your text in
  6. Email it to the government

No stamps. Their evil must be stopped.

NetworkManager and phones and data plans

Dan Williams:

NetworkManager mobile broadband support…can most likely use your GSM mobile phone…if you add the appropriate stuff to the HAL .fdi file.

Blimey, that’s excellent. What would be required to get .fdi files for loads of phones into HAL by default, so it Just Works out of the box? For a given mobile phone model, will the serial port always have the same settings, or does it depend on who your phone company is and so on as well? It’d be brilliant to have this all working with no configuration required.

(PS. Dan, I couldn’t use OpenID to log in to leave this as a comment on your site; it didn’t recognise http://www.kryogenix.org/ as an OpenID for some reason.)

Media players and the TV

I’ve spent a while trying to get Elisa to work on the computer attached to my TV (a PPC Mac Mini running Ubuntu). Video was slow and jerky, and there was a strange white bar graphical glitch. Anyway, after fighting all day with it, compiling the latest version of Elisa and so forth, I eventually gave up and installed MythTV. And it works perfectly.

I don’t really want MythTV. I prefer GStreamer-based applications, because I think GStreamer is the way forward, and Myth does a mountain of stuff that I don’t want, like watching live television; all I want to do, for the moment, is watch recorded video files. I like Elisa’s interface more than Myth’s. I’m more able to write Elisa plugins than I am for Myth.

Still, Myth (using VLC as the playback program) works fine, and Elisa doesn’t, and I don’t think Elisa will get better; it seems that the problem might be the open source ATI drivers, which aren’t (apparently) as good as the closed source ones. I can’t run the closed source drivers, though, because they don’t exist for powerpc, which is what the Mac Mini is (even ignoring that I don’t want to run them because they’re closed source). So MythTV it is. There is probably a lesson here.

Making the arrow keys work in VLC

One of my big flaws with the VLC media player is that you can’t use the arrow keys to skip backwards and forwards in a video. It turns out that this is because the left and right arrow keys are already configured to mean “navigate around a DVD menu” and you can’t configure a key twice. So, if you need to use VLC for something, and you want the arrow keys to work, go into the settings and set the DVD navigate options to something other than Left and Right. Then configure “jump forwards” and “jump backwards” to Right and Left, and then it’ll work. God knows why it has to be this way, but at least if you do that it works.

Epiphany download icon

Did you know that Epiphany puts a little icon in the notification area while it’s downloading stuff?

epiphany download icon

Well, you might have mentioned it to me, because I didn’t know. Anyway, that’s really cool. A couple of minor issues with it; firstly, the icon has a right-click menu with only one option, “Show downloads”. Since left-clicking the icon shows and hides the download window, I can’t think what the point of the right-click context menu is; surely right-click should just do the same thing as left-click? (Bug #508151 submitted.)

Secondly, and not really an Epiphany problem; I’d love to see the “downloads” window go away, to be replaced by a “Downloads” folder which has Special Nautilus Magic when displayed. The folder could show partial downloads in progress, with how long there is to go, a clickable link to the page it was being downloaded from, etc, etc. This requires some heavy co-operation between Epiphany and Nautilus (although it might be doable as a Nautilus extension; having said this, I can’t find a way to add a top bar (like Deleted Items has or the CD burner has) to a Nautilus folder from an extension), and I’m certainly not the first person to suggest it, but I think it’d be deeply cool.

Epiphany

A little while ago I decided to try out Epiphany instead of Firefox as my main browser.

It’s excellent. It’s a proper Gnome application, which Firefox isn’t — it just fits in to my desktop because it has a proper Gnome interface, and I really like that. It starts up and runs way faster than Firefox does; it doesn’t crash like Firefox does; it does everything. Huge applause for the Epiphany team, I say. Install the epiphany-browser package on Ubuntu to get it. It uses the same rendering engine as Firefox, so the whole web still works perfectly.

I’ve heard a fair few people bitch about not having access to Firefox extensions, but, frankly, it turns out that I don’t actually need any of them. Epiphany actually comes with a load of extensions (install epiphany-extensions on Ubuntu to get them) and there are third-party extensions too if you like. I’ve changed my opinion on this; I did think that it was bad that extensions need to be written in C or Python rather than XUL/JavaScript, but hey.

Of course, the one big missing thing for me, when I have my web hacker hat on, is Firebug, which is the greatest web development tool that’s ever existed. Wish that existed.

Epiphany is also the default browser in the next release of Gobuntu, which is what I run, so I’d have been migrating to it anyway — it’s jolly pleasing to note that it’s actually better, too.

Gobuntu

This weekend I upgraded my machine to Gobuntu, the entirely-free-software (but see below) version of Ubuntu 7.10 Gutsy Gibbon. Since I’m specifically named as the use case (!) it seemed like the right thing to do. First, the good news: it all seems to be working fine. Since I was doing a clean install (again, see below), and because my laptop has an AMD Turion chip in it, I went for the 64-bit version. (Thanks to Dave Morley for taking the time to tell me whether the 64-bit version was worth it.) Everything works; no problems at all. Good work, the Gobuntu team.

I have a few extra things worth mentioning, though.

First, like Mark Pilgrim, I’m disappointed that the issue with Firefox’s non-free logos wasn’t resolved before release. Apparently the solution will be to replace Firefox with Epiphany, the Gnome browser which is based on Gecko, the Firefox rendering engine. At that point people will hopefully be able to move to the unbranded “Firefox”, which seems to be called “Iceweasel” or something similar; I don’t really like using Epiphany, because I want lots of Firefox extensions that aren’t available for it. This seems like a good solution in general, though, and it’s what I assumed would be the case in Gobuntu; I’m slightly surprised that it wasn’t.

Second, there doesn’t seem to be an upgrade path from Feisty, the last version of Ubuntu, to Gobuntu Gutsy. That’s really annoying. Now, possibly there is such an upgrade path; possibly just upgrading to ordinary gutsy and then installing the gobuntu-desktop package would work. However, I couldn’t find anything, anywhere, to say that that was the case; does that package remove all the dubiously-free stuff that Gobuntu doesn’t contain? I don’t know. Gobuntu’s very new, so it’s entirely understandable that there’s not a lot of documentation yet (I had to hunt around rather a lot to find the official Gobuntu page so that I could link to it!), but it was pretty disappointing that it wasn’t clear how to install it. (I eventually decided to go with a clean install, because then I could be sure that I wasn’t running anything non-free, and because I wanted to take the opportunity to move to 64-bit, and because I liked the idea of being sure that I hadn’t made configuration decisions three years ago that were adversely affecting me now).

Third, and not a complaint, there’s no live CD for Gobuntu yet. I personally think that’s fine; again, Gobuntu’s new, and at least initially it’s probably not destined for “ordinary” users; having people like me use it for this release should shake any obvious bugs out of it ready for the next release. My ideal eventual goal is that people install Gobuntu by default, but we’re a way away from that yet. All the hardware on my laptop that I care about works fine (the wireless card doesn’t work, but then I wasn’t using it anyway, and the video card doesn’t do 3d acceleration, but I can live without that for now). This leads on partially to…

Fourth, also not a complaint, Gobuntu allows you to install non-free software once you have it itself installed. There was something of a furore about this on the Gobuntu mailing list, but I can’t think why. The distribution is, at the moment at least, destined for people who want to ensure that they’re using entirely Free software, and are prepared to deal with limitations (like no wireless) to make that so. I personally am not going to install any non-free software, even if it’s offered. The idea that Gobuntu should not allow non-free installations from the Ubuntu archive implies that the plan is to somehow trick people into running Gobuntu without realising it, so that they must be forced to stay on the straight-and-narrow path of free-software-only. I don’t need forcing; I choose it. Let’s have some faith in people.

All in all, I found it to be pretty successful. My experience hasn’t got any worse since Feisty (and I get the advantage of improvements made in gutsy), but now I have a warm comforting satisfied feeling that I know that my machine is entirely Free. Thanks for that warm feeling, Gobuntu and Ubuntu communities: I like it.

Gnome filepicker windows

From the Ars Technica review of Gnome 2.20:

GNOME’s file dialogs are still extremely weak in many respects. For instance, the file dialogs still do not support even basic file management tasks like renaming and deletion. The file dialogs also lack adequate support for thumbnail display. Dialogs in some applications will show a thumbnail for one item at a time, but the file dialog windows do not display thumbnails next to individual files in the list—a feature that can be found in both KDE and Windows. It’s a serious deficiency that has long detracted from the general usefulness of GNOME’s file dialogs. In many cases, when I use a file dialog in GNOME, I find myself opening up a Nautilus browser and navigating to the same path so that I can see thumbnails or perform file maintenance tasks before saving or loading.

A long time ago, there was a patch for Gtk produced by the ROX team that added a draggable icon to the Gtk filepicker window — to save your document, just drag that icon to a Nautilus window. Those of you who remember RISC OS might remember that that’s the way you saved files there:

Saving a file by dragging an icon

There are a few UI problems with filepickers, as mpt pointed out a while back, and the drag-icon-to-save model neatly avoids them. There are, of course, issues: the main one is that in order to properly implement drag-and-drop saving, apps should use the freedesktop X Direct Save protocol, which I think means that every app must be patched to allow its saving to be accessed as a stream (so you can “save” a file directly into another application). I might be wrong about that being hard, though — my C-fu is not strong, which is pretty high on the list of reasons why I’m not trying to make this happen already.

The Tango project’s Window Experiments mockups have the draggable icon living in the top corner of the window itself, which seems like a great idea to me.

Is anyone working on this? I’d love to see whether it works out in practice.

Tracking bugs for sorttable

I get lots of people mailing me for help with things I’ve written, and sorttable is way up at the top of the list. People find it useful, which is good, and they mail me to say thanks. I like that. On the other hand, they also mail me to say that there are a few things it doesn’t do. Now, they’re right; there are a couple of bugs that slipped through, and more importantly there are a couple of things that never crossed my mind until people started asking whether sorttable could handle them — loading tables with Ajax, tables with zebra stripes, that sort of thing. I’m now at the stage where in my “sorttable unprocessed” folder I’ve got over 150 emails, and an awful lot of them are about the same things.

So, a bug tracker seemed like a good idea. However, I don’t want one where everyone can submit bugs into it. I get little enough time to hack on projects as it is, without having to triage bugs as well. So, I wanted something which was basically read-only; a place where I could point people to say “look, here, the problem you have identified is a known issue, and I am planning on fixing it, and you can subscribe to this and get notified when I do fix it”.

So: the sorttable bug tracker.

It’s shamelessly borrowed from the PuTTY wishlist in almost all particulars, right down to the differing levels of priority. Simon Tatham actually pointed me, when I asked, at the code they use to run that wishlist. I had a couple of extra wrinkles I wanted to add, though, and their code is in Perl and I’m not much cop at Perl, so I built my own very similar thing. You can read my spec for a read-only bug tracker if you like; essentially, the bugs themselves are in a (secured) folder in my Subversion repository as RFC822-style files, and then there’s a little collection of scripts which know how to build a static HTML collection of bugs for the project. I’d like to make the scripts available so other people can do the same thing, but they’ve got passwords hardcoded into them (because the bug area in svn is secured, because there are bugs in projects that I can’t make public). If I can think of a way of making the code available, I’ll do it, but it’s relatively trivial anyway.

At the moment I’m only tracking sorttable bugs in here, but I’m gradually going to bring all my other projects that are me-develop-you-use things into it. It’s not suitable for something like Jackfield, which will eventually develop more of a community around it (and will therefore be a lot more collaborative); sorttable isn’t a big enough deal to be a community-maintained project, but I do need somewhere I can point people at when they say “why doesn’t it handle Ajax-created tables?”, and now I have that somewhere.

Which video card should I buy?

Dear Lazyweb: I’ve got a desktop machine, which I use sometimes at home. It’s plugged into a flatscreen monitor. The machine has an old Trident CyberBlade video card in it, which won’t drive the flatscreen at anything higher than 1024×768, which is pretty annoying. So, I’d like to buy a new video card for it. However, I’m horribly confused by video card stuff. Which card should I buy? It needs to be supported by free software drivers (i.e., not require the nvidia or fglrx binary drivers), but it does not need to do anything very exciting; I don’t play games on the machine, for example. It’d be nice to have the 3D compiz stuff, too. As far as I know, Intel don’t sell separate cards, which leaves me with ATI or nVidia; I keep hearing that “older” ATI Radeon cards are well supported by free software drivers, but I don’t know whether that includes enough 3D support for compiz, and I don’t know precisely what “older” means: ATI’s product range confuses the hell out of me. I’ve got no problem buying something from eBay, so it doesn’t have to be a card that is currently on sale in shops. Any advice gratefully accepted.

Jackfield and Python talk

My slides from my Jackfield and Python talk at Pycon UK are available.

A few people have started hassling me to provide packages for Jackfield, my port of Apple’s Dashboard to Linux, so people can more easily try it out. What do you think, gentle reader? I’ve got very little time to work on Jackfield at the moment, and I felt that a better use of my time would be to try and make it run more Dashboard widgets, rather than to make the installation process easier — my thought was that the ease-of-installation process is critically important, but it’s critically important to users, and Jackfield isn’t meant to have users yet because it’s not close enough to being ready. Tell me what you think: should there be Debian packages, Ubuntu packages, Fedora RPMs? The point was made that there’s a lack of contributions from other people precisely because it’s too hard to install, and I found that a relatively compelling argument. So, let me know what you think in the comments.

All busy on the Western front

Stone me I’m busy. Bah. Haven’t even had time to write some things up here. However, my collection of kept-unread things in Google Reader has reached high enough proportions that I have to do something about it, so this gets a few things off my list.

A post about the stuff I discussed at LugRadio Live — whether it might be reasonable to make “be permissive about IP” be the default for Linux distributions and make the Americans and others in oppressive IP regimes do the legwork to remove what they consider to be “patent-infringing”, rather than all of us non-Americans suffering for it — is stacked into the holding pattern and circulating over Heathrow, incidentally.

Recent interesting things

Google Reader finally lets you search past posts
Thank god for that. Finally. Finally.
ATI open graphics specs and open source the driver for video cards
This is a pretty big deal, this one. At first blush it looks as if two of the three leading graphics card manufacturers (ATI and Intel)* will now have good support in open source. I imagine someone at nVidia has at least noticed that this has happened. More openness of this sort cannot be a bad thing. Well done ATI, I say.
I should note a couple of small reservations: it’s only for their newer cards (i.e., not most of the ATI cards that are out there), and it’s not as simple as them just open sourcing their existing fglrx binary driver. They’re providing a library to access the BIOS on the card, but most importantly they’re providing specifications for the cards. It’s still down to the open source community to write the driver itself, but we’ve historically not had a problem with that (and ATI are funding the initial writing of this driver!). Phoronix has more detail on what ATI are actually doing — the important quotation is “The aim of this open-source driver is not to overtake the fglrx driver but rather is designed for those who just want a working desktop with 3D capabilities and basic video playback. This new driver is ideal for FOSS enthusiasts” — the point here is that if you want the very best performance from your ATI card you’ll still need to go proprietary, but there’s now enough information that the open source code will be able to provide the things that a lot of people are clamouring for — 3d acceleration, video acceleration, 3d desktop effects. Well done, ATI, I say. Obviously I’d like to see it all being Free, but I’m confident in the open source community’s ability to build a great driver (maybe even a better driver than the binary one?) based on having the information they’ve asked for, and now they’ve got it. Blizzard’s thoughts are informative.
@media Ajax 2007
I’m really looking forward to speaking at @media Ajax this year. The list of speakers is pretty cool, indeed, including some people I’ve never had the chance to meet. As usual, details of events I’m going to be at are on my events page.
Separated at birth
John “jQuery” Resig says that he’s “baffled” by why I referred to him as John “Kelly Osbourne” Resig in an earlier post. Well, the camera doesn’t lie.

John Resig and Kelly Osbourne

On the other hand, John did an excellent Google Tech Talk on building a JavaScript library, so don’t hold it against him.

Convert a physical Linux box into a VMWare virtual machine
Useful, although convoluted. Parallels lets Mac people virtualise from a bootable partition, so you can either boot into your image or run it as a VM inside another OS. Can we do that under Linux? It’d save my dad rebooting into Windows to make his scanner work.

A few recent things

Haven’t posted much in the last few weeks: haven’t had much time.

First, photos. Guadec 2007, my holiday in San Francisco, a few from Linux World while I was in SF, and three of the Men with Bigger Stones in Edinburgh.

Jeremy Garcia from LinuxQuestions Tim looking like a spanner Michael Vogt on the beach in Birmingham A tram in San Francisco

Next: random stuff I’ve read about that looks good.

  • The Fedora team are building an “experimental” desktop spin. This is a really, really cool idea. A chance to do cool stuff that people might not like but could be a radical improvement. I’ve talked on LugRadio in the past about how incremental improvement is safe and easy but won’t win the war, and this sort of experimentation is exactly what I think we need. Great idea, fedora team. I’d like to be involved but I’m worried I don’t have time.
  • Brad from LiveJournal posts a set of musings on portability of data between social networks, which has sparked lots of discussion on the associated mailing list.
  • Webilder automatically cycles your desktop background through pretty Flickr pictures. I’m using it. This is cool enough to freeze nitrogen.
  • Another Blender film. Excellent. I must pre-order this one. Hopefully this time it won’t be as weird as Weird Jack McWeird the Weird, like Elephant’s Dream was.
  • Luis Villa gives me a beating about regaining my respect for Mark Shuttleworth’s commitment to free software. I, personally, think that Gobuntu is not a stooge distro, but it remains to be seen whether it’s actually pushed as an important thing when gutsy is released or whether it’s buried in some back alley bit of the website. I agree totally about there being no Launchpad source, indeed. As to why Shuttleworth isn’t investing in OLPC, well…you can only do so much at once. OLPC are indeed building a free software laptop. On the other hand, it’s not a free software laptop that I, Stuart, will be able to buy; someone ought to be trying to persuade people to make existing Western laptops run only free software as well. OLPC is a valuable project, indeed, but it’s not the be-all and end-all. Whether the Ubuntu/Dell deal, etc, counts as doing this depends on your point of view.

Oh, and in a couple of days I go to Italy for a week (note to burglars: no I don’t). Sun, sea, sand, pizzas. I love Italy. I’ll be near Lake Garda; I would say that if anyone lives near there then I’d love to meet up, but I suspect I might get into some trouble from the family if I disappear to talk about LugRadio. Italian people, if you want to meet up anyway, let me know!

Guadec tomorrow

Tomorrow morning, and for the rest of the week, I’ll be at Guadec. I’m speaking about the web and the desktop and Jackfield on Sunday, and LugRadio are Official Media Partners (ya, rly!) for the whole event, which means that we’ll be bagging people and dragging them into our secret recording studio room for interviews and whatnot. If you’re going to be there, say hello or grab me for a beer or something.

The respect re-build

I was starting to worry a bit about Canonical and Mark Shuttleworth — my fears that Ubuntu was becoming just a little bit more non-free every day, that they weren’t really pursuing the goals that I’d like to see them pursue. Obviously, they aren’t obliged to do what I say — I suspect that Shuttleworth’s opinion would be that I am welcome to make myself eight hundred million dollars and start my own Linux distribution if I don’t like the way he does it — but I’m deeply, deeply pleased to see that I was wrong all along. First, there’s Gobuntu, the promised totally-free version of Ubuntu, as part of the next Ubuntu release. (I’ve already tried a nightly, and, er, tasksel failed during the installer. I’d file a bug but I’m not sure where to put it; there seems to be no Gobuntu product in Launchpad.) Fantastic news; I’ll leave it a little while to stabilise and then try it (or I’ll try it very soon if someone can tell me where I should send bug reports). It’s Guadec this week, so I can’t afford to sod up my (working, free-drivers only) laptop before I do my talk, but I want to help with Gobuntu.

Second, Mark’s also flagged the idea of being able to buy a laptop filled with free-software-supported hardware. Those of you who listen to LugRadio will know that I’ve whittled on repeatedly about how people don’t want to install Linux, they want to just buy a computer that works. It’d be so good if I could just go and buy a laptop that works, the next time I need a laptop, something which supports all the cool stuff that the free desktop can do. I’m pretty tired of people saying “I don’t like Linux, my OS X just works”, when half the problem there is that if I tried to install OS X on some random arbitrary computer it wouldn’t have any drivers there either. Having “Linux-specific” laptops isn’t by any means the only approach we should take, but if they existed it’d be such a good way to get things out to people — someone says “I’d like to try Linux, I’ve booted it a bit and it seems good and I want to buy a machine” and I point them at this. Greatness. I’ve signed up to the mailing list; hope there’s some discussion there soon.

In brief, then: sorry for doubting you, Mark. Those of you reading who are busy preparing the word “fanboy” in a retort — yeah, I am a fan, a fan who’s just had his faith renewed.

Now, when can I buy an OpenMoko phone that seamlessly integrates perfectly with my Ubuntu desktop?

My new network is unstoppable

My internal network — connecting together 6 machines, a JetDirect printer sharer, wireless, the phones, and my cable modem — used to all be wired together through two 10baseT hubs. Throughput was horrible; one or both of the hubs were broken. I’ve just replaced the two hubs with one 16-port 10/100/1000 switch, and my network is now between ten and one hundred times faster in my testing!

It’s now fast enough, for example, that the computer plugged into the TV can show films and TV programmes that are stored on another computer on the network!

You might be thinking: yeah, whatever dude, this is not exciting, of course it does that. Well, the hell with you, anyway. I think it’s exciting.

Anyway, this means that something I’ve been thinking of doing for a while leaps up my priority list. One of the 6 computers is a server: an old tower case machine with 90GB of storage in it made up of scrounged hard drives I had lying around. I use it as the server for my home backup system, and it does a good job. However, since I can now play media across the network (exciting! it is!), I could use it as the storage place for all our films and TV and music and games and whatnot. However, it’s old and a bit noisy, so it’d be nice to get rid of it. I still need whatever I replace it with to be an actual server, though, not just a NAS-style stack o’ discs, so I don’t want a Buffalo Terastation or similar — it not only needs to run the rsync server but I also plan on having it be used for BitTorrenting stuff I’d like to watch and to be always on for downloading things.

Can anyone think of a better alternative than buying a Linksys NSLU2, installing the Unslung firmware, and plugging a big USB hard drive into it? That looks like a powerful and cheap way to do it, as far as I can tell.

Jokosher one of the 15 open source projects to watch

According to this Datamation article by Matt Hartley, Jokosher is one of the 15 open source proejcts worth watching.

Where Jokosher stands out beyond other audio applications is that it provides for easy inclusion of a fantastic new GUI. This allows the ability to distinguish one track from another with the help of icons and other visual references…Feels like Audacity with regard to simplicity, but has a full set of features and seems to be more fun to use from a visual perspective.

Good work the Jokosher team!

One Python, singing in the darkness

Mod-python is an Apache module which loads one copy of Python at Apache startup, and then all subsequent Python web applications use this one Python interpreter. It means that you don’t incur Python startup times every time you visit a URL, and it’s really useful. (There are similar-but-different approaches, such as FastCGI and SCGI; they all basically involve running one Python interpreter, though.)

Lazyweb: Would it be possible to do this for the Linux desktop? Have one Python running and have it run all the applications that use Python? I don’t know how you stop a crash in one application crashing all unrelated applications, but the modpython people have presumably solved this problem. Python isn’t significantly slower than C for most actual applications, which are event-driven anyway, but startup is certainly slower; it’d be rather nice to have that startup wait go away.

fspot2lj – export F-Spot photos to your LiveJournal photo hosting

fspot2lj is for exporting your F-Spot photos to your LiveJournal photo hosting at pics.livejournal.com. It’s not yet finished, but it works well enough to have exported all my photos and resize them all to 800×600 at the same time. It pays attention to F-Spot tags and creates LiveJournal galleries from them.

It uses my Fotobilder Python bindings (which come pckaged with it). You’ll also need Python, PyGtk, the Python SQLite bindings (which come with recent Pythons), the Python Imaging Library (called python-imaging under Ubuntu), and obviously you’ll need some photos in F-Spot.

You can check it out from Subversion with svn checkout http://svn.kryogenix.org/svn/fspot2lj/trunk/ or download it. Bug reports and complaints in the comments here for now. And yes, I know it’s a bit slow at checking the uploads.

FotoBilder LiveJournal photo gallery Python bindings

In order to move my photo gallery to LiveJournal, I needed to import lots of photos. This is doable one-at-a-time on the web, but like all good web apps, FotoBilder (which is the software that runs pics.livejournal.com) has an API which you can work with. There don’t seem to be any Python bindings, though, so I’ve written some. Go get fotobilder.py. Note that it’s not a complete implementation; I’ve only provided the stuff I need (UploadPic, UploadPrepare, a few other things). There are some niceties about it, like that you never have to worry about handling challenges because it does all that for you. Nonetheless, it seems to work for what I needed it for.

You’ll also need to get ProgressReportingHTTPConnection.py. This is a modification of the HTTPConnection object in Python’s httplib, which is part of the standard library, so that it can report progress on uploads. If you need to use httplib to send data to a remote server and you want a progress bar, using ProgressReportingHTTPConnection.py makes it easy. Simply use it like httplib.HTTPConnection but pass a function to the constructor as progress_callback; httplib will call your function with every 2KB of upload done.

Update: licenced under the GPL v2.0.

Speaking at Guadec

My Guadec 2007 talk has been accepted! I’ll be speaking on the Sunday warmup day about the web and the desktop and Jackfield. One more thing to add to my list of events I’ll be at. Thanks to Ross Burton and the Guadec team.

Jokosher VoIP work accepted for Google Summer of Code

Michael “Elleomea” Sheldon has been accepted by the Google Summer of Code to work on VoIP integration into Jokosher. This is excellent news. I put together a spec for how I’d like to see VoIP work in Jokosher a little while ago, and I’m eager to actually see it happen. Nice one Elleo; this makes Jokosher even better!

Ubuntu 7.10 to be properly Free (if you want)

Mark Shuttleworth:

Ubuntu 7.10 [the version about to go in development, due for release October 2007, codenamed "Gutsy Gibbon" - sil] will feature a new flavour – as yet unnamed – which takes an ultra-orthodox view of licensing: no firmware, drivers, imagery, sounds, applications, or other content which do not include full source materials and come with full rights of modification, remixing and redistribution. There should be no more conservative home, for those who demand a super-strict interpretation of the “free” in free software. This work will be done in collaboration with the folks behind Gnewsense.

Yaaaaaaaaaaaaay! I’ll be able to use Ubuntu and not feel slightly bad about it, because it’ll no longer be a little bit pregnant but it’ll be the loveliness of Ubuntu, with all the care and attention paid to my experience as a user. There can be no better news. Good work, Mark S and the Ubuntu team.

Those of you who are thinking “who the fuck cares?”, read my previous request for this to happen and particularly Freedom vs Features to find out why I care. You should also read Jono Bacon’s Features vs Freedom; if you fall on his side of the fence rather than mine, that’s fine, because in October we’ll both be able to be Ubuntu users without a problem. We can both be part of the conversation.

Gaim nicer notifications with libnotify on Ubuntu 6.10 Edgy

Gaim (now renamed to Pidgin, but the version I’m using isn’t that new) comes with a “guifications” plugin to do “notifications”, those little popup “toast” messages to tell you that someone’s messaged you, someone’s logged on or off, all that sort of thing. However, guifications is ugly and doesn’t look like the rest of my desktop, and there is a proper notification thing for Linux, called libnotify. Some bright spark has written a Gaim plugin to use libnotify for notifications, but it’s not available in Ubuntu edgy. It is, however, in the development release, Ubuntu feisty. Here’s how to install it (and this acts as a very tiny HOWTO for how to install stuff from an Ubuntu release other than the one you’re on).

Basically, this involves building the package from the source code. First, then, you have to tell Ubuntu that it can get source code from Ubuntu feisty. Go System > Administration > Software Sources. In the Third Party tab, click Add, and put in the APT line: textbox:

deb-src http://gb.archive.ubuntu.com/ubuntu/ feisty main universe

Add Source, Close, and Reload when it tells you that the information about available software is out of date.

Ubuntu's Software Sources window helps you configure where software comes from

Next, you need to get the Gaim libnotify package. I’m assuming here that you’ve built packages before; if not, you’ll need to install build-essential from Synaptic (or with sudo aptitude install build-essential in a terminal).

Create a temporary folder to do the build in (Places > Home Folder, then right-click in your home folder window and say Create Folder, and call the new folder tmp).

In a terminal (Applications > Accessories > Terminal), change into your created temporary folder

cd tmp

and install first the things you need to build the package

sudo aptitude install libnotify-dev gaim-dev fakeroot cdbs

(you could also install those three packages from Synaptic if you prefer), and then fetch and automatically build the gaim libnotify package

fakeroot apt-get --build source gaim-libnotify

That will take a little while. Once it’s finished, go back to your Home Folder window and look in the tmp temporary folder you created. There should be a file called gaim-libnotify_0.12-1_i386.deb

Run that file. The Package Installer window will pop up; click Install Package. This will install the new notifications (it may ask for your password to do the installation).

Now, you need to enable the plugin. If Gaim isn’t running, run it (Applications > Internet > Gaim Internet Messenger), and right-click on its notification-area icon; choose Plugins:

In the Plugins window, tick Libnotify popups. Remember to untick Guifications if you were using it before! Close the Plugins window. I then had to quit Gaim (right-click the notification-area icon, Quit) and restart it before the new notifications worked properly. But, lo and behold, nice pretty notifications when someone logs in!

Christian Heilmann sends me a message
Tiny Matt Revell signs off

WebKit browser on Linux

Update: the trivial WebKit browser is now included in Ubuntu. Simply install libwebkitgdk0d on Ubuntu gutsy (just click the package name there to install it if you’re running gutsy now) and then run /usr/lib/WebKit/GdkLauncher to get a simple WebKit browser for testing your code.

You too can test WebKit, Apple’s web rendering engine and the thing that makes Safari work, on Linux. The KDE teams have been working hard on making it work inside Qt, the KDE widget set, and indeed it does work! A few simple steps are required.

First, check out the WebKit source code. There is loads of it, so this will take a while. You’ll need Subversion for this.

svn checkout http://svn.webkit.org/repository/webkit/trunk WebKit

That will give you a folder called WebKit. You’ll now need a few requirements; the key one is Qt4. On Ubuntu 6.10 (edgy), get this like so:

sudo aptitude install libqt4-dev

Now build your Qt-based WebKit browser:

QTDIR=/usr/share/qt4/ WebKit/WebKitTools/Scripts/build-webkit

Finally, run it:

WebKit/WebKitBuild/Release/WebKitQt/QtLauncher/QtLauncher about:blank

I created a menu entry to run it (right-click on the Applications menu, say “Edit Menus”). Now I can test stuff in WebKit!

Note that the Subversion version of WebKit is miiiiiiiiles ahead of what Safari is using in released versions of Mac OS X, so don’t think that just because something works in your little WebKit browser it’ll work in Safari. Nonetheless, cool.

IEs4Linux

Testing web stuff in Internet Explorer is an unfortunate necessity. It’s a lot easier if you go get IEs4Linux, which with one command installs IE5, IE5.5, and IE6 on Linux using Wine. Nice.

The latest beta version is easier to install (graphical rather than command-line) and also installs IE7 (in a rather hacked weird way); when it goes stable I shall be using it!

Good work Sérgio Luís Lopes Júnior!

Matthew Garrett facts

The man, the legend, Matthew Garrett now has his own Matthew Garrett Facts at angryfacts.com.

Find out what motivates the angriest man alive. Marvel at how he can be so tall and so thin all at once. Ask him which laptop he’d recommend, like he’s never heard that question before. Wonder at how he’ll soon be Dr. Matthew Garrett, if you please.

“Matthew Garrett invented the eye.” Pure class.

Belkin Wireless-G USB adapter in Ubuntu 6.10 Edgy

I’ve got a Belkin F5D7050 wireless USB adapter. It didn’t work under Ubuntu. This is because Edgy ships an old fucked version of the driver. If Ubuntu is loading the “rt73usb” driver, and it’s not working for you, that’s why. Download and install the CVS version as per the Ubuntu wiki instructions and it works perfectly. Superb.

Jackfield talk at Skycon

As mentioned in these pages before, the LugRadio team are going to SkyCon in Limerick, Eire on February 16th-18th 2007. They asked me to do a talk, as also mentioned, and after polling my gentle readers I’ve decided that the most interest is in Jackfield. So, if you’re interested in Jackfield, try and get along to Limerick next month.

This does also mean that I’ll carve out some time to fix the D-Bus stuff and generally do some more work on the project, which should make some people happy!

Writing a Jokosher extension: a rambling essay

Jokosher is an extensible bit of software. We knew that we’d never be able to
think of all the stuff that people would want to do with an audio editor, so
we’ve set up Jokosher so that people can write their own extensions to it. So
if you want to do something particular, something very specific, something we
don’t like, or something we just haven’t got around to yet, you can roll up
your sleeves and do it yourself. This is the story of how I built the
Freesound extension, which lets you easily browse the comprehensive library
of sampleable Creative Commons licenced stuff at the Freesound system
and then easily drop the samples you like into your Jokosher project.

Jokosher extensions are, basically, tiny separate programs that can talk to
Jokosher itself in certain specific ways. So, the Freesound extension isn’t
really an extension so much as it’s a graphical browser for Freesound, which
happens to know how to talk to Jokosher a bit. For the moment, let’s pretend
it’s a separate program without any Jokosher bits at all. It works like this:

  1. The program starts up
  2. It checks to see if it knows what your Freesound username and password are
  3. If it doesn’t, it pops up a dialog for you to enter them, and then saves
    them away for next time when you do type them in
  4. It shows a window containing a search box and a Go button
  5. When you type something to search for in the search box, it runs a query
    at Freesound using your username and password, and the thing you searched for,
    and gets back some XML describing matches
  6. It puts a list of all the matches in the window, each with a description
    (that it gets in the XML), and a little waveform image (that it gets in the
    XML), and a play button (that it creates itself, but that plays the file directly
    from a URL that it gets in the XML)

…and that’s it. The integration with Jokosher only comes in two parts;
firstly, starting it up, and secondly, allowing you to add samples that
it’s displaying to a Jokosher project.

The first part’s pretty easy. Jokosher allows an extension to add itself
to Jokosher’s Extensions menu. The way you do this is pretty simple.

To write a Jokosher extension, you need to first create a Python file. In
order for that Python file to *work* as a Jokosher extension, it needs to
define certain things. Those things are:

Three variables, EXTENSION_NAME, EXTENSION_DESCRIPTION, and EXTENSION_VERSION
Two functions, startup() and shutdown()

So, to make a Python file into an extension, you add something like this
to the bottom of it:

def startup(API):

	pass

def shutdown():

	pass

EXTENSION_NAME = "Freesound search"

EXTENSION_DESCRIPTION = "Searches the Freesound library of " +\

  "freely licenceable and useable sound clips"

EXTENSION_VERSION = "0.01"

The variables are needed so that Jokosher knows what your extension is called,
and can display a useful description to the person using it.

When Jokosher starts up, and loads your extension, it calls your extension’s
startup() function, and it passes it one object: above, we’ve set the startup()
function to call that passed parameter “API”. The API object is how extensions
can talk to Jokosher. Now, it’s important to note that you don’t make your
extension do all its work in the startup() function. That gets called as
Jokosher itself starts up. Instead, we want the Freesound extension to add
a menu item to Jokosher’s Extensions menu, and then when the user clicks that
menu item we start doing the work. The API object has a function called,
amazingly, add_menu_item() to do exactly that. So, our startup function
should actually be:

def startup(API):
	menu_item = API.add_menu_item("Search Freesound", callback_function)

What this will do is add a menu item “Search Freesound”, and when the user
clicks on it it’ll call callback_function(), which is defined in our extension
somewhere.

Another minor thing is that anything you do in the startup() function has
to be un-done in the shutdown() function. The reason for this is that shutdown()
gets run if a user disables your extension. In our case, we need to remove
that menu item, which is done using the menu item’s destroy() method. So,
change startup() so that menu_item is a global variable (so it’s available to
shutdown() as well), and change shutdown() so it removes it:


def startup(API):

	global menu_item

	menu_item = API.add_menu_item("Search Freesound", mainwindow.menu_cb)

def shutdown():

	menu_item.destroy()

That takes care of hooking the extension into Jokosher; the user can now start
up and use anything that the extension can do. (Since this little discussion
is about how to write Jokosher extensions, we won’t discuss how exactly the
extension talks to Freesound. Just take it as read.) The part that’s left is:
how do you get samples from the extension into your project itself?

The way the user does it is to drag a sample from the extension window onto
an instrument in Jokosher. Now, Jokosher understands dragged-and-dropped files;
you can drag a music clip from Nautilus or from Firefox or from any other
application straight onto a Jokosher instrument and it’ll work. So the
Freesound extension just has to know how to allow users to drag things from it.
Technically, this is called being a drag source. How to do this in Python
is described in the PyGtk Tutorial — basically, you use
code something like this:


e.drag_source_set(gtk.gdk.BUTTON1_MASK, [('text/plain',0,88)],gtk.gdk.ACTION_COPY)

e.connect("drag_data_get", self.returndata, sample)

...

def returndata(self, widget, drag_context, selection_data, info, time, sample):

	selection_data.set (selection_data.target,8, sample.previewURL)

where “e” in the first snippet is the widget displaying the sample, and
“sample” is our actual Sample object which we’ve created from the FreeSound
XML. In essence, the Freesound extension works like Firefox; when you drag
a sample to a Jokosher instrument, Jokosher says “what’s this thing you’ve
dragged to me?” and the extension says “it is a URL at Freesound”; Jokosher
then thinks “aha, I know how to load URLs”, and loads the sample from that
URL.

This is a good example of how working with the Jokosher team can be important
for extensions. Jokosher didn’t, when I started writing it, know how to load
a sample from a URL (it only knew how to load one from your hard drive). To
make it work, that needed to be added to Jokosher. (In this case, I added it
myself, because I’m a Jokosher developer, but if I wasn’t then the team would
have happily added it for me.) The Extension API, the way that extensions talk
to Jokosher, deliberately isn’t complete; we’ve put the infrastructure in place
but we haven’t tried to think up everything that everyone would want to do.
Instead, if you’re writing an extension and you realise that you need Jokosher
to be able to do something that it currently can’t for your extension to work,
talk to us: we’ll add that extra part to Jokosher so that your extension works.

This has been a relatively brief summary of writing a Jokosher extension, but
hopefully it’ll give you some ideas. Now you can get extending!

Quick Jackfield update

Not much news on Jackfield at the moment, because I’ve been highly tied up with Jokosher and a few other things, but I thought I ought to note that I’m aware that people want to see it. I was actually quite surprised; most people who expressed a preference either by mail or by comment as to what they’d like to see me talk about at SkyCon said Jackfield. At the moment, I’m trying to get it to work across different D-Bus versions, which is fiddly and awkward.

I’ve also been nudged about integrating it with Beryl. I like the idea of this, but I can’t do that work; I don’t have accelerated 3D, so no compiz or beryl for me. If someone else wants to look at that I’d be quite happy to talk about how I see the integration working, but making Jackfield operate properly with software I don’t have isn’t all that high on my priority list :-)