Execute the following command in terminal,to change the default browser.
sudo update-alternatives --config x-www-browser
Sample output:
karthick@Ubuntu-desktop:~$ sudo update-alternatives --config x-www-browser
There are 3 choices for the alternative x-www-browser (providing /usr/bin/x-www-browser).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/google-chrome 200 auto mode
* 1 /usr/bin/firefox 40 manual mode
2 /usr/bin/google-chrome 200 manual mode
3 /usr/bin/opera 90 manual mode
Press enter to keep the default[*].
Right now I have firefox as my default web browser.
If i want google-chrome as default browser then I will type 3 and hit enter.
Note:
If you want to configure a commandline browser,then you have to configure
sudo update-alternatives --config www-browser
Alternate way is to add the following line export BROWSER=/usr/bin/firefox
to your ~/.bashrc
Add the above line in the last,
Alternative GUI Method:
- You can also set the default browser in Gnome applications,type the following in terminal and press Enter
gnome-default-applications-properties
- It will Open a Window.Now you can choose your preferred browser to set it default.
Thanks to python-gnomekeyring, this is relatively easy:
python -c "import gnomekeyring;gnomekeyring.unlock_sync(None, 'my password');"
Or as a proper script:
#!/usr/bin/env python
import gnomekeyring
gnomekeyring.unlock_sync(None, 'my password');
I think you don't need to install the package. But it can't hurt to try.
Keep in mind that storing your password on your hard disk is an immense security risk. You should be using this instead:
#!/usr/bin/env python
import gnomekeyring
import getpass
gnomekeyring.unlock_sync(None, getpass.getpass('Password: '));
You can save this script, for example, as unlock-keyring.py
and then do the following:
sudo mv unlock-keyring.py /usr/bin/unlock-keyring
sudo chmod a+x /usr/bin/unlock-keyring
From then, you can always just type unlock-keyring
and be prompted for a password. Don't do this with the version that contains your password.
You can replace None
with the name of your keyring, e.g. 'session'
, if you want to unlock one that isn't the default.
I'm having a hard time testing this properly, so please let me know if it doesn't work and I'll take a look at it right away. Also let me know if it does work :-)
Best Answer
You can store those arguments in
/etc/chromium-browser/default
Then set it appropriately