comparison bin/setdefaultbrowser.sh @ 341:4387fa22807f

what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
author Jeff Hammel <jhammel@mozilla.com>
date Sat, 22 Jun 2013 09:54:06 -0700
parents
children 0694882a1ad8
comparison
equal deleted inserted replaced
340:576edf9dee2e 341:4387fa22807f
1 #!/bin/bash
2
3 # sudo update-alternatives --get-selections
4
5 # http://askubuntu.com/questions/100693/how-can-i-manually-change-the-default-web-browser
6 # http://askubuntu.com/questions/45885/how-do-i-set-a-custom-browser-as-default-in-preferred-applications?rq=1
7 # http://fvue.nl/wiki/Linux:_Default_browser
8
9 # cat /proc/$(pidof krunner)/environ | tr '\000' '\012' | grep BROWSER
10
11 if [[ $(whoami) != 'root' ]]
12 then
13 echo "Must be run as root"
14 exit 1
15 fi
16
17 BROWSER=/home/jhammel/firefox/firefox
18 PREFIX=/usr/bin
19 for LINK in gnome-www-browser x-www-browser
20 do
21 LINKPATH=${PREFIX}/${LINK}
22 update-alternatives --install ${LINKPATH} ${LINK} ${BROWSER} 99
23 update-alternatives --install ${LINKPATH} ${LINK} ${BROWSER} 99
24 update-alternatives --set ${LINK} ${BROWSER}
25 update-alternatives --display ${LINK}
26 echo
27 unlink ${LINKPATH}
28 ln -s ${BROWSER} ${LINKPATH}
29 done