Better help text with argparse

Way back in 2011, I built a small application to build a Transitioning Background XML which could then be fed into Gnome 2 so that I could distract myself with a constantly changing background. This worked well enough and achieved what I wanted – an easy way to rebuild the XML every time I wanted to add some more photos. It didn’t provide any help text, though, which is something I kept meaning to sort out.

And then Gnome 3 came along and everything changed.

I have now gotten around to looking at Macsen’s Transitioning Background again and have finally found the time to replace getopt with argparse. What that means in English is that if you type mtb -h, you will see this:

usage: mtb.py [-h] [-p PATH] [-s STATIC] [-t TRANSITION]

Create a transitioning background XML for Gnome 2

optional arguments:
-h, --help show this help message and exit
-p PATH, --path PATH Set path for images and XML
-s STATIC, --static STATIC
Set static time in seconds
-t TRANSITION, --transition TRANSITION
Set transiton time in seconds

As ever, all of the source can be found on GitHub.

Laptoptastic

Yesterday I ordered a new Laptop and today my Samsung NP300E7A-A02NL turned up. I wasn’t originally planning to blog the entire set-up process, but I did have a few initial thoughts and thought I might as well jot them down while I wait for the backup of my old laptop to finish.

First Impressions

It’s surprisingly light. With a 17.3 inch screen this is very much a desktop replacement and not a machine that I expect to be lugging around so I was a little surprised at how light it was when I pulled it out of the box (compared to my Dell Inspiron, which also has a 17.3 inch screen).

The laptop comes with Windows 7 pre-installed and – this time around – I am planning to keep a Windows partition. This is entirely because of the limitations of the Belgian online tax returns service, but that’s a rant for another time. One thing that did impress me when I initially booted into Windows – and I don’t know if this is a Microsoft or a Samsung thing – is that it promptly asked me if I wanted to partition my disk. It’s a nice touch, even if I did launch the Disk Management application (type Disk Management in the search box in the Start Menu) to delete the newly created D: drive and create a nice big chunk of free space.

I am less enthusiastic about the keyboard. The keyboard and the number pad are the chiclet (separated keys) style and the keys don’t travel as well as I am used to. As someone whose typing stye normally involves battering the keyboard into sbubmission, the lack of travel felt a litle uncomfortable. It’s early days yet, but this keyboard is going to take some getting used to.

Installing Sabayon

So in goes the previously prepared USB stick, reboot, press F2 to access the BIOS, and I’m in the Sabayon 8 live environment. It’s a painless process but I do like the reassurance of being able to check everything works before I hit the install button. And since I am typing this from part of the post from within the live environment, I think it’s time to start the install.

And we’re in.

I am increasingly impressed with the Anaconda installer. It recognised that there was unused space on the hard drive (I knew it was worth deleting the D: drive I created under Windows) so I was able to just accept the defaults, hit go and take the dog for a walk.

I did encounter one problem though. Once the install was complete, booting into Sabayon failed with the following message:

Block device /dev/mapper/vg_barbarella-lv_root is not a valid root device
Could not find the root device in .

This, it appears, is a problem with the bootloader install and is easily fixed by putting the USB stick back in the laptop and reinstalling the bootloader.

Sabayon 8

One of the things with using a rolling release distro is that you don’t realise quite how far your setup has diverged from the default until you come to do a fresh install on all new hardware. The biggest change I’ve noticed is that the default repository is now sabayon-weekly.

This repository was launched a year ago and is updated only once a week. What you lose in getting everything right now with this repository, you will gain in stability – that’s the theory anyway. I’ve left this set-up as it is for now but may go back to the main (all shiny, all the time) repository at some point in the future.

The Sabayon team also appears to have dropped Firefox from their default install in favour of Chromium. So I have installed Firefox and applied the Sabayon Chrome theme. Maybe it’s just me, but I do find the default Chromium theme to be quite an ugly affair.

I’m also a big fan of the Gnome desktop environment. I do like the direction the Gnome team are taking with Gnome 3, so once my preferred packages were installed, I untweaked all of the Sabayon tweaks and put the clock back in the centre of the system bar, because that’s where it belongs.

And finally

All of my data and all of my settings are currently sitting on an external hard drive. And now I am going to restore them. I won’t bore you with the details. Instead, I shall hit the Publish button on this post and then open a whisky while the restore completes.

Sabayon 8: It’s here

