Xmonad: More Cool Functionality and How It Was Achieved.

I’ve written a few times about my Xmonad configuration, and what I am doing using this unusual window manager.

If you haven’t read my previous posts then here is a quick summary:

  • Xmonad is a tiling window manager. This means that when you first launch a program it launches ‘full screen’ (minimise and maximise buttons are completely ineffectual). When you open a second program on a  screen then the new program gets 50% of the screen and the original program gets shrunk to 50% to. Adding further programs gives each progressive program less space, but the windows are all tiled together.
  • I took my configuration from the internet. It is something I plan to investigate and customise myself in future, but for now it works well.
  • Xmonad is written in Haskell which means that it has lead to me discovering a type of programming that I had no idea existed. I intend to look into this and blog about it in the future.

So I started to use Xmonad. Now I like to have a certain amount of things launch when I first log in, but I was finding it difficult to trigger these in Xmonad. The advice I found on line seemed to point to one of two ways of achieving these auto-starts, but neither approach appeared to work for me (another thing I will revisit at some point!). Amongst the things I wanted to happen were:

  • Switch to the Dvorak keyboard layout (British version with UK punctuation).
  • Swap the left hand ‘Ctrl’ and ‘Caps Lock’ keys. This is a customisation popular among Emacs users (Ctrl is an important key in Emacs) as it moves the Ctrl key onto the ‘home’ row of the keyboard.
  • Start the Emacs daemon in the background. This means that all of the initialisation files are pre-loaded, and an Emacs terminal can be started quickly.
  • Start the Dropbox daemon to update the local copies of any files to match those of the ‘cloud’ storage.
  • Start conky, the desktop monitoring app. My work configuration for conky is so extensive that it is split into three separate files which load at intervals.
  • Start the screensaver.

I have decided to do all of these things using a simple bash script. This way I don’t have to remember the complicated bit (the full command for setting the keyboard layout is the tricky bit), and I only have to run one very simple command.

There are currently a couple of minor issues that have arisen, and which needs a little bit more work, but things are going in the right direction.

  1. On my work machine the conky startup actually runs a script that then runs three separate instances of conky, each with a different configuration file, and in a different location. The three instances start up with a delay of 20 seconds each. Launching a program before this process is complete can end up leaving the output of conky ‘overlaying’ the window. Mostly this is an aesthetic issue, but it also means that at times I can’t reach the desktop to click on a button because conky is in the way.
  2. I have a folder which is configured so that scripts which are placed in it can be called just by typing their name. I am planning to make this folder a part of my ‘Dropbox’ configuration. Then I can have the script made universal across my various machines. There are some issues that will need to be addressed before this happens. These include the fact that I am using a different approach to managing the desktop wallpaper on my home machine to the approach I have for my work machine.
  3. I want to change the keyboard customisation for Xmonad. On my laptop I need to press a separate key to select the function keys (F1-F12). As these keys are used in combination with Alt and the ‘modifier’ key in Xmonad I have to press three keys to switch desktops. I plan to change the ‘desktop select’ to address this issue.



2013 Book Report 16: Rip It Up – Richard Wiseman.

Professor Richard Wiseman is a psychologist. In fact, in Britiain, he is almost the media’s ‘go to’ psychologist, especially for the more ‘wacky’ parts of the field. And the wonderful thing about psychology is that there is a lot of wacky to be had!

This isn’t the first book of Richard Wiseman’s that I have read, and in many ways it acts as a follow up to the previous book ’59 Seconds’. The first book had been written as a sort of response to all those advice books which aim to impart their message in tiny aliquots of time. The idea, presumably being that it would appeal to people who are so busy that they can only spare moments at a time to gain new knowledge. The difference with the Wiseman take on these books was that everything was based on proper psychological research.

“Rip It Up” is a continuation of that approach, using ‘proper’ science to provide ‘self-help’ type advice, much of which runs contrary to the popular ideas. Central to this guidance is the research that shows that if you make your body behave in specific ways then your mind will start to act as if you are thinking and feeling that way.

At its simplest, if you wear a smile on your face you start to feel happier. The research that led to this conclusion involved asking people to grip pencils in their mouths, specifying whether the pencil was held between the teeth or the lips, and by one end, or lengthways. But the outcome is quite clear. Making the face form a grin will cause an increase in positive feelings.

The same sort of process means you can make yourself feel more determined by clenching your fists in a determined manner.

