annotate bin/setdefaultbrowser.sh @ 694:ebca6d85213a

File "/usr/lib/python3/dist-packages/IPython/config/__init__.py", line 16, in <module> from .application import * File "/usr/lib/python3/dist-packages/IPython/config/application.py", line 31, in <module> from IPython.config.configurable import SingletonConfigurable File "/usr/lib/python3/dist-packages/IPython/config/configurable.py", line 33, in <module> from IPython.utils.text import indent, wrap_paragraphs File "/usr/lib/python3/dist-packages/IPython/utils/text.py", line 28, in <module> from IPython.external.path import path File "/usr/lib/python3/dist-packages/IPython/external/path/__init__.py", line 2, in <module> from path import * File "/home/jhammel/python/path.py", line 25 print root(path) ^
author Jeff Hammel <k0scist@gmail.com>
date Wed, 09 Jul 2014 16:26:49 -0700
parents 5af627460928
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
341
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 #!/bin/bash
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2
345
0694882a1ad8 moar dox!
Jeff Hammel <jhammel@mozilla.com>
parents: 341
diff changeset
3 # To get all selections:
500
5af627460928 changes
Jeff Hammel <jhammel@mozilla.com>
parents: 345
diff changeset
4 # update-alternatives --get-selections
341
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5
345
0694882a1ad8 moar dox!
Jeff Hammel <jhammel@mozilla.com>
parents: 341
diff changeset
6 # To get a particular selection:
0694882a1ad8 moar dox!
Jeff Hammel <jhammel@mozilla.com>
parents: 341
diff changeset
7 # update-alternatives --display x-www-browser
0694882a1ad8 moar dox!
Jeff Hammel <jhammel@mozilla.com>
parents: 341
diff changeset
8
341
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 # http://askubuntu.com/questions/100693/how-can-i-manually-change-the-default-web-browser
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 # http://askubuntu.com/questions/45885/how-do-i-set-a-custom-browser-as-default-in-preferred-applications?rq=1
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 # http://fvue.nl/wiki/Linux:_Default_browser
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 # cat /proc/$(pidof krunner)/environ | tr '\000' '\012' | grep BROWSER
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 if [[ $(whoami) != 'root' ]]
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16 then
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 echo "Must be run as root"
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18 exit 1
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 fi
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21 BROWSER=/home/jhammel/firefox/firefox
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22 PREFIX=/usr/bin
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23 for LINK in gnome-www-browser x-www-browser
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
24 do
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
25 LINKPATH=${PREFIX}/${LINK}
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
26 update-alternatives --install ${LINKPATH} ${LINK} ${BROWSER} 99
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
27 update-alternatives --install ${LINKPATH} ${LINK} ${BROWSER} 99
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
28 update-alternatives --set ${LINK} ${BROWSER}
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
29 update-alternatives --display ${LINK}
345
0694882a1ad8 moar dox!
Jeff Hammel <jhammel@mozilla.com>
parents: 341
diff changeset
30 # unlink ${LINKPATH}
0694882a1ad8 moar dox!
Jeff Hammel <jhammel@mozilla.com>
parents: 341
diff changeset
31 # ln -s ${BROWSER} ${LINKPATH}
341
4387fa22807f what a fuck; http://askubuntu.com/questions/20590/set-default-browser-to-open-browser
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
32 done