This isn't a user tip - as you can probably see I didn't do very well keeping up on those. Instead here's a rather technical and long-winded commentary about what is going on regarding setting the default keyboard on the Ubuntu 12.04 Live CD, from a British perspective. This is important to me because I use the customised Bio-Linux Live USB stick image for teaching purposes, and I use it in UK academic labs. If the first thing I have to do in each course is to get the students to change their default keyboard then it looks rather unprofessional and it begs the question "If you're such a Linux guru and you made a custom distro why don't you just change the default keyboard?". Well, heck, I AM a Linux guru and I will have my own default keyboard! But it wasn't easy.

First attempt - I looked for advice on https://help.ubuntu.com/community/LiveCDCustomization. This tells you how to change the default language but not the default keyboard. However, an older version suggested this (to be run in the chroot before remastering - if that doesn't make sense to you then you need to read the Ubuntu help page first):

No joy at all. Setting the locale doesn't switch the keyboard and in any case the configuration for the locale is probably managed more appropriately by some package configuration. I'm not sure. Anyway I know I now have the settings I want in /etc/default/locale and yet it makes no difference to the keyboard.

Second attempt - I used the F3 boot menu in Syslinux to set a UK keyboard, which works, then booted up and looked at the resulting boot stanza (handily available in /proc/cmdline). Then I edited txt.cfg in syslinux to try and make this the default. Simple, or at least this had worked previously in 10.04, but this time no joy. The thing I tried to add was:
"keyboard-configuration/layoutcode=gb"
(In Ubuntu 10.04 the equivalent, that actually worked, was:
locale=en_GB bootkbd=gb console-setup/layoutcode=gb)

Third attempt - I noticed that "keyboard-configuration/layoutcode=gb" looks like a debconf setting, so I tried (this time on a live image):
dpkg-reconfigure keyboard-configuration

Ok, this seemed to work. My keyboard was now fixed. So I did it in the chroot and remastered. But no joy. The console keyboard on the VT (Ctrl+Alt+F2) is set correctly to "gb" but the default keyboard in X is still "us". Grrr.

Fourth attempt. After much digging and fiddling and rebooting I realised the following:

(A) If you get an Ubuntu 12.04 live CD and boot it in default mode, then select "try without installing", you get a US keyboard setup in X with a keyboard switcher icon in the top right that lets you select a US or GB keyboard (and 2 others we don't care about). But even booting with a persistent USB stick rather than a CD this setting does not get saved between reboots.

(B) If you interrupt the boot and select a GB keyboard in the Syslinux F3 menu you get a GB keyboard and the keyboard switcher is absent (or, if it appears, shows only the GB option).

If you start off with (A) and, in a terminal in X, run "dpkg-reconfigure keyboard-configuration" to set a GB keyboard you end up in what looks like (B).

If you start off with (B) and run "ubiquity -g --only" you end up with a US keyboard and looking like (A).

Aha - now it starts to make sense. The above ubiquity system is run like this on a default live boot in order to let the user set their language and to present the options for a live session vs. an installation without the user having to see the ugly Syslinux menus. Certain boot-time options set by Syslinux skip this Ubiquity "greeter" dialogue, but if it does run it takes over the keyboard settings. So, is it possible that somewhere in Ubiquity this behaviour is hard-coded??

Indeed it is - and fortunately as ubiquity is Python-based we can dig right in to look. Reading through /usr/lib/ubiquity/ubiquity/misc.py reveals the culprit around line 620. In 10.04, Ubiquity already ran a very similar greeter window on startup and was happy to leave the keymap alone, but since 10.04 it has been tasked with setting appropriate options in the Gnome keyboard switcher, depending on the language selected in the GUI, and the approach is very hacky, with a hard-coded list of default keyboards for different languages. This code runs even if nothing is clicked by the user and, when libgnomekbd receives the new settings via a gsettings call, the first keyboard it selects ends up as default and is activated. So, seeing the hard-coded list, one thing is clear - unless I bypass ubiquity altogether by fiddling the default boot options I'll need to edit this file in some way.

The former option is quite possible (it involves rebuilding the gfxboot module for Syslinux but this is covered in the Wiki above). But then it would also be nice to still have the keyboard switcher because the Bio-Linux distro I'm making has US users, and they have US keyboards. So, the obvious thing is to set the default "en" keyboard to "gb" in the misc.py internal mapping table. Not quite - now I lose the US option entirely and get "Irish". I didn't even know there was a special Irish keyboard (joking aside - http://goo.gl/1lFuV).

Fifth attempt. My final solution is not ideal - one final hack in the misc.py file - but it's good enough for me. I edited the "restrict_list" function so that, just before it returns, if the first and third keymaps are "us" and "gb" it swaps them round and promotes "gb" to the top spot. And this does the trick. The patch looks like this:

I can't see any other way that doesn't either lose the keyboard switcher for US users or involve major re-coding, so this is what I've stuck with.

TIM
]]>avarushttp://www.linuxquestions.org/questions/blog/avarus-108601/changing-the-default-keyboard-on-ubuntu-12-04-live-cd-35105/Evolution - notification and RSShttp://www.linuxquestions.org/questions/blog/avarus-108601/evolution-notification-and-rss-1823/
Thu, 02 Apr 2009 12:57:57 GMTBetter late than never, some more tips based on my Experience of running the Ubuntu-based Bio-Linux 5. I promised to say something about the...Better late than never, some more tips based on my Experience of running the Ubuntu-based Bio-Linux 5. I promised to say something about the Evolution mail client, so here goes.