The central thesis of the book therefore is that the mind-body connection is a bi-directional thing. Your brain can make your body do things, but your body can make your brain do things to, and with the knowledge that you can influence your thinking in this way it is possible to change the way you feel and perform every day.

And once again, because this is psychology, and not positive mental attitude snake oil Wiseman is able to cite the studies that show that the changes work.

It is worth noting that one of the studies cited is by Simone Schall, one of my academic colleagues here at the University.

Project Gutenberg: Sticking it to the man.

In my last post I urged anyone intent on reading ‘The Secret Adversary’ to head over to Project Gutenberg to get a copy for free.

Of course, it isn’t absolutely free, someone is paying for bandwidth, storage and the like. If you find that Project Gutenberg is a service that you use then you might think about making a donation to their upkeep.

The subject of copyright is one fraught with difficulties. A lady I know on Facebook has just published her third novel of a series. The books have been well received, and she is, understandably very pleased with how things have gone. But within a couple of days of the books launch she found messages asking for ‘cracked’ copies of the e-book of the novel. This isn’t a rich author, but a lady working hard to put her heart and soul into something that the public will want to read. And having managed to (a) write her story so well that it has a willing audience and (b) managed to get it published, she now has to hope that the majority of people who want to read it will purchase a copy to make it all worthwhile.

I am conflicted. I believe very strongly that artists both deserve and need to be suitably recompensed for the work that they put into their creations. The call for an illegal copy is reprehensible. But there should be a limit on the extent of copyright. Copyright is intended to ensure that both authors and the wider cultural space are enriched by artistic creativity. For a period of time the control of all works stays with the author (or their representative). The author will receive payment for the instances sold. This is as it should be. More power to those who represent this model. But when copyright comes to an end (a point which in America recedes at approximately one year per year, essentially making copyright for the last 50 years ‘in perpetuity’) then the work should enter the public space where it will help to enrich our cultural heritage.

The issue is complicated by the change to the nature of ownership which is inherent in the e-book reader ecosystem which currently holds sway. At the moment when you ‘buy’ a book from Amazon for your Kindle you don’t actually own it. You essentially license it, an agreement which can be revoked unilaterally by Amazon, seemingly with little in the way of redress or appeal.

And at the end of the day this is my real conflict. I love my Kindle. I really do. I love how you can readily carry around tens of books in a slim electronic device which supports searching, bookmarking and dictionary lookup. But I do worry about the power of corporations to modify the very nature of ownership.

2013 Book Report 15: The Secret Adversary – Agatha Christie.

Agatha Christie is best known for her murder mysteries starring characters such as Miss Marple and Poirot. The Secret Adversary feels therefore like a change of direction and of form. The story revolves around a young man and woman who, suddenly unemployed after the war set up a venture offering themselves up for any job required of them.

They are contacted and soon find themselves involved in international espionage including Bolsheviks and spies.

The story twists and turns, with frequent ‘aha’ moments, liberal red herrings and intrigue, all handled with supreme skill by the author.

I won’t try and distil the story here. My memory of the events of the narrative would not do it justice, and I would be unable to avoid spoilers which would be a shame. I recommend this book heartily. It is a real page turner, with twists which avoid feeling contrived or engineered.

In an ideal world Dan Brown would be kept away from a word processor until he had read this book several times and could indicate the lessons that he had learned from doing so.

Clue: ‘With a single bound Jack was free’ is not a plot device worthy of the reading public!

If you are in the market for reading this on your Kindle then head over to Project Gutenberg where they have it available free. My favourite price for a classic.

Cyanogenmod – Success, Followed by Stress, Then Success Again.

It started with a geeky chat in a phone shop. My other half wanted to upgrade her iPhone 3 to a newer model, so we went off to see a nice man in a shop.

I had recently changed my phone, and was newly re-enamoured of all things Android, but went along to act as technical advisor in case the questions got a bit too technical.

I was pleasantly surprised that the sales guy had the ability to walk that line between customer service and technical nouse, and we had a good chat. I ended up telling him that I had an iPod, but that it was hacked to run Rockbox (so that I could play ogg media files), and that my Kindle was hacked so that I could add my own screensavers. He then asked me if I had installed an alternative Android build on my phone.

At the time I baulked at the idea. My phone was still very new, and I was basking in the speed increase that I had enjoyed moving to my Samsung Galaxy SII. The idea of risking bricking it (however minor that risk was) meant that I wasn’t going to risk it.

