Internet of things

Many years ago, back when I was still writing software for a living, I was involved in creating some software that is now called WebSphere MQ. This was designed to integrate different types of software and systems together, easily and without disruption. I always used to describe it as email for programs. Over time that whole concept was refined and extended, and the basic concepts are now used as the basic building blocks for what is often called the internet of things. This a concept where sensors and actuators are connected together (usually via the internet) so they can be more easily accessed. IBM’s Smarter Planet theme takes these sensors and actuators, and applies intelligence to them, allowing us to gain incremental benefits sometimes even in unexpected areas.

For a long time now I’ve been monitoring various sensors around my home, connecting them to my own internal data network, where I’ve been able to process the output of these sensors in various ways. I’ve been doing this using a protocol called MQTT, implemented on a very simple server, called Real Small Message Broker (RSMB) which was written by a colleague of mine. This has worked really well for my needs, and being designed for embedded use, requires practically no resources to run.

However, some time ago a service become available on the Internet called Pachube (now renamed to Cosm), which is essentially a central clearing house to which anyone can publicly connect and classify their sensors, creating a potentially huge number of datafeeds. These can then be aggregated, selected and reused by other people, giving individuals access to untold numbers of sensors, allowing them to create innovative new services that eventually others will then build further services on. It’s a great concept that I wanted to contribute to. Initially, as a trial, I decided to share the temperature feed from my home office with the world.

To achieve that, I did the following:

  1. Created an account on Cosm.
  2. Defined a datafeed, which I named (“Study Temperature”), tagged with appropriate metadata (“physical”, “temperature”, etc)
  3. I then created and named a datastream to be associated with that datafeed, consisting of a set of single data points (namely the temperature in my study).
  4. I then created an API key to provide access to that datafeed. Normally you would limit the permissions associated with that key, but because of the way I intended to use it, I created a key that would grant complete access to all my Cosm resources.
  5. Since I am already capturing the temperature in my study and feeding it into the RSMB on my home server, I just needed to share that data with Cosm, which I was able to do by connecting my RSMB to Cosm with a Broker Connection, and some topic replication. See this post by Nicholas O’Leary, another colleague, who describes exactly how to do this. Note also my comments, where I conclusively prove that RSMB cannot do name resolution – you can only use dotted-quad IP addresses.
  6. Once the broker.cfg file has been saved, and the RSMB restarted, you should see data starting to arrive in Cosm.

At this point, I added a little icing to the cake. I could see that I was now sharing information to the world via Cosm, but Cosm also integrates with some other services on the internet, which together can be made to give some value back to me. In particular, we experience occasional power outages at our house, and I would like to know as soon as possible if our power has gone out so that (if necessary) I can call our key-holder and get them to flip the power back on and save the contents of our freezers.

Since I now have a permanent connection between my home server and the Cosm servers, I can use a feature of RSMB called notifications. When enabled, this publishes a message to a predefined topic on each broker describing the state of the connection between them. Essentially once a connection is established it writes “the connection is up” to that topic, and each broker tells the other ‘if you lose contact with me, write “the connection is down”‘ to that topic. This means Cosm can have a datastream whose content describes the current status of the connection between my house and Cosm.

So next I use the Cosm web GUI to define another Cosm datastream and datafeed for these notifications.

By then adding a Cosm trigger to that datastream, I can arrange to send a Tweet from Cosm to an account on Twitter. Simplistically I could simply get Cosm to send a Tweet to me. But in practice I have a separate Twitter account for my house (everyone has a twittering house these days) and so I get Cosm to send a Tweet to that account.

Note that when using the Cosm web interface to define the twitter trigger, the results under Firefox were so badly formatted as to not be usable. I swapped to Google’s Chromium browser instead, from which it was possible to actually get the trigger defined and working.

My Twitter account both follows my house’s Twitter account, and has arranged for Tweets from my house’s account to be enabled for mobile notifications (ie, they are sent, at no cost, to my mobile phone as SMS messages).

Finally, I update my RSMB broker.cfg configuration to enable notifications and name the notification topic, and restart RSMB.