My Linux distro of choice has just hit another release milestone.

More busy than busy bees, we’re once again here to announce the immediate availability of Sabayon 8 in all of its tier-1 flavours. If you really enjoyed Sabayon 7, this is just another step towards World domination.
Letting bleeding edge and reliability to coexist is the most outstanding challenge our users, our team, is faced every day.

There you have it, shining at full bright, for your home computer, your laptop and your home servers.

Linux 3.2, GNOME 3.2.2, KDE 4.7.4 (4.8.0 available in testing repo), Xfce 4.8, LibreOffice 3.4.4 are just some of the things you will find inside the box.

During this cycle, we spent a lot of time optimizing critical packages at compiler level, ensuring unprecedented performances, tuning system responsivity under load and backporting power management patches.

What you find here is Sabayon GNOME, KDE, Xfce, SpinBase (bare-metal flavour for building your own ISO images), ServerBase (same but with server-optimized kernel) and CoreCDX, for those liking Fluxbox.

Of course, with Sabayon being a rolling release, I don’t need to do anything beyond my regular updates to reach the next release. And this is one of the reasons that I love using Sabayon. The developers have done a great job of building a distro that delivers all of the latest and greatest software, direct to my desktop, with pretty much no effort needed on my part at all.

If you are a time-poor geek who likes having the latest shiny, it really is the best of the best.

I’m also very happy to see that, while Cinnamon is in the repositories, my desktop will continue to default to the latest release of GNOME 3. Not that changing from one desktop environment to another is difficult, or even time-consuming, but I do like the elegance of GNOME 3, and the fact that it is so relentlessly focussed on actually getting stuff done.

Cleaning up some code

It was in the middle of last year that I implemented what I rather ambitiously referred to as a wallpaper switcher for Gnome 2. What Macsen’s Transitioning Background does is generate an XML file based on the images in a selected folder and then let the Gnome background switcher handle the rest.

With the switch to Gnome 3 this functionality is no longer supported. At least, not as far as I can tell.

I do still like the idea of using an XML file to control the background and have been toying with the idea of knocking together myself. As a first step towards this, I have tidied up some of the code.

The latest version of the source can be found on GitHub. The generated XML can be used to power a transitioning background in Gnome 2 and – if I ever find the time – I will start knocking together something that will work under Gnome 3.

Gnome 3: Taking off the training wheels

When Gnome 3 was released I have to admit to being less than enthusiastic. So much so, after trying out a live USB, that I was seriously expecting to end up switching to XFCE. However, having used it fore a little over two weeks, my opinion has rapidly changed. It is true that the Gnome 3 desktop attempts to impose a new workflow but, going with it, I have found that dividing tasks across different workspaces does allow me to focus far more on the task at hand. This brings me to the point of this post.

Much electronic ink has already been spilled over the question of minimise and maximise but the shorter version is that the Gnome team wants people to organise tasks by workspace and not by having lots of minimised windows. Fortunately, you can switch these buttons back on and I was quite pleased to discover that the Sabayon implementation does this by default. This made the transition to Gnome 3 a lot less painful than it could have been.

Now, however, I find that I really don’t use these buttons any more. So, with a strong feeling of removing the training wheels, off they go.

I really do like the way that Gnome 3 has been designed. The UI is polished, works well and stays out of the way when you don’t need it. It is also notable, for a desktop environment, just how little I find myself needing to use the mouse.

It’s not perfect and there is is still a way to go, but so far I am finding it to be a polished and very productive desktop environment.

Gnome 3: Initial Impressions

It was back in April that the Gnome developers announced the official release of Gnome 3. This was a significant redesign of the open source desktop environment and one about which much electronic ink has been spilled.

When the release was announced, I downloaded an OpenSUSE live USB to take a look and, while I could see what the Gnome team were trying to do, I also felt that they were solving problems that I didn’t have. I wasn’t particularly opposed to the changes but nor was I in any great hurry to install them on my main laptop. So I took a wait and see approach, deciding that I would wait for Gnome 3 to be implemented on my distro of choice before attempting to use it in production.

Yesterday, the Gnome 3 packages were released for Sabayon.

It is impossible to evaluate a completed desktop environment in less that two days, and I am not going to try. What I will do is stick with Gnome 3 for a month and see how well it works for me. I have to say, though, that I am finding the switch a lot easier than I expected. This ease of transition is being helped in no small part by tweaks like this one.

