Hello, my name is rabit and I’m posting a guest blog post on Jonathan’s blog.
If you are running a version that is 2.0 or older download this extension and save yourself the trouble.
If you search around the Internet it seems like there is an updated version of that extension that is floating around unsigned, but I figured I would give this a try.
This tutorial is intended for people running Debian Squeeze, but could be applied to other distros as well with some modifications.
I must first preface by saying I’m left handed. And that is probably the only reason why this whole adventure began.
The default mod key for xmonad is alt; most people change this to the windows key but that is just took awkward for me to use. Because of this, a lot of my current alt bindings need to be altered, including those in Firefox.
With my current setup, alt is tied to several different things. The most notable of which is Iceweasel (Firefox).
So I had two options: change Firefox or continue to suffer.
I chose to take on Firefox and change the keys. This is what I did:
Open up a terminal session as root. This can be dangerous, but this is necessary to edit the files we want to change.
sudo -s
Now change your directory to /usr/share/iceweasel/chrome.
cd /usr/share/iceweasel/chrome
Use ls to make sure that browser.jar is in here. Under normal terminal configuration this should show up red. If it is not, search for it.
find /usr/share/iceweasel -iname "*browser.jar*"
Now that we have found it, we need to get access to the files inside. Use the unzip command for this one. You will need unzip which you can most likely get from your package manager.
unzip browser.jar
This will extract a whole mess of files but we only want to look at one. Use your favorite text editor to tweak our target.
nano content/browser/browser.xul
I edited this line and the few behind.
<key id="key_selectTab1" oncommand="gBrowser.selectTabAtIndex(0, event);" key="1" modifiers="alt"/>
To:
<key id="key_selectTab1" oncommand="gBrowser.selectTabAtIndex(0, event);" key="1" modifiers="accel"/>
The key id = the command that you are changing the keys to.
For the modifiers, there are a few important ones:
ctrl = accel
alt = alt
The keys = just about any key.
Once you’re done, save and exit.
Repackage the file as a jar (you can use jar or zip command for this) and you replace the old one. Make sure you back up the original.
Restart Iceweasel and VIOLA keys have been changed.