But that was then, and now, I have got used to my phone, and, in all honesty, it was beginning to feel a little sluggish. It was time to look at the alternatives.

The suggestion from the phone shop guy and his erstwhile colleagues was Cyanogenmod. This seems to be a popular Android build, well supported on my Galaxy SII and with a busy community forum which would prove useful if I ran into any problems. I followed various bits of instructions, but most of them came from the Cyanogenmod site itself. There aren’t any releases which are marked as Stable at the moment (a fact which almost caused me to abandon the whole idea), but the release candidates are popular, and reported to be pretty stable.

The process takes a couple of stages (full instructions here):

  1. Download ClockworkMod Recovery and Heimdall Suite and install them on your computer. These programs are available in Windows, Mac and Linux versions, but obviously I was using the Linux version in my case.
  2. Turn off the phone, connect it to your comuter via USB, then turn it on in download mode (this involves holding your phone in a Vulcan death grip!)
  3. Install the kernel zImage using heimdall (see the wiki instructions for the full command). I had to use the 32-bit version as the 64-bit one wouldn’t work for me.
  4. Reboot the phone into clockwork recovery mode using a different Vulcan death grip.
  5. Copy the Cyanogenmod code to the phones SD card. If I do this again I will make sure that I also copy over the ‘gapps’ programs at the same time. These provide the core Google Apps, and are very useful in getting the phone back up and running properly.
  6. Boot the phone to the Recovery mode (Vulcan Death Grip!)
  7. Select ‘install from the SD card’ to install the new software.
  8. Reboot and enjoy your new installation.


Most of this process went without a hitch. However, when I booted the phone I found that the SD card was unreadable. This had a number of knock on effects. The most obvious was the extremely limited functionality that the phone had at this point. Things like the camera refusing to work because there was nowhere to save the files. It also meant I couldn’t install the gaps software. When I tried to use the Google Play site to install apps I was unable to do so. Partly because there was no place to store them, and partly because the Play website was of the belief that they were already installed.

The solution was to reboot the phone into Clockwork Recovery Mode and then format the SD card. This wasn’t a problem as all the contacts information was stored in my Google account, and all the photographs and videos are uploaded to my Dropbox.

Once I had done this the SD card was accessible, and could be used to install gaps. Another ‘normal’ reboot and a Google login later the phone recovered all my contacts, and the Google Play app was making it easy to re-install all my other apps.

I have been selective about what apps I install. I haven’t played ‘Stupid Zombies’ for ages, so that doesn’t get a re-install, things like that.

But I did hit a bit of a snag, which took me a little while to circumvent.

Authentically Awkward.

As I log into a lot of different websites, and I also lecture users on their user security, it is beholden on me to use best practise in terms of security. I have strived to use different passwords on different sites, and I do this with the help of a password manager. I use an online manager as I am often on different computers, and on different platforms. My single password for the manager is long, and secure, but as this is an obvious possible vulnerability in my security setup, I have configured a two-stage authentication using Google Authenticator. I will write about this in another post, but for the time being, its an app that runs on my phone and gives a new six digit code every thirty seconds. This is synced with the sites that are protected in this way.

Unfortunately, when I had to reinstall Google authenticator there were lots of hoops to leap through to get it working again.

The password manager required me to disable the two stage authentication, then sign in and re-enable it from scratch. WordPress required me to email them and get a reset code. And as for Dropbox’s website? I’m still working on that. Fortunately Dropbox is still working as a service, but I can’t log on to the website as things stand!


The whole process has been pretty straightforward, and early indications are that the phone feels fresh and sprightly again. How much of that is down to a clearing down of the installed apps I’m not sure yet, but time will tell. The customisations are a little different, and I’m still working them all out. But I’ll get there, and in the meantime, it is happily functioning as a phone, and, most importantly, as far as my daughter is concerned, the YouTube app is back in place, and she can watch videos.

‘Your’ Member of Parliament – A Quick Guide.

Recently I did something that I have never done before. I got in touch with my local MP.

I was initially driven to do so by the announcement that the ‘independent’ body which had been formed to set MP’s pay rises was going to recommend a pay rise in the order of £7000-10000 per annum after the next general election. BBC Article

I was so disgusted by the idea that this might take place (the backlash was furious at the time, and party leaders have already disowned the idea entirely, knowing that to do otherwise is likely to be electoral suicide), that I decided to drop my chosen representative a line to voice my opinion.

