Type the following in a terminal.
For Thunderbird:
gsettings set org.gnome.desktop.default-applications.office.calendar exec thunderbird
For Chromium
gsettings set org.gnome.desktop.default-applications.office.calendar exec "chromium-browser 'https://www.google.com/calendar'"
I've put together this solution to resolve your issue, and tested it on KDE and XFCE with opening text files and font files. It is a generic solution that should be applicable to any number of desktop environments and mime types. The way it works is there is a simple python script called custom-open that will open a file using different applications for different desktop environments. These are the steps to setup the solution:
- save custom-open script on your computer preferably on your path but doesn't have to be.
- save .custom-open.ini in your home directory ~/.custom-open.ini
- set custom-open as the default application for any file types you want handled by it.
custom-open
#!/usr/bin/env python
import traceback, sys, os, ConfigParser, os.path
from subprocess import Popen, check_output
from gtk import MessageDialog, MESSAGE_ERROR, BUTTONS_CLOSE
try:
file, desktop = sys.argv[1], os.environ['DESKTOP_SESSION']
mime = check_output(['file', '--mime-type', file]).strip().split(': ')[1]
config = ConfigParser.RawConfigParser()
config.read(os.path.expanduser('~/.custom-open.ini'))
cmd = config.get(desktop, mime)
Popen([cmd] + sys.argv[1:])
except:
msg = "CUSTOM OPEN ERROR\n\n" + traceback.format_exc()
MessageDialog(None, 0, MESSAGE_ERROR, BUTTONS_CLOSE, msg).run()
.custom-open.ini
[gnome]
text/plain = gedit
application/x-font-ttf = gnome-font-viewer
[xubuntu]
text/plain = leafpad
application/x-font-ttf = gnome-font-viewer
[kde-plasma]
text/plain = kate
application/x-font-ttf = kfontview
so what's great about this solution is that you can add as many new desktop environments as you want and as many mime type you want. to check what name you should provide for the desktop environment run the below command in a terminal.
env | grep -i DESKTOP_SESSION
to check the exact mime type of a file just run:
file --mime-type filename
EDITED: The need for symbolic links has been removed this should make it easier to use. I've also added a graphical error handler that will bring up an alert if an error occurs.
Best Answer
Oh thank god, I have a solution.
First of all the problem is getting caused by "Default Applications" in "Settings" on "GNOME", in order to save the default application for something like browser it overrides whatever it has as default for a set off applications and creates a double entry under
~/.config/mimeapps.list
. This way the default application for that mimetype cannot be changed unless you manually delete the entry for it. To do it:~/.config/mimeapps.list
[Default Applications]
application/xml
, there is a 2nd entry under[Added Associations]
which we want to keepRight Click
>Properties
>Open With
This is probably a bug within GNOME.