What this means in practice is that whenever the connection between my house and Cosm changes (coming up or going down) a message is published to a Cosm datafeed, which triggers Cosm to send a Tweet to my houses Twitter feed, which then shows up on my Twitter feed, and also causes Twitter to send me a mobile notification (an SMS message to my mobile phone) containing the message that was originally written to the Cosm datafeed. From that SMS message I can tell (from anywhere in the world) when a power failure occurs at my house, and when it has been recovered.

Easy 🙂

Just for reference, if you want to replicate this, here is my broker.cfg. Be aware that it will be line-wrapped:

#
retained_persistence true
#
connection cosm
try_private false
address 216.52.233.121 1883
username MRxxxxxxxxxxxAPI_KEYxxxxxxxxxxxxxxxxxxxxxxxx0g
clientid rmappleby
notifications true
notification_topic /v2/feeds/63101/datastreams/0.csv
topic “” out house/temperature/study /v2/feeds/63014/datastreams/0.csv
#

New KVM Option

The Edimax KVM will hopefully be on its way back to Amazon on Monday.

Extracting all the leads that I had pre-routed through the trunking behind my new built-in desk was a lot harder than I expected. This was largely because I’d run the wires through the trunking, and then attached the trunking to the wall/desk. Getting them back out without removing the trunking from the wall was not trivial. About an hour into the process I was really starting to regret (a lot) that I’d not tested the KVM before running all the cables. Needless to say, I won’t make that mistake again.

Speaking of which, the new KVM is now on it’s way.

This time I did a LOT more checking of the specifications and reviews before making my selection. Fundamentally my basic needs hadn’t changed, but this time I was a lot more aware of the subtle differences in the manufacturers descriptions of the units. It’s very clear that at the cheaper end of the market most of the manufacturers take one of a couple of old reference designs, and repackage & rebadge them. These wouldn’t support my needs. The key additional criteria I looked for this time was mention of support for laptops, and specifically support for Windows 7.

Windows 7 support is essential because it indicates a KVM that has full support for EDID emulation, which (I believe) is probably also a requirement for the newer Linux desktop environments such as Unity and Gnome Shell. I’m now pretty sure that this is where the Edimax fell short.

In the end, the two cheapest devices that did everything I needed seem to be the ATEN CS64U, and the IOGEAR GCS1804. The IOGEAR is the fuller featured device, with detachable leads etc, but it’s difficult to source in the UK, and comes with a £140 price point. Whereas the ATEN is a bit more restricted (no OSD for example), but is available from Amazon for only £40.

That made the decision trivial.

KVM options

I’ve been totally “back to the concrete” refitting my study over the last couple of months (things like this take longer at the moment!) and one of the things I wanted was to add a 4-port KVM to allow me to hook my laptops and key servers to a single common screen, keyboard and mouse.

In the end I decided a USB-based device was best for future-proofing, and would support all my existing systems once I’d fiddled a little with their BIOS settings. So I opted for the Edimax EK-UAK4, as it was on offer from Amazon, and had good reviews.

Sadly, despite support for Linux, hot-swapping etc etc, it turns out that Edimax don’t support laptops. Go figure. And actually, “don’t support” means “doesn’t work”. Which means that it’s no use to me at all. Thank goodness for Amazon’s impressive returns policy.

So now I’m looking for suggestions for a USB 4-port KVM that works with Linux, and laptops, and hot-swaps connections, and can be controlled via keyboard shortcuts. Audio switching a bonus. Sensible price preferred!

Printer statistics (ongoing)

Time has been passing. And I’ve studiously ignored the warnings from the printer, and kept on sending it jobs. Which it has kept on printing. Beautifully.

I’m now at a total of 885 impressions (348 mono and 537 colour) and despite complaints that the magenta cartridge is now also “low”, there seems to be no difference in the quality of the output. I’ve now got replacement black and magenta toner cartridges “waiting to go”, but see no reason to install them until the print quality starts to actually degrade.

I’m cynically starting to wonder if Lexmark have set the warning levels artificially early as a means of promoting toner sales. It will be interesting to see if the printer enforces replacement before the toner actually runs out, and how much toner is left in the cartridge at that point…

Printer statistics

