Wednesday, June 27, 2007

keyboard shortcut to launch web browser

i want to use a keyboard shortcut to launch my web browser. i'm currently using Gnome on a Debian system. on the top panel choose Desktop -> Preferences -> Keyboard Shortcuts. in the keyboard shortcuts window, select Launch Web Browser and enter the desired key combination. i chose ctrl-alt-w as my key combo.

when i used my key combo the first time it launch a gnome web browser. i would prefer to use opera or firefox, so i needed to modify which browser the key combo fired off. after googling i discovered a mechanism called alternatives. this is basically a set of symbolic links divided into catagories that can be configured. if you execute update-alternatives --list gnome-www-browser you get  /usr/bin/firefox and /usr/bin/w3m printed out. you can modify which alternative is chosen.

there is a gnome gui version called galternatives. use apt-get or another package manager to install it. then execute galternatives from the command line as root. select a category in the left side pane and choose an alternative in the right side pane or a new alternative by providing the path of the executable. so i chose gnome-www- browser, clicked the add button and entered /usr/bin/opera. close out galternatives and press my key combo. now opera is launched with ctrl-alt-w.

No comments: