Tips 'n Tricks for Ubuntu

Welcome to my Linux page. Here you will find solutions to what has taken me >5min to figure out. (These solutions have been tesetd on Ubuntu 11.04 through 12.4 LTS.)


Things I must have on my linux box

Emacs and my emacs config files (redo.el and my .emacs), my aliases for .bashrc (or .cshrc and .login if on unix since there I don't normally use bash) which include turning off my laptop's touchpad, cyrillic keyboard (custom-modified phonetically), gummi, gnome desktop (I hate Unity), and goes without saying that mp3, video, and wireless must all work.


Gummi, a LaTeX editor

Gummi is the reason I added Ubuntu to my Windows laptop (aside from wanting to geek out:) I wanted to learn LaTeX and so wanted instant preview of what my PDF will look like, or else a warning that what I am typing won't compile. Yes, I want instant feedback and preferably visual feedback since LaTeX is a tool to make things look pretty. Lucky for me, Gummi does exactly that.

______
[Q] Problem: How do I install gummi? Ubuntu's Software Center does not seem to like gummi.

______
[A] Solution: Use the terminal, like so:

$ sudo add-apt-repository ppa:gummi/gummi
$ sudo apt-get update && sudo apt-get install gummi


You can then run gummi like this:
$ gummi


Cyrillic keyboard layout

______
[Q] Problem: Ubuntu comes with a Russian phonetic keyboard layout (which you have to install). Sweet. But, the layout is weird and I'd like to customize it and when I "view" the layout in Ubuntu's equivalent of a control panel, I can't edit it. Not so sweet.

For example, in this phonetic layout, the latin letter 'J' corresponds to the Cyrillic 'Й' instead of a 'Ж' (and same for lower-case). This might make sense if you live in Germany or German is dear to your heart. But in the U.S. it makes more sense to have the latin 'J' be a 'Ж'. For example, if I type "jarko", I want to see "жарко", not "йарко". "There are lots of keyboard layout managers for Windows, but I have yet to find one for Linux, and I am certainly too lazy to write one. So, how do I remap keys?

______
[A] Solution: You need to modify the keymap file for this layout: /usr/share/X11/xkb/symbols/ is the directory where you'll find your keymaps. The keymap file for your Russian layout is called ru. Right-click here to download my copy of ru -- choose "Save Link As..." Backup your local copy of that file and then feel free to replace yours with mine or diff the two instead to see what changes to make.

But if you want details, here is an example of how to make a 'J' into a 'Ж'. Because I happen to have emacs installed on my system, here is an example of how to open the file for editing using emacs. The first thing I do though is backup my keymap file just in case I want to revert to it later or if I screw up. Then, I open the file in emacs, though you can use whatever editor you want of course (especially since emacs won't be automatically installed on your system). Here's how I told the shell to do both of these things:

$ sudo cp ru ru.backup
$ sudo emacs ru

What not to do: If I omit "sudo", I won't be able to edit this file since it's a system file, permissions and all. So, I either have to log in as the super user (using su) or I have to run the command as a super user (using sudo). Also, it won't work if I try to fork a new process. If I put an ampersand (&) after my shell command to fork a new process (which I might want to try to do so I can keep using this terminal while having emacs up, that is without having to wait until I exit emacs), the process will be killed since the shell won't know how to ask me for my super user password. So, neither of the following works:

$ emacs ru
$ sudo emacs ru &

Search for "phonetic" in this file, i.e. in /usr/share/X11/xkb/symbols/ru. You'll see this:

partial alphanumeric_keys
xkb_symbols "phonetic" {

    name[Group1]= "Russia - Phonetic"

Underneath that, find the key for LatJ. LatJ means "Latin J". You'll see this:

key <LatJ> {    [  Cyrillic_shorti,  Cyrillic_SHORTI]    };

The [x,y] pair is a [lower-case, upper-case] pair specifying what Russian letter the Latin J should correspond too. Change it to this:

key <LatJ> {    [  Cyrillic_zhe,     Cyrillic_ZHE]       };

Of course do not forget to remap the 'й', as well as the 'Й', to another key, or you'll lose it since you unmapped it just now ("short i" was the 'й'). When you're done, save the file, log out, and log back in. (Rebooting should not be necessary.) That's it. Your Russian phonetic keyboard layout should now have  'ж' instead of 'й'  and  'Ж' instead of 'Й'.

Which version of Ubuntu?

The above has been tested with everything from Ubuntu 11.04 to 12.4 LTS. (I use gnome classic.)

I would have rather gone with Linux Mint since it's supposed to be more user-friendly and, these days, I care about GUI usability and design. In fact, I actually tried out Linux Mint 11 LXDE, but had issues with my external monitor (my function key wasn't working for quick switching) and with Cyrillic keyboard input, and again I was too lazy to try to make it all work. So, I decided to stay with Ubuntu 11.04, which I have already modified to my liking by now.

Ubuntu 11.04 had the following issue which seems to have been fixed in 12.4 LTS. Once in a while, gnome would ask me whether I want to delete this or that applet on login -- every time I had to remember to press "don't delete".

If you want to go shopping for a linux distribution, DistroWatch.com is the candy store of linux distributions; (linux is free, no worries).