Xdg (or Gnome 3) default applications

I want to change the default applications for certain files as determined by xdg, in this case under cinnamon/gnome 3 but I want it to apply across all DEs implementing freedesktop.org standards.
I have emacs and gvim installed. They both have .desktop files in /usr/share/applications/ which specify their mimetype associations. I happen to have installed emacs after vim, and now I have /usr/share/applications/mimeinfo.cache which seems to be generated from the other files, with lines like, for example:
text/plain=emacs.desktop;gvim.desktop;
Which I assume causes emacs to be selected as the default plain text editor (as indeed it is by xdg-mime query default text/plain shows).
I have three questions:
1. How can I change the default text editor without editing mimeinfo.cache (I assume it is auto-(re)generated) and without removing emacs' mime types (which are correct and should stay)?
2. How do I regenerate mimeinfo.cache?
3. Is there a GUI that allows me to do this stuff (ideally without having to find a file of a particular type to open first - I have tried in Gnome 3: 'System Settings > Details > Default Applications' and there are only a few default 'application types' there, not mime types, and none of them is text editor)?

With reference to: http://standards.freedesktop.org/deskto … 01s07.html
In answer to 1:
It seems the preferences are handled 'externally', and although it doesn't make it clear where it seems to be in /usr/share/applications/defaults.list, I edited min
[Default Applications]
x-scheme-handler/spotify=spotify.desktop
text/plain=gvim.desktop
(in answer to 2:)
I then ran 'sudo update-desktop-database'
And now:
$ xdg-mime query default text/plain
gvim.desktop emacs.desktop
But I'm still interested in the answer to 3, in particular a tool that would change groups of supported mime types and allow you to pick and choose from the lists defined per applications would be useful...

