Menu

Eaglemode application associations could be simplified using xdg-mime and xdg-open commands

2013-12-23
2013-12-23
  • Ondrej Grover

    Ondrej Grover - 2013-12-23

    When you add an application for a given filetype as per the docs, you are essentially reinventing the wheel, all the /usr/share/applications/*desktop files and /usr/share/mime/ directories already contain all the necessary information as specified by the freedesktop standards.

    I can't say I'm a big fan of freedesktop, but this application framework is actually not that bad. The only problem is that they never supplied a good interface to set MIME associations so most people don't use it.

    But for Eaglemode it would be very simple to implement: You could simply use a modified file and directory view of those directories to provide a very simple and intuitive interface for setting MIME associations.

    Ideally a twin view, one pane with the MIME types hierarchy displaying info from the *xml files and a second pane showing a list of applications and the info in *.desktop files for the list of apps found on the line with the selected MIME type in /usr/share/applications/mimeinfo.cache.
    You could then use the xdg-mime command as a backend to set the default applications for MIME types, e.g. xdg-mime default totem.desktop video/mp4

    If such support is implemented properly, it would make many things a lot simpler, e.g. when the user presses some "Open" button, you could just use the xdg-open command to open it in his preferred application. You could also provide a context menu for a selected file by getting the MIME type of the file by xdg-mime query filetype <somefile> and then just get a list of available apps from /usr/share/applications/mimeinfo.cache for the given MIME type.

     
  • Ondrej Grover

    Ondrej Grover - 2013-12-23

    Just found out that you wouldn't have to create any new parsers! Since you are fond of Perl, you could simply use the code in File::MimeInfo, because the command mimeopen supplied by that package is able to show a list of apps for a given file.

     

Log in to post a comment.