I use my e-mail client a lot, so I think it's worth setting it up to work just right and learning some of the more advanced features that can save time and annoyance. The default e-mail client on Bio-Linux is Evolution, but if you prefer Mozilla Thunderbird, or Mutt, or even NMH, then they can be installed in seconds via Synaptic.

Evolution has the advantages that it works with just about any mail system and comes with a host of features. Some of these are available as plugins, and can therefore be activated via the plugin manager (Edit -> Plugins). If you seem to be missing a feature that you expected to find, it may just be that the plugin needs to be turned on here.

One thing Evolution lacks by default is a nice way to notify you of new messages in the system task bar. I use the Gnome mail notifier:

In a terminal type "mail-notification &!". A new icon should appear next to your update notification icon, which is in the top right of the screen by
default.

Right click this and select Properties. Add your Evolution mailbox to the list.

Set the other options how you want them, checking the autostart box to ensure the mail notifier appears each time you log in.

Now the tricky bit. Mail-notifier gives you various options under Click Action but none of these are what I really want. I want to pop the current
instance of Evolution to the front, switching virtual desktop if necessary. If Evolution isn't running I want to start it up. This can be done as follows:

Select Launch the mail reader as the Click Action

Run gnome-default-applications-properties and set the Mail Reader to Custom
with the command set to /home/<username>/scripts/goto-evolution %s

That was slightly long-winded, so here's just one more, shorter, tip. I try to keep up with a variety of news feeds that are available via RSS. These can be read through an online service like Google reader, or through a standalone client like the excellent Liferea. But if you already read mail through Evolution and want to reduce the clutter on your desktop then adding feeds straight into Evolution is easy:

apt-get install evolution-rss

restart Evolution and go to Edit -> Preferences. Look for the new News and Blogs item in the left hand list

So, the clipboard. Exciting, eh? You probably use it all the time. Cut this, copy that, paste the other. Ideally, you should be able to copy text, images, or anything you like from any application and to drop them into the same
application or any other application. It avoids the need to mess around with saving a temporary file, and sometimes it's the only way to do the job.