My Lexmark laser printer started complaining about low toner in the back cartridge today. I’ve had the printer just over a year, but even so, I was surprised that it had got through 2500 sides of text (what the black cartridge is rated at) so quickly.

So I checked the statistics. The 543DN has an inbuilt web server that provides all kinds of helpful information, including the fact that my cartridges are:

  • Black: low
  • Yellow: 80%
  • Magenta: 30%
  • Cyan: 50%

There is lots of information on the pages printed, including average job length, job type, etc. It turns out that I’ve printed a total of 519 jobs, of which 474 are 1 or 2 pages long. My longest job was 23 pages.

I’ve printed a total of 312 mono A4 sides, and 499 colour A4 sides, for a grand total of 811 sides overall.

And because my “2500 sheet high capacity black toner cartridge” is nearly empty after only 811 sides printed, this is where I can point out that the old adage about “lies, damned lies and statistics” is absolutely true, and the definition of a printed side (as used by the printer manufacturers) has no standing in the real world whatsoever.

If I assume my cartridge statistics are correct, 811 real world A4 impressions costs me all of a black cartridge, 70% of a magenta, 50% of a cyan, and 20% of a yellow. A total of 2.4 cartridges at £60 each, or £144. Which is 18p an impression. Which seems expensive, but given my preponderance of colour printing, perhaps isn’t as bad as it first seems.

Displacement activities

Strangely, having realised that I’m now imminently facing more treatments, I retreated from all the obvious things that I ought to be doing, and vanished out into the freezing cold garage, and proceeded to disassemble my toy car. It’s been sat out in the garage with a broken speedometer for several months, barely touched, but this last set of news somehow galvanised me into action.

In the course of a few short hours I’d stripped out the entire interior, removed the transmission tunnel, and exposed the gear linkage and speedometer sensor, removed the broken sensor, adjusted the gear linkage détente, put it all back together again, fabricated a new sensor mount on the front bearing carrier, re-run the sensor wiring, and bonded some rare earth magnets to the disc rotor.

Unlike trying to monitor the propshaft rotation, monitoring the disc rotor works beautifully; the propshaft has a lot of play in it, as it connects the engine and gearbox which are both on flexible mounts, whereas the disk rotor doesn’t move in relation to the front bearing carrier at all. It’s possible to closely align the sensor to the magnets, and get a superb signal to drive the speedometer.

As a result, I can now (for the first time ever) see exactly what speed I’m travelling at in the car, and it’s somewhat eye-opening. I always knew the car was fast, but when the soft rev-limiter engages in 2nd gear, the car is already approaching 70mph. It’s completely mental. And exactly what I need at the moment!

The only question now is whether the epoxy resin I used to bond the magnets to the disc rotor is strong enough to keep everything in place, or if the magnets will eventually come loose. I’m currently pretty sure it’s the former – but as they say, pride comes before a fall!

The search for a new desktop still continues

Back in my last post I described how I attempted to customise the Unity desktop environment to better suit my needs within my admittedly commercial setting. The results weren’t too bad, but exposed a series of issues, some of which were purely personal and subjective, and some I felt to be genuine bugs, which I raised against the Unity interface.

This post is all about the same attempt, but this time with the Gnome 3 Shell.

So, having freshly installed Ubuntu 11.10, we need to install Gnome Shell. It’s in the repositories, so it’s a simple matter of opening a terminal and issuing the command:
sudo apt-get install gnome-shell