Macsen’s Transitioning Background: An XML powered wallpaper switcher for Gnome 2

While on holiday last month, my four-year-old son got hold of my camera and started taking photos. Lots of photos, some of which were quite good. Being the proud father that I am, I decided I wanted my desktop background to rotate through some of these photos.

This is very easy to achieve with Gnome 2 – and is implemented in the Cosmos transitioning wallpaper. So on the Monday, I copied a bunch of resized photos into a folder under /usr/share/backgrounds, copied the XML file that powers Cosmos into the same folder, tweaked it, and was rather pleased to find my desktop wallpaper smoothly transitioning from one photo to the next.

On Tuesday, I added a few more photos and amended the XML file accordingly. By Wednesday, I was bored of manually editing the XML and started thinking about how best to automate this.

I have finally found a bit of time to do something about this and am now ready to release version 0.1 of Macsen’s Transitioning Background.

It’s probably not the most elegant solution (there is a lot of copying and pasting going on in the build() function) and the resulting XML file is not pretty. But it works.

You can find a tarball and some instructions on the MTB Project Page or browse the source at GitHub.

The joy of Xfce

Six months ago, I mentioned the creakiness of my desktop PC and rambled a bit about the various steps I’d taken to keep the memory usage under control. I have done a little more tinkering recently, so now is as good a time as any to ramble some more.

First of all, a disclaimer. I do understand that the best approach would be to either start from a minimal install and build up only what I want, or to find a lighter distro in the first place. The reason I haven’t done this is because my desktop hardware is not as reliable as it could be. This is especially true of the CD/DVD drive. Consequently, I don’t want to install anything from scratch because, if the drive does fail halfway through an install, recovering it will be a nightmare. And I have no intention of replacing any of the hardware on this machine – it is an old box and no longer my primary device so I simply want to ensure that it remains responsive until such time as the hardware fails completely.

I have been a Gnome user since I started using Linux on the desktop and, for me, the huge strength of Gnome has always been that it is an incredibly intuitive desktop to use. However, all this functionality comes at a price in terms of the system resources used, so I started looking at lighter desktop environments.

My first thought was to give Enlightenment a go. There was a very long blog post about this that has now been deleted but the shorter version is that once you start finding your way around, it’s a very nice environment and one that appeals to the minimalist in me. However, it’s not the most intuitive desktop environment I’ve seen and, bearing in mind that the PC has a guest account for when people come to visit, Enlightenment is not the way to go.

So I had a look at Xfce. It’s lovely.

The default theme is every bit as intuitive as Gnome and this is the theme (largely untouched) that the guest account still uses. Things started to become interesting, however, when I started playing around with the Xfce Settings Manager. Not only are the panels very configurable, but Xfce also allows you to do a lot with the right and middle mouse buttons, so I started seeing how much desktop real estate I could free up.

This is the state of my desktop so far.

The Xfce button and notification area are in the top left. In the bottom left – although the auto-hide means you can’t see it – is the task list and wastebasket. In the bottom right is the workspace switcher, which I am thinking about removing since I can access the same functionality by using the middle mouse button. I am also considering having a single, auto hiding, panel in the bottom left of the screen to maximise my available desktop space.

And then there is the cornucopia of options at Xfce-Look.org.

Of course, none of this matters (much) if it doesn’t achieve the primary aim of squeezing a bit of extra performance out of the desktop PC. Fortunately it does, spectacularly. The PC is noticeably more responsive and, according to the System Monitor, the Xfce components are sucking up a lot less memory than the Gnome equivalents.

In other news, I have replaced Epiphany with Midori and uninstalled Mono.

I have looked at Midori in the past, but Epiphany is the browser I keep coming back to. I have found it to be both fast and light and it has the best approach to managing bookmarks that I have encountered to date.

Midori, like Epiphany, is a WebKit browser and it is also fast and responsive. It is also part of the Xfce Goodies component so I thought I’d give it another go. I won’t try to make any speed comparisons, but I have been impressed so far.

As for Mono, I don’t use any of the few, small applications on my PC that depend on it and – quite frankly – having to start the Mono runtime just to launch Tomboy Notes feels like overkill to me. I am intending to try and find some smaller, lighter applications for the PC and Mono is the first to go.

I installed Xfce last weekend but it hasn’t been until this weekend that I have really had a chance to play around with it. What I’ve seen of it so far is fast, flexible and a real joy to use.