I like to think that I was as balanced and measured as I could possibly be. Rather than challenging the value of our politicians I asked whether he felt that the increase was justifiable.  I wanted to know whether a job which has longer breaks than higher education students (students often only have classes for 24-30 weeks in a year, depending on their institution) deserved a pay packet so much higher than the average in the population.

The final point that I chose to make was regarding the number of politicians who have other jobs. These other ‘jobs’ are usually in the form of non-executive directorships in companies. The problem that I, and most people have with such roles is fundamentally the conflict of interest that they are likely to represent. Politicians have directorships in private health care companies, but are still able to vote on legislation which helps nudge us ever closer to privatisation of our health care system. They have directorships in arms companies who benefit from the waging of poorly defined wars of aggression, sales to dictatorships and tyrants and stockpiling of weapons that we will never be able to use but which costs us each mind boggling amounts of money.

I was warned when I had sent my message to my local MP that he was a very busy man and I may have to wait a while for a reply. However, I was impressed at just how quick his reply was. Only a couple of days later I got an email.

Unfortunately, the answer was the sort of mealy mouthed nonsense that I should have expected. The pay rise wasn’t one that MPs had decided for themselves, so it wasn’t their fault. And they hadn’t had a pay rise for a couple of years. But there is a mechanism for letting the powers that be know if we didn’t like the idea (he pointed me in the right direction).

He had nothing to say about whether the rise was deserved (the question that I had asked).

On the subject of second jobs, he wanted me to know that there are no plans to privatise the NHS. The fact that Hinchingbrooke hospital has been privatised already seemingly having escaped his notice.

The unfortunate thing is that I know that in my part of the world, the politician with the blue rosette is, in all likelihood going to win. My anger at his complacency, the lack of a real, substantive response to questions of exactly who our politicians represent are not going to overturn the sort of majority he gets in a semi-rural, largely affluent southern county.

It is worth noting that it is cathartic writing these messages though, so I may do so again in the future. And as my MP has announced he will be standing down at the next election I will have to make sure I let my feelings be known to his successor!

2013 Book Report 14: Getting Things Done – David Allen.

One of my failings in life is that I don’t have a grand vision. It is one of the reasons that I really like my job. I don’t have a task master at my back, I get stuff done, but I do it in my own way.

But I am also very conscious that I could be more affective, more pro-active and get further. So hence my interest in this book.

Allen’s idea is pretty simple, and to a certain extent everyone who is busy does some of the things that he suggests already.

The big one is making lists. Rather than try and retain in your head the stuff that you want to get done, write it down in a safe place. The point of this is that you only have so much attention, so much brain power at your disposal, so you should make sure that you make the most of the power that you have by delegating those jobs that can best be done by other systems. Once you have your list you can work from it.

There is a great deal of consideration given to how you might prioritise various tasks. The prioritising can take many forms. Obviously, if there is a task that you have to do, but which you need to be elsewhere to do it, then it may be better to identify other tasks that require you to be at that location and then do several tasks in a single visit.

There may be some tasks which can be considered ‘quick wins’ which will only take a handful of minutes to achieve, give yourself a boost, get them done and off your list etc.

The thing that really differentiates this approach is that it is intended to be useful for much bigger tasks as well as these day to day ones.

It asks you questions about the big things that you want to get achieved in your life. It offers the opportunity to think big, and then offers schemes to begin to make these things a possibility.

The approach that is proffered is to take the big projects and begin to break them down into smaller units. For each sub-unit consider how long it would take to achieve the job, and then, if appropriate, break it down into further smaller sections. The aim is to have a list of actions, none of which is so daunting, or so huge that you can’t see your way to getting it achieved.

Even as I write this entry, I feel enthused by the idea that this book presents. It makes the seemingly impossible feel like it is manageable. That is, I guess, the magic of a book like this. When it is well written it makes you feel like, with a little application you can turn your hand to being better at what you do. Maybe I will start implementing more of the actions in the future.

It is also worth adding that the reason I became interested in GTD as a philosophy is that there is quite a lot of functionality built into some Emacs plugins which support this behaviour. My interest is still intimately bound to being able to use Emacs as my GTD tool of choice.

Books like this aren’t really a ‘read once’ proposition. While the ideas are simple, applying them, getting the most out of them is a much longer prospect. But I know that this book inspires me in ways that I still don’t appreciate. This is especially interesting because I look forward to freeing up time to do fun stuff. The idea is to create a space for yourself. Sounds good to me.