Quick Linux Tip: Remap “Back” Key to Win Key

January 22, 2010

Thinkpad keyboards are the best laptop keyboards I’ve seen. The function keys are placed in groups of four, with gaps, like on a full-size keyboard. The arrow keys are located lower than the rest of the keys, for easy tactile identification. And best of all, the Insert, Delete, Home, End, and Page Up/Down keys are grouped in the familiar 2×3 box pattern one would expect to see on a desktop keyboard.

The only thing I’m missing is a right Windows key (technically a Super key). A lot of handy Amarok shortcuts use the Win key, such as Win+O for displaying the OSD, or Win+P for firing up the playlist. I’ve also set Win+Plus and Win+Minus to change the volume. With only a left Win key, all of the above-mentioned shortcuts require two hands. So what can I do?

I can remap the “back” key (XF86Back) located above the left arrow key to act as a right Win key. (The back key itself is not that useful — in most sensible applications, one can use Backspace for that purpose.)

First, I open up xev and press the key to find its keycode: 166. Then I use xmodmap to test the changes live:

xmodmap -e “keycode 166 = Super_R”

Finally, I save the setting in my ~/.Xmodmap:

keycode 166 = Super_R

Mission accomplished.

Today’s Random Firefox Trick…

May 22, 2009

… you can select non-contiguous regions of text by holding Ctrl while selecting with the mouse! (If you have a table, it will select a rectangle instead.)

Two OpenOffice.org Writer Tricks

February 16, 2009

Trick #1: Stop AutoText from switching to Times New Roman

I often edit files in fonts other than Times New Roman, just because that font is so ubiquitous. And I sometimes use AutoText to insert frequently used phrases, or Romanian words in an English text (so that I don’t have to switch languages constantly). One thing that has always annoyed me is that after invoking an AutoText completion (F3), the next characters will always be in Times New Roman (even if the AutoText itself is in another font).

As it turns out, this happens because Times New Roman is the font of the Default paragraph style. So hit F11 and modify your style to use the desired font. In fact (and this is a topic for another day), styles should be used in most cases and formatting a selection of text (bold, italic, font, font size, paragraph indentation) should rarely be done by hand. This is very unintuitive to people who have been using text editors before the GUI era.

Trick #2: Insert Formula without switching into formula-edit mode

Read the rest of this entry »

Shortcut: Delete an Entire Word

May 27, 2008

Before I began using VIM I didn’t care much that my typing habits were very inefficient, but now I’m looking everywhere for possible optimizations

There are two simple shortcuts that work on KDE, Gnome and (AFAIK) even Windows, and that will probably become second nature once you start using them. Perhaps they are regarded as common knowledge, but I’ve only stumbled across them this year.

Ctrl+Backspace deletes the last word.

Ctrl+Delete deletes the next word.

And of course Ctrl+W in bash (as in VIM) is very useful when the length of your command gets out of control.

Shortcut: Merge windows in Firefox

March 11, 2007

Ever had more than one Firefox windows open, with tabs and ideas scattered all over the place? What a mess! The good news: it’s easy to fix. You’ll need the Tab Mix Plus extension.

Ctrl + Shift + M

will join all open windows into a single one. This behavior is configurable in Tools > Tab Mix Plus Options > Tab Merging.

Having the option to detach / reattach a single tab would also be useful, but I couldn’t find a quick way to do it, except manually copying the URL and pasting it into a new window.