Before I started using Linux as my default OS I used Mac OS for 5 years. In Mac OS the TAB key behaves different in Firefox than Ubuntu (my preferred distro). When using the TAB key in Mac OS it focuses on input fields only rather than every object (images, links, whatever) in a web page .

Today I finally took the time to find out what the difference between the Firefox in Mac OS and Ubuntu. I opened the about:config and searched for “tab”, and what do you know. I found an option called “accessibility.tabfocus” which was set to the value “7″.

A quick google search brought me to this site which tells you everything you want to know about accessibility.tabfocus.

If you want TAB behavior like the one in Mac OS you simply change the value of accessibility.tabfocus to “1″, et voilà, it works!

You can combine options. For example you can set the value “3″ to select any form element on a web page. Read more at http://kb.mozillazine.org/Accessibility.tabfocus.

edit:

For those who didn’t know; you can press Shift+TAB to focus the previous selected element.

This may be old news, but I didn’t notice this before today (thanks to Emil for the tip):
You can actually get the Spotify URI’s to work with wine!

To get this working for Firefox all you have to do is:

Make a runable bash script

echo '#!/bin/sh' > ~/.browser2spotify
echo 'exec wine "C:\Program Files\Spotify\spotify.exe" /uri "$@"' >> ~/.browser2spotify
chmod 755 ~/.browser2spotify

Add settings to Firefox

First open the config window (type about:config in the address field).

You now want to add the following options:

network.protocol-handler.external.spotify = True
network.protocol-handler.app.spotify = ~/.browser2spotify

The last option may vary depending on where you put your browser2spotify script.

You can find everything in this post at http://www.spotify.com/en/help/faq/wine/. They also have a howto for Opera.

Today I decided that I’m going to give twitter another try, but the first thing that struck me was how cumbersome it was to actually post a tweet.

The way I did it:

  1. Open your favourite browser
  2. Go to twitter.com
  3. Log in
  4. Write a tweet

I’m a Linux user and I love the terminal. Wouldn’t it be better to write tweets from the terminal? – Yes it would!

I have written a quick and dirty python script that enables you to write tweets from the terminal.

You can download the script here.

Install guide for Debian:

Step 1: Download

$ wget http://dibon.net/tweet
$ chmod +x tweet
$ sudo mv tweet /usr/bin/

Step 2: Install curl

The script uses curl to send data to twitter, if you don’t have curl installed you have to install it:

$ sudo aptitude install curl

Step 3: Make the config

Make a file called “.tweet” in your home directory:

$ vim .tweet

And insert the following:

[login]
username = YOURUSERNAME
password = YOURPASSWORD

You may want to edit the permissions for the file

$ chmod 0700 .tweet

That’s about it. You may have you reopen your terminal window before you can use the tweet command.

Usage:

$ tweet "I'm writing a tweet in terminal!"

Unfortunately it is necessary to use single or double quotes before and after the message.

For the last years I’ve been using Mac OS X, but now I’m running Ubuntu. Ubuntu has very much functionality build in, but the Norwegian mac keyboard layout isn’t that great out of the box.

There are three steps required to get the layout partially[NB!] right:

  1. Change 3rd level chooser and switch Alt / Win (cmd) key.
  2. Edit the XKB-file to get keys right.
  3. Set the keyboard in  Ubuntu to “Norway Macintosh”
Step 1:

Open the keyboard settings (System -> Preferences -> Keyboard) and click the “Layouts” tab. Then click the “Other options…” button.

1.1) Press “Alt/Win key behavior” and choose “Left Alt is swapped with left Win-key”.
1.2) Press “Third level choosers” and select “Press any of Alt keys to choose 3rd level” (or “Press left Alt keys to choose 3rd level”).

Step 2:

This part is a bit more tricky.

Open the terminal and open the folder “/usr/share/X11/xkb/symbols”

$ cd /usr/share/X11/xkb/symbols

The file we are going to edit is named “no”, but before we begin lets backup the file!
From now on every command run as root (noted by #).

# cp no no_backup

Now open the “no”-file with your favorite editor, I’m using VIM.

# vim no

Scroll down to the part which starts with:

// Copied from macintosh_vndr/no
partial alphanumeric_keys
xkb_symbols "mac" {

You now need to change the following lines:

key <TLDE>  { [      bar,    section, brokenbar, paragraph    ] };
to:
key <TLDE>  { [      apostrophe, paragraph, bar, brokenbar ] };

And:

key <AE04>    { [         4,  currency,       dollar,       dollar ]    };
to:
key <AE04>    { [         4,   dollar,       currency,       dollar ]    };

Then save.

Step 3:

The only thing remaining is to select “Norwegian Macintosh” as your default keyboard layout.
In System -> Preferences -> Keyboard, press the “Layouts”-tab and press the “+”-button.

If everything is done right you should have the basic Norwegian mac layout.

NB!

This layout is not equivalent to the real Norwegian mac layout. There is a lot of keys that needs mapping to do so. The original layout looks like this (keys are pressed from left to right).

Edit:

It seems that if you use the newer versions of Apple’s keyboard you have to change the setup for the TLDE-key and the LSGT-key. I don’t know why, but it works!