Similar Messages

  • [Gnome 3] Default application for Calendar

    Hi,
    I have done a fresh install of Arch Linux with Gnome 3 yesterday. I haven't installed evolution, I have installed thunderbird with lighting. But in default applications, Gnome 3 show only gedit like calendar app:
    Is this an Arch bug or Gnome bug?

    thunderbird is not a calendar application unless you tune it up with an extension. therefore it shouldn't be in there
    but if you really want it there,you need to append to /usr/share/applications/thunderbird.desktop, to MimeType, text/calendar;text/x-vcard, then run as root update-desktop-database -q
    Last edited by wonder (2011-10-06 13:50:15)

  • XDG standards updated re MIME-type associations + default applications

    In April the XDG standards regarding Association between MIME types and applications was updated, and the changes are quite significant. For example, to specify default applications you should now list them in the [Default Applications] section of a mimeapps.list; placing them in the [Added Associations] section is no longer sufficient. Also, mimeapps.list files may now also be located in the $HOME/config ($XDG_CONFIG_HOME) and /etc/xdg ($XDG_CONFIG_DIRS) directories. The file defaults.list is confirmed as deprecated, as well as a mimeapps.list file in $HOME/.local/share/applications ($XDG_DATA_HOME/applications).
    Just to muddy the waters further, there are $desktop-mimeapps.list ($desktop is the desktop environment: kde, gnome, etc) which may accompany mimeapps.list files on all the paths!
    I'm implementing these new standards in my ayr launcher, but no doubt there will be many applications which will lag behind these new standards. The biggest immediate problem will probably be with file managers which often write the default associations they create to the [Added Associations] section in $HOME/.local/share/applications/mimeapps.list.
    This will not be much fun, but if it's standardising better, then so be it!
    Edit: There is a worked example, but there seems to be a mistake in this - $XDG_CONFIG_DIRS  should come before $XDG_DATA_HOME according to the standard.
    Also, the Default applications page on the Wiki is going to need a substantial revamp.
    Edit2: Overview of main changes
    Last edited by ninian (2014-06-18 23:27:39)

    Have now updated the Wiki section on:
    Using MIME types and desktop entries
    to reflect the new changes.

  • Gnome Default Application for Blank DVD [SOLVED]

    Hello - I'm using Gnome 3.14. When I insert a blank DVD in my DVD drive it asks me whether I want to open it with Anjuta or eject it. Anjuta is a C++ development package so that's no good. How do I change the default application to something like Brasero when I insert a blank DVD? Many thanks in advance.
    Last edited by systemshq (2014-11-11 14:00:23)

    you should be able to change that from gnome-control-center -> Details -> Removable media -> Other media...

  • [SOLVED] pcmanfm lost default applications settings for office docs

    I'm not sure if it was the Libreoffice recent update or not, but I no longer have any application settings for office documents (ppt, doc, xls, ods, odp, odt, etc.). When I right click to choose an application, none are listed. I tried the suggestion from the wiki to install gnome-menus but the situation was no better after a logout/login.
    Even inputting a custom command like:
    /usr/bin/soffice --impress %f
    does not work. It seems that the "Open with" dialog is completely function-less.
    Any suggestions/experience with this?
    Last edited by jwhendy (2011-08-09 22:50:41)

    I fixed this. I just had to figure out the correct mimetypes and re-add them. I still believe this used to be down automatically, but not a big deal. Part of my problem was trying to use xdg-mime to set defaults for "application/ppt" when it's really "application/powerpoint."
    I found this list of mimetypes that was really helpful for setting defaults for .doc, .xls, and .ppt.
    There are also listings for the correct mimetypes for .odt, .ods, and .odp. In the end, my ~/.local/share/applications/defaults.list looks like this:
    [Default Applications]
    application/pdf=evince.desktop
    txt/application=emacs.desktop
    tex/application=emacs.desktop
    application/powerpoint=libreoffice-impress.desktop
    application/msword=libreoffice-writer.desktop
    application/excel=libreoffice-calc.desktop
    application/vnd.oasis.opendocument.presentation=libreoffice-impress.desktop
    application/vnd.oasis.opendocument.spreadsheet=libreoffice-calc.desktop
    application/vnd.oasis.opendocument.text=libreoffice-writer.desktop

  • How to change default application associated with some mime types?

    When we install some new program, for example GIMP, I assume the newly installed program is added to some mime type database, and the /usr/share/applications/mimeinfo.cache file is automatically generated.
    Using my example, GIMP will be the default application for all its registered mime types, even application/pdf. I surely don't want this to happen, and I surely don't want to create all kinds of files that GIMP registered and right click on them and choose Properties and then change it in the Open with... tab. I want to systematically de-prioritize GIMP so that it will not override my previously assigned default applications.
    I wrote a script to modify the mimeinfo.cache file, and it seems to work great. However, after a reboot or upgrade or something I didn't notice, the default application of application/pdf is reconfigured to GIMP. I think the cache suffix of the file indicates that it is just a cache and may be changed by system unnoticed. So I am looking for a new way to change the default applications.
    As far as I know or guess from the phenomena, there should be some system utility that generates the mimeinfo.cache file, it seems to parse all the *.desktop files under /usr/share/applications and register them to certain mime types accordingly. The sequence of the *.desktop files get parsed seems to be related to the time the application is installed, and the newly installed applications seems to be parsed later and inserted in the front of the application list or be parsed earlier and appended to the application list. Is there some place I can change the sequence of the parsing? Or is there some place I can change the behavior of the system utility?
    I know that I can populate my ~/.local/share/applications/mimeapps.list to override the system wide defaults, however, I want a more elegant way to this.
    Any opinion on this is welcomed.
    Last edited by AugustePop (2010-05-14 05:47:15)

    Ah, right. Don't know what DE you are on, but in Gnome:  right-click a (e.g. pdf) file -> Preferences -> Open with.
    All Applications listed there will be available from the right click menu, the marked one will be used on double-click.
    errgrh...
    I surely don't want to create all kinds of files that GIMP registered and right click on them and choose Properties and then change it in the Open with... tab. I want to systematically de-prioritize GIMP so that it will not override my previously assigned default applications.
    I guess what I am trying to propose is this: "de-prioritize" GIMP in its .dekstop file for the types you dont want it to be associated with, and manually add it back in through "Open With" for the file types you want it to be an option. Not sure if this is solving anything for you though
    Last edited by hokasch (2010-05-14 10:28:57)

  • How can I change the default application for a content type?

    Running a version of Linux, the default application for PDF files is "Use Document Viewer (default)", which appears to be /usr/bin/evince. I'd much prefer to use /usr/bin/okular; how can I change the default. This question is NOT about how to change the function that is automatically applied when I access a link, in this case "Preview in Firefox", but rather to the default application that I can select when I download a file being viewed in Firefox's previewer.

    This is real progress, a solution to the problem as posted. The command:
    xdg-mime default okularApplication_pdf.desktop application/pdf
    makes okular the default.
    However when I added okular to the choices for applications in:
    * Edit>Preferences>Applications>PDF
    the popup box that appears when I click Download on the preview page changed. The pulldown menu that appears next to "Open with" used to have 3 entries:
    # Document Viewer (default)
    # Acroread
    # Other
    Now it has only 2:
    # Okular (Default)
    # Other
    I'd like it to read
    # Okular (Default)
    # Acroread
    # Other
    How can I control the entries in this pulldown list?
    Also, how can I make the default choice in the popup box be
    * Open With <whatever> , rather than
    * Save File ?

  • [Solved] Default Applications

    I'm using gnome 3.6.1 and when i try to change default applications from system settings>details>default applications  control center exits without any change! Problem was there since gnome 3.4 but then it just didn't change anything now it exits control center window.
    I'm on x64 and pure systemd system
    Last edited by s0lid7 (2012-11-10 12:42:22)

    I tried to change by opening nautilus as root, right click on file, click on properties, open with tab but when i changed it nautilus closed...
    Here is the terminal output with an error when opening nautilus and the next when i changed default app
    Unable to initialize DBus connection: The connection is closedcannot connect to the session bus: The connection is closed (g-io-error-quark, 18)
    ERROR:nautilus-properties-window.c:1836:schedule_owner_change_timeout: assertion failed: (NAUTILUS_IS_FILE (file))
    Aborted

  • [how to] Thunar forgets preferred / default applications in Openbox

    This was my situation:
    I would set default image viewer to gpicview, default for movies and music was vlc, default for PDF's was evince. After reboot these settings would be forgotten and the system would use gimp for images, mplayer for movies and music and gimp(!?!) for PDF's
    This was my fix:
    edit ~/.bashrc and add this
    #set desktop environment as XFCE so default apps can be managed
    export DE=xfce
    now in terminal follow these ideas...
    1) to check the MIME of a file do this
    xdg-mime query filetype ~/imagelocation/imagename.png
    response is
    image/png
    2) tell it to use a certain program
    xdg-mime default gpicview.desktop image/png
    0) To get the name of the program:
    navigate to /usr/share/applications and get properties on the relavant program. Check the "Launcher" tab and copy the command.

    Thanks, tawan.
    But I can not set my default application correctly.
    What I did is as follow:
    [Desktop:henry 10:37]$ xdg-mime default writer.desktop application/vnd.ms-office
    [Desktop:henry 10:39]$ xdg-mime default mousepad.desktop text/plain
    [Desktop:henry 10:41]$ xdg-open ./doc.doc
    method return sender=:1.10 -> dest=:1.9 reply_serial=2
    but xdg-open still use "mousepad" (my default application for plain text) to open this office doc.
    I don't know what did I do wrong here...?

  • [SOLVED]epiphany, default applications

    Hi,
    after installing gimp epiphany used it as the default application for opening pdf files...very annoying,
    i worked around that with this hack:
    cp ~/.mozilla/firefox/3la1zdhr.default/mimeTypes.rdf ~/.gnome2/epiphany/mozilla/epiphany/
    looks like gnome is in the process of ripping out the firefox backend....so this will probably be solved in the future.
    but for now i would like to tell epiphany to download .nzb files to some specific dir or open it with a shell script - how do i do that?
    Last edited by metalfan (2009-02-16 23:01:53)

    I have the same problem. From what I can see, it's because gimp is listed before evince in /usr/share/applications/mimeinfo.cache:
    grep pdf /usr/share/applications/mimeinfo.cache
    This file is generated with the update-desktop-database command. So I came up with two non-permanent solutions.
    1.  Put evince before gimp in /usr/share/applications/mimeinfo.cache and repeat each time the update-desktop-database command is run, like when you update an application.
    OR
    2. Remove the pdf entry from MimeType line in /usr/share/applications/gimp.desktop and run update-desktop-database as root. You've got to repeat this fix whenever you update gimp.
    I hope that helps.

  • How can i specify the default application to save a read later doc in Instapaper

    I have an Instapaper account, so that I can mark some online web pages to 'read later' if I wish to do this. I have successfully put the Instapaper 'Read Later' borkmarklet on the dock of my iMAC.
       However, whenever, I come across a web page or blog that I wish to read later, and click the 'Read Later' bookmarklet on my dock, it throws up an error message that reads ' There is no default application specified to open the URL' and so I am now at a dead end.
    Can someone explain to me where and how I can find the default application to get round this problem. By the way, I did not find this problem with Instapaper's 'read later' bookmarklet on my old Windows PC, where I was able to store pages for reading later with this app, and also to transfer them automatically to my kindle through the wifi connection at home.
    I hope someone can assist... Or is there another way - (apart from Instapaper which worked okay with Windows)- to save web pages for reading later with MAC -
    Thanks

    This is pretty simple in Safari, in the upper left of Safari you will see an icon that looks like pair of glasses, this is where you collect webpages for you to read later. The feature is called Reading List and looks like:

  • How to change default application in file context menu

    I know you can change the application that opens a file in the file;s info window (command i) and then double clicking the file opens it in that application. However the context menu still shows the same original default application. How to change what is shown as default in context menu?

    You can't. You can change the default app in Get Info which will change the first listed app in the context menu to that default app. How the context menu is built is not under user control.

  • How do I change the default application to open files.

    I am rather new to Mac OS (using Leopard). I am rather frustrated, that I have not been able to find a way to change the default application that opens PDF files. I looked around the System Prefernces, couldn't find it, searched the Web, nothing. And I could not find an answer in this forum either.
    So here is my question. How do I change the default application for opening PDF files from Preview to Adobe Reader? I do not want to have to click "open with" every time, I want to open a PDF file.
    And how do I do this for other files also? For instance, I may want to open images files with Photoshop instead of Preview.

    Hey ! I was going mad with the same question - and I'm not a complete newbie - so thanks to William for answering it - I knew I'd seen that dialog somewhere, but just couldn't find it. Text edit was driving me crazy telling me that .ppt files were screwed, now I've got em to open with Powerpoint...
    In answer to your last question, Craig, the dialog that appears to ask if you're sure specifically says the change will relate to all .pdf files ( or .ppt or .whatever ), so it won't stop Preview from opening other types of files.
    Thanks for the help - searched Apple support in vain on this one...

  • Set default application for *all* users

    Hello people, my 1st post here, so forgive me for possible imprecisions, ambiguity, inappropriateness....
    When I search how to set/change the default app for opening some type of file I always find the answer "through the getinfo". But doing that, I only change the default application for the current user.
    I want to do that for all users of my mac, without repeating the getinfo process for each of them.
    Is there any adminstrative tools for doing that?
    Thank you.

    You could download and install RCDefaultApp 2.1 for all users: check the Read Me and then test it on something to see if it accomplishes what you want.
    http://www.rubicode.com/Software/RCDefaultApp/

  • Open file in default application with unsigned webstart

    Hi,
    Is it possible to open a document in the user's default registered application (on the OS) from an unsigned Java webstart application?
    I don't mind if the user gets a warning, but the only thing I found was the ability to save a file (also with a user warning), but I'd like to automatically open the document generated by the webstart application in the default application on the OS registered for the file association. In this case either a *.xlsx (Excel/OpenOffice) or *.xml file
    Any ideas?

    You can use BasicService.showDocument() to do this, however you will get a blank windows opened in the default browser.

Maybe you are looking for

  • As on DAte

    Hi, Discorverer 11g i am using oracle r12 and discoverer 11g i am new to discovere.i need the "As on date" in my report where user can enter end date and got the detail report from begining of perod upto to the date enter by user.please guide me with

  • How can you transfer photos from one phone to another

    How can you transfer photos from phone to phone

  • Single user mode or client install?

    Finally got my mini server ordered again (long story maybe later) I will be using it as my main computer and am wondering what is the easiest set up, boot up in single user mode or install SL client? JJ

  • On preview or publish captivate 4 plays all animations

    Hello, I have a weird problem.  I have two slides that previously ran well on preview and publish.  First, I tried importing them into my presentationg, but captivate went crazy with them...it seemed to try to play all of my text animations at once,

  • Calendar Server Fails to start correctly

    On bringing up components on comm suite 5, when I bring up the calendar server the admin server fails and the http server timesout. # ./start-cal Connecting to watcher ... Launching watcher ... Starting ens server ... 14546 Starting store server ....