The problem is, the clipboard in Linux doesn't always do what you expect. Shouting at the computer doesn't fix the problem (I've tried!) so it might be useful to delve a little deeper and find out what's happening behind the scenes.

The first thing to know is: There are TWO clipboards. One belongs to X-windows, the other belongs to Gnome. (Actually that's not entirely true, but it's close enough) Try this:

Open two terminals and run 'nano' in each (nano is the basic text editor).

In the first terminal, type two different lines of text.

Select the first line with the mouse, then select Edit->Copy from the menu.

Select the second line with the mouse, and just leave it highlighted

Now in the second window select Edit->Paste, and the first line should be pasted

Now click the middle mouse button in that window, and the second line should appear.

(if you only have two mouse buttons, press both at once for a middle-click)

(For added fun, Nano also has an internal clipboard, accessed with Ctrl+K and Ctrl+U, that only works within the single editor session.)

So the X-windows clipboard, traditionally accessed by selecting text to copy it and middle-clicking to paste it, works with any application and only supports plain text. The Gnome clipboard does not work with some older apps but is able to cope with things such as rich text and images. For example, try opening a website in Firefox and selecting some formatted text and images, then select Edit->Copy. If you paste that into OpenOffice you'll see the format and images are preserved. If you paste it into Nano it gets converted to plain text. If you paste into GIMP Image Editor you get an error. Most of the time this works the way you expect, but keeping in mind the way the computer is having to convert your clipboard data can make things less baffling when unexpected things happen.

Three other useful things to do with the clipboard are to retrieve a history of contents, copy between the two clipboards, and force rich content on the clipboard to plain text. A clipboard manager will do this, and there are several - take a look here:

The standard one for Gnome is Glipper. Install the 'glipper' package via Synaptic, then right-click your top panel and 'Add to Panel'. Select 'Clipboard manager' and a little icon should appear. Copy a few things to the clipboard and then left-click the icon to see the list. Selecting any of these will drop it into BOTH clipboard buffers, but converted to plain text in both cases.

I use Glipper and find it indispensible, but it does have some glitches. For instance, copying images between applications can stop working with Glipper in effect. This bug has been around for a while and you can follow the progress here: https://bugs.launchpad.net/ubuntu/+s...er/+bug/104432. Hopefully a fix is on the cards, but right now the only remedy is to
temporarily disable Glipper - not ideal.

That's quite enough clipboard internals, I think. Next time, the Evolution mail program and how to make it do what you want.

TTFN,
TIM
]]>avarushttp://www.linuxquestions.org/questions/blog/avarus-108601/aaaaaaaaand-cut-1614/Some Firefox favouriteshttp://www.linuxquestions.org/questions/blog/avarus-108601/some-firefox-favourites-1567/
Fri, 30 Jan 2009 13:43:05 GMTThe idea of this blog is primarily to give some helpful suggestions to anyone moving from Bio-Linux 4 to Bio-Linux 5...The idea of this blog is primarily to give some helpful suggestions to anyone moving from Bio-Linux 4 to Bio-Linux 5, and one big change is the desktop environment (which has changed from KDE to Gnome). The new version looks and behaves a little differently, and for anyone who uses the system as their regular PC the small features can add up to make a more satisfying or a more frustrating experience depending on your personal taste.

I like to have my computer working just the way I want it, and I've been trying out some tweaks to get things just right. In this post I'll suggest some ways to set up your Firefox browser that I find make it work better for me.

Firstly, I've been asked what happened to Iceweasel. To all intents and purposes, Iceweasel is a Debian branding of Firefox and aside from the name the program works identically. Now that Bio-Linux runs on Ubuntu, the more recognisable name and logo has returned but all your settings, bookmarks, plugins, etc. should continue to work just as before.

One little feature I like in Firefox is that you can copy a URL to the clipboard then middle-click in the browser window to open it. This is disabled in Ubuntu, as it alarms some users, but you can get it back very simply - see this post

Firefox also supports a wealth of Add-ons. Three that I find particularly useful:

BioFox: Gives you quick access to all sorts of on-line Bioinformatics tools. Why hunt down your own services when Biofox collects them all for you in one handy toolbar?

Ageing tabs: This may seem like a gimmick, but having the unused tabs in your browser slowly fade can be very useful. If you have, say, 10 tabs open and are currently using three of them the relevant 'hot' tabs immediately jump out at you.

Mouse gestures: Not everyone gets on with this, but I find it a very natural way to control the browser. Pull new tabs into existence, dismiss them with a sweep, zoom in with a flick. You won't quite be like John Anderton but you can at least hold your own with those smug iPhone users.

A first blog entry! As you'll see from my profile I've been on LQ for a good few years and have posted a few messages to the discussion forums - some more helpful than others - but no blog so far.

I'm proud to be part of a group that maintains Bio-Linux, an Ubuntu-based distribution that packs in over 500 freely-available bioinformatics programs, with documentation and sample data ready to run out of the box. The project has been going for several years, and late last year we released Bio-Linux version 5.

So, whichever way you look at it, this first post is a blatant plug:

If you came here from LQ.org, and are interested in molecular biology, please check out Bio-Linux. You can download an ISO direct from here or find individual packages for your Ubuntu/Debian system here.

If you came here as a Bio-Linux user, my first tip to you is to check out the rest of LinuxQuestions.org. This site has a fantastic community and a wealth of resources for everyone from novice to guru. You might even find you can help out other users in the forums.

And in either case, keep an eye on this blog over the next few weeks. I'll be adding some of my personal tips for getting the most out of Bio-Linux and the Linux/UNIX environment in general.