The steps I then followed were:

  1. Getting to a shell prompt with Alt + F2 has been disabled by default in Gnome Shell under Ubuntu 11.10. This is annoying, as it means you can’t (trivially) restart or debug the desktop environment without it. To fix it, open “System Settings” and under the Keyboard settings, go to Shortcuts, then System, and then click the “Disabled” next to “Show the run command prompt” and press Alt + F2 to re-enable the command prompt.
  2. Next I added some Gnome Shell customisations from http://extensions.gnome.org, which make Gnome Shell look a lot more like Gnome 2. Heretical? Perhaps. So shoot me.
    1. Frippery Applications Menu – puts an old-school applications menu on the left side of the top menu
    2. Frippery Bottom Panel – adds a taskbar to the bottom of every workspace
    3. Frippery Move Clock – moves the clock back to where it used to be in Gnome 2.xx
    4. Frippery Panel Favorite – adds a copy of the launcher into the top panel
  3. Next, I wanted to remove the accessibility icon from the top panel. Last time I looked, I didn’t need any of those settings, so I certainly don’t need the icon there all the time. To get rid of it, I downloaded an extension from the website of the author of all the previous extensions:
    http://www.fpmurphy.com/gnome-shell-extensions/noa11y-2.0.tar.gz

    This needs to be unpacked into ~/.local/share/gnome-shell/extensions/ by cd’ing to that directory and running something like:
    tar xvf ~/Downloads/noa11y-2.0.tar.gz.

    You then need to install Gnome Tweak to be able to enable the extension:
    sudo apt-get install gnome-tweak-tool
    and then run it with gnome-tweak-tool and choose to enable or disable whatever extensions you have loaded.

  4. As with Unity, I wanted to disable the overlay scrollbars:
    sudo su
    echo "export LIBOVERLAY_SCROLLBAR=0" > /etc/X11/Xsession.d/80overlayscrollbars

    Sadly the scrollbars still don’t have scroll buttons on them – which reinforces my thought that this is simply an issue with themes, and hence can probably be resolved once I’ve learned how themes work.

  5. Next, move my preferred set of three window buttons back to the top right of each window titlebar by running the command:

    gconftool-2 --set --type str /desktop/gnome/shell/windows/button_layout ":minimize,maximize,close"

  6. Around now it’s probably worthwhile to logout and back in again, or even reboot.

  7. Next I configured the general settings:

    1. Screen:
      Turn off at “30 minutes”
      Set screen lock “on” after “screen turns off”
    2. Power:
      Do nothing when lid closed (battery or AC)
      Don’t suspend when inactive (battery or AC)
      Shutdown if power critical on battery
    3. Time and Date:
      Panel clock to show 12hour format
    4. Removable Media:
      Tick “Never prompt or start programs on media insertion”
  8. Next I added the date to the clock:
    gsettings set org.gnome.shell.clock show-date true

  9. As with Unity, I configured the terminal by opening terminal preferences, and set the font to “Monospace 9”, the default terminal size to 100×40, and the scrollback to 10000 lines.

  10. As with Unity, I changed the default fonts throughout:

    gsettings set org.gnome.desktop.interface document-font-name 'Sans 10'
    gsettings set org.gnome.desktop.interface font-name 'Ubuntu 9'
    gsettings set org.gnome.desktop.interface monospace-font-name 'Ubuntu Mono 10'
    gsettings set org.gnome.nautilus.desktop font 'Ubuntu 10'
    gconftool --set /apps/metacity/general/titlebar_font 'Ubuntu Bold 9' --type STRING

  11. I also removed the guest account:

    sudo gedit /etc/lightdm/lightdm.conf

    Make it read:

    [SeatDefaults]
    greeter-session=unity-greeter
    user-session=ubuntu
    allow-guest=false

  12. At this point I found I had a desktop that had almost all the features of my current Gnome 2 setup, plus access to the new metaphor of the Gnome Shell when I wanted it. The only problem is that when mousing to the newly added Applications menu, it’s far too easy to hit the “hot spot”, triggering the Overview Mode.

    There are extensions to move that hotspot elsewhere, but I’d prefer to change the way it works, so it takes a more conscious effort to engage it. Unfortunately there is no configuration for this, so for this exercise I took a quick hack at the base code, which is a real cludge. I’m hopeful that it may be possible to do something cleaner with Monkey patching, but for now my change proves the concept, and makes it necessary to click on the hotspot to engage it, or use the super key (as now). To do this, edit:
    /usr/share/gnome-shell/js/ui/layout.js, and change the _onCornerEntered method so it reads:


    _onCornerEntered : function() {
    // if (!this._entered) {
    // Patched this to prevent the hot corner from engaging on cursor entering zone.
    if (this._entered) {
    this._entered = true;
    if (!Main.overview.animationInProgress) {
    this._activationTime = Date.now() / 1000;

    this.rippleAnimation();
    Main.overview.toggle();
    }
    }
    return false;
    },

    Now just entering the hotspot will not trigger the Overview Mode – but you can still click on the hotspot (which is the top left pixel), or just use the Super key.

  13. Since I was messing around in the source code I also decided to get rid of the “currently running application name” in the top panel, which again cannot be configured away. Quite why I’d need to be reminded of the name of the application I’m using is beyond me, and it takes up precious menubar space. This time, edit:

    /usr/share/gnome-shell/js/ui/panel.js, and find the AppMenuButton function prototype. Then scroll down to the “_sync” method, and make the first few lines read:

    _sync: function() {
    let tracker = Shell.WindowTracker.get_default();
    let lastStartedApp = null;
    let workspace = global.screen.get_active_workspace();
    // Add the following line to never show the button (application name)
    return;
    for (let i = 0; i < this._startingApps.length; i++)
    if (this._startingApps[i].is_on_workspace(workspace))
    lastStartedApp = this._startingApps[i];

    This works perfectly, but like the previous code change, the problem is that whenever Gnome Shell gets updated, I would need to re-hack these changes manually. Which is not good. But as I mentioned before, I’m hopeful that Monkey Patching will come to the rescue and allow me to create a proper extension for this.

And the conclusion? Well, since it’s all written in Javascript and CSS, Gnome Shell is much easier to customise, and its extension system allows (in theory) for a robust and user-friendly mechanism to change anything that one wishes. I now have a DE that has all the features I like from an “old” Gnome 2 desktop, as well as access to all the new features of Gnome Shell. See below:

There are still rough edges, some of which are probably bugs too, but overall I can get closer to what I want (which may not be what you, or the Gnome Shell developers want) with Gnome Shell than Unity.

So when I upgrade my work “production” laptop over Christmas, it will be to a Gnome Shell based desktop.

The search for a new desktop continues

So the fight to find a workable productive solution continues. Lubuntu and Xubuntu both ended up having problems with some of IBM’s productivity applications. Not an issue for the majority of users, but critical for me. And I also discovered that IBM and Canonical have committed to work together to ensure that we “internal” IBM users of Ubuntu will get the support to ensure that our internal productivity tools do work under Unity.

Which gives me a pretty strong push back towards finding a way to make Unity somewhat more palatable and productive. So I’ve set about trying to turn Unity into something that I can live with for work. I’d not say I’ve completely achieved that yet, but a couple of (long) evenings have got me a fair way forward, and revealed a few problems that I probably need to raise as bugs against Unity – though given the non-standard way that I’ve exposed them, it’s debatable whether they’ll ever be addressed or not. Anyway, here are the results so far:

My normal desktop


Customised Oneiric, with the launcher open


Customised Oneiric, with application selector open

And this is what I did to a freshly installed Ubuntu 11.10 system to get there:

  1. Add back a menu of applications that can act as a launcher, and a taskbar where I can see what I have running. I came across this post describing how to resolve these issues, and merely followed the directions.

    First the menu launcher:

    sudo add-apt-repository ppa:diesch/testing
    sudo apt-get update
    sudo apt-get install classicmenu-indicator

    Once installed, run it by pressing Alt-F2 and typing classicmenu-indicator.

    Now install the taskbar:

    sudo apt-get install tint2

    Once installed, set it to auto-run on system start, by adding an entry to the Startup Applications. The executable is at /usr/bin/tint2. Then configure the resulting bottom panel (in ~/.config/tint2/tint2rc) so it only has a taskbar, removing the clock and battery indicators, by adding:
    panel_items = T
    and adjust its size to avoid interference with the unity launcher (when it’s on screen) by making sure:
    panel_size = 90% 30
    and finally (a personal choice) remove the ability to close applications from the taskbar by setting:
    mouse_right = none

  2. Next, get rid of the ugly Unity launcher by making it autohide. This is done by altering some parameters in the Unity plugin in compiz. You need to install Compiz Config Settings Manager (CCSM) first, by:

    sudo apt-get install compizconfig-settings-manager

    Then run it with ccsm, and find and select the Unity plugin. Then on the Behaviour tab:

    Set “Hide Launcher” to “Autohide”

    Set “Edge Reveal Timeout” to 100

    On the Experimental tab:

    Set “Backlight mode” to “Edge Illumination Toggles”

    Set “Launcher Icon Size” to 32

    Set “Launcher Opacity” to “0.8000”

    I still think it looks like it was designed by a child with a set of blunt crayons, but this makes it a bit more professional-looking, and since it’s now going to be hidden most of the time (and rarely used) I can live with it. I do wish there was an option to completely disable it though.

  3. Next I fixed the window buttons, by re-enabling the standard minimise, maximise, close triple, and moving them to the right side of the window title bar. Do this by entering:

    gconftool-2 --set /apps/metacity/general/button_layout --type string ":minimize,maximize,close"

  4. Then I disabled the ridiculous Overlay Scrollbars, and the Global Menu; together this moves the window buttons and menus back onto the windows where they belong, and gives us working scrollbars on all applications again, including those that are built on Eclipse:

    sudo su
    echo "export LIBOVERLAY_SCROLLBAR=0" > /etc/X11/Xsession.d/80overlayscrollbars
    echo "export UBUNTU_MENUPROXY=0" > /etc/X11/Xsession.d/81ubuntumenuproxy

    Sadly the scrollbars lack scroll buttons; I’ve not worked out how to resolve this yet, which can make fine positioning difficult. But it’s orders of magnitude easier than fighting with the overlay scrollbars.

  5. Firefox has an extension to separately move its menus to Unitys top panel, and this needs to be disabled too. Access it from Firefox’s Tools->AddOns menu. It seems to require that Firefox be restarted, and a logout/login sequence to be followed before it fully takes effect.
  6. Next I took back control of the workspaces, by adding an indicator applet into the notification area of the top panel, that also functions as a workspace switcher. The indicator is in a PPA, but unfortunately only for Natty rather than Oneiric. The Natty version works just fine under Oneiric, and installing it is straightforward, if a little fiddly, by following these instructions.

  7. At this point I rebooted to make sure everything was working, and noticed that the classic menu indicator was not the leftmost of my indicators any more. However, it is possible to specify the exact ordering of indicators, so I reordered mine by:


    mkdir -p ~/.local/share/indicators/application
    cp /usr/share/indicator-application/ordering-override.keyfile ~/.local/share/indicators/application/

    Editing the new local ordering-override.keyfile allows the exact order of the indicators to be specified. Lowest numbers are to the right of the panel. To find the id of unknown indicators, use:

    dbus-send --type=method_call --print-reply \
    --dest=com.canonical.indicator.application \
    /com/canonical/indicator/application/service \
    com.canonical.indicator.application.service.GetApplications | grep "object path"

    This results in lines like:
    object path "/org/ayatana/NotificationItem/gnome_power_manager/Menu"
    In this case, the id is gnome-power-manager, but note that the command output contains underscores which need to be changed to dashes to be valid in the ordering-override.keyfile.

  8. Next I installed dconf-editor, which allows a few additional tweaks to be make to Unity:

    sudo apt-get install dconf-tools

  9. I then did some configuration of general settings around the operating system. First, I configured the terminal look and feel by opening terminal preferences:

    Set font to "Monospace 9"
    Set default size to 100x40
    Set scrollback to 10000

    Next I changed all the fonts throughout the system, as the defaults seem far too large:

    gsettings set org.gnome.desktop.interface document-font-name 'Sans 10'
    gsettings set org.gnome.desktop.interface font-name 'Ubuntu 9'
    gsettings set org.gnome.desktop.interface monospace-font-name 'Ubuntu Mono 10'
    gsettings set org.gnome.nautilus.desktop font 'Ubuntu 10'
    gconftool --set /apps/metacity/general/titlebar_font 'Ubuntu Bold 9' --type STRING

    Then, in the “Screen” settings, I configured the screen to turn off at “30 minutes”, and set the screen lock “on” after the “screen turns off”. In the “Power” settings I set the system to “Do nothing” when the lid is closed (on battery or AC), and not to suspend when inactive (on battery or AC), but to shutdown when power is critically short on battery. In the Time and Date settings I set the Panel clock to show the Date and Month, and the clock in 12 hour format. Finally, in “Removable Media” I set the system to never prompt or start programs on media insertion.

  10. To add a quick list of locations to the Launcher “files” icon, I ran the following as a single command:

    echo "[Desktop Entry]

    Name=Home Folder
    Comment=Open your personal folder
    TryExec=nautilus
    Exec=nautilus --no-desktop
    Icon=user-home
    Terminal=false
    StartupNotify=true
    Type=Application
    Categories=GNOME;GTK;Core;
    OnlyShowIn=GNOME;Unity;
    X-GNOME-Bugzilla-Bugzilla=GNOME
    X-GNOME-Bugzilla-Product=nautilus
    X-GNOME-Bugzilla-Component=general
    X-Ubuntu-Gettext-Domain=nautilus
    X-Ayatana-Desktop-Shortcuts=Videos;Documents;Music;Pictures;Downloads

    [Videos Shortcut Group]
    Name=Videos
    Exec=nautilus Videos
    TargetEnvironment=Unity

    [Documents Shortcut Group]
    Name=Documents
    Exec=nautilus Documents
    TargetEnvironment=Unity

    [Music Shortcut Group]
    Name=Music
    Exec=nautilus Music
    TargetEnvironment=Unity

    [Pictures Shortcut Group]
    Name=Pictures
    Exec=nautilus Pictures
    TargetEnvironment=Unity

    [Downloads Shortcut Group]
    Name=Downloads
    Exec=nautilus Downloads
    TargetEnvironment=Unity" | sudo tee /usr/share/applications/nautilus-home.desktop

  11. Next I disabled the guest account in LightDM. This prevents someone from logging into my machine (albeit with very limited privileges) when I’m away from the machine. I suspect our security people would not be comfortable with this feature left enabled. To do this, edit /etc/lightdm/lightdm.conf, and make it read:

    [SeatDefaults]
    greeter-session=unity-greeter
    user-session=ubuntu
    allow-guest=false

  12. Next I wanted to change the Alt-PrtSc capability, so I can capture a specific area if the screen rather than the active window. I want to retain the default PrtSc functionality. To do this, I started ccsm, and in the Gnome Compatibility plugin I changed the command “gnome-screenshot -w” (active window) to “gnome-screenshot –area”.

    While I was in ccsm I also disabled the “Snapping Windows” plugin, as it was driving me nuts. I also set a key combination (Ctl-Alt-g) on the “Toggle Handles” option of the Unity MT Grab Handles plugin, to allow easier screen grabbing & manipulation, as the default theme has quite small borders to its windows.

  13. By default, Oneiric doesn’t come with any screensavers. It simply fades to black. Which is efficient, but rather boring. So I removed the default screensaver (which does nothing) and reenabled all the pretty screensavers:

    sudo apt-get remove --purge gnome-screensaver
    sudo apt-get install xscreensaver xscreensaver-gl-extra xscreensaver-data-extra

    It’s then necessary to add “xscreensaver -nosplash” to the startup applications. This is the server portion of the screensaver which does the actual displaying of the animations, the locking of the screen, and any power management. It’s configured with “xscreensaver-demo”, which allows graphical selection of screensaver animations etc. Finally, to keep the ctl-alt-L key combination to manually start the screensaver, it’s necessary to:

    sudo ln -s /usr/bin/xscreensaver-command /usr/bin/gnome-screensaver-command

  14. Getting Conky installed (to create the animated desktop) was simple, once I’d realised that the key to making it work under Unity is to change the .conkyrc configuration stanza to own_window_type normal. However, Unity does something odd with painting itself into a different window than the root, so Conky cannot do transparent without help from something like feh, but that can only work with static images, not my preferred gradient fill. I resolved the issue by adopting an image for my desktop background.

  15. Finally, I mentioned a few issues that I’d not resolved yet:

    It seems impossible to stop the Unity top panel showing the name of the active applicaton.

    It seems impossible to move the classicmenu_indicator to the left of the Unity top panel.

    Having disabled the overlay scrollbars, the remaining scrollbars lack scroll buttons

    It seems impossible to remove the workplace switcher icon from the Unity Dash (hard-coded) Raised as Bug 898230.

    It seems impossible to remove the Dash Home icon from the Unity Dash (Hard-coded) Raised as Bug 898230.

    When maximising a window, Unity still steals the window buttons, and places them in its top panel Raised as Bug 898250.

    When stealing the window buttons, it doesn’t adhere to the setting in gconf for how to display them, but uses a hardcoded default Raised as Bug 898250.

    Seems to be impossible to completely disable the Unity Launcher Raised as Bug 898260.

    Help with any of the above would be much appreciated!

The search for a new desktop

As I mentioned here, I’m less than happy with the move Ubuntu have made towards adopting new desktop environments that seem to be more suited to touchscreen devices than desktop computers. So I’ve been test-driving a few of the alternatives to try to find something that will let me get on with my work, without getting in the way all the time.

So far I’m very impressed with LXDE, which is available pre-packaged onto the underlying Ubuntu 11.10 base as “Lubuntu”. Admittedly it’s very basic out the box (or off the USB key), but that seems to be because it’s been designed for very low-powered or old computers. All the default applications have also been selected to keep memory and CPU usage to a minimum. Nothing wrong with that, but in my case, I have a ridiculously powerful laptop with lashings of disk and memory to run it on – so all I want is the good old fashioned desktop metaphor back. Lowered system requirements are simply an added benefit.

So I’ve gone about hacking Lubuntu into something better suited for me. So far I’ve removed sylpheed sylpheed-doc sylpheed-i18n sylpheed-plugins mtpaint osmo xpad ace-of-penguins abiword abiword-common libabiword-2.8 gnumeric and gnumeric-common. That got rid of most of the default applications, and makes way for me to replace them with something fuller-featured.

I then added thunderbird xscreensaver-data-extra xscreensaver-gl-extra recoll inkscape scribus gimp gimp-data gimp-data-extras gimp-help-en gimp-help-common dia shotwell libreoffice aisleriot gnome-sudoku freemind audacity musescore easytag pitivi and conky-all. That adds most of the applications that I would expect to need from the standard Ubuntu repositories.

I then reconfigured the panels. Lubuntu comes with one panel on the bottom of the screen, a la Windows XP, but I’m used to the Gnome approach. So I moved the original panel to the top of the screen and added a second panel to the bottom. I then reconfigured the panels to match what I’m used to in a Gnome 2.x environment by moving around the various panel items – which was far easier than configuring the Gnome panels. So far so good.

Interesting to note that at this point, my test laptop (which is “only” a dual core 2Ghz machine with 2GB of ram) absolutely flies. But I still have a lot of things to try:

I know it’s just eye-candy for the sake of it, but I tried to add a simple Conky installation, showing some key facts and figures to the desktop – date/time, CPU, RAM & disk monitoring etc. It turns out that Conky and LXDE’s FilemanPC (which manages the desktop) don’t play well together out the box. You can get Conky scripts roughly working by altering them to contain “own_window_type normal” rather than “own_window_type overlay” or “own_window_type desktop”. However, the window can easily get minimised, with no way to recover it. Low priority, but more research required on that.

Currently most of the Thinkpad Fn-F1-12 key combinations aren’t recognised. The only one I really care about is Fn-F4 for suspend, which I can workaround using the menus, but I’d like to get at least that one enabled.

Next I need to test all the IBM-specific software that I normally use. I suspect that there may be some issues around the support of some of the Lotus products, which are built on top of an Eclipse base, and hence may not play well with my different desktop environment. Time will tell on that, but its critical for me.

Finally, assuming I can get all these basics working, I think I’ll be looking into producing a custom theme, as the standard Lubuntu (cold) blue isn’t at all to my taste.

Building a wireless sensor hub (part iv)

Having got everything pulled back together and wired back up, I can now report that it doesn’t work. Since I don’t own an oscilloscope (yet!) debugging it is going to prove difficult. However, I can’t see anything obvious wrong with my little circuit, so I now rather suspect that I may have blown the UART in the router.

Ideally I should now test that, but again, without an oscilloscope to hand, that’s going to be awkward. If anyone reading this is an electonics wiz, feel free to comment on any issues I may have overlooked in the design of my circuit.

In the meantime I’m going to see about acquiring some test tools to help me debug it further. Drat.