LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Blogs > linux-related notes
User Name
Password

Notices


Just annotations of little "how to's", so I know I can find how to do something I've already done when I need to do it again, in case I don't remember anymore, which is not unlikely. Hopefully they can be useful to others, but I can't guarantee that it will work, or that it won't even make things worse.
Rate this Entry

mimeopen: a nice tool to setup default applications

Posted 10-05-2013 at 12:06 AM by the dsc

File association and default applications can be quite complicated, and hard to remember, specially if you have a hybrid environment, using stuff from Gnome, KDE, and whatever, while not being in none of the big ones, but on openbox or something.

One common source of problems are associations within web browsers, like firefox or chrome. They'll often have their own or use some secondary/wrong file association. I was having this problem with Google Chrome, "show in folder" for a download would open the folder with baobab, which is quite idiotic. Baobab wasn't set as a default "file manager" (which it even isn't) anywhere I could find, not in KDE's system settings and nor in gnome/gtk, as far as I could tell.

Then I found a useful post on Arch linux' forums:


Quote:
Originally Posted by Peanut
You can set the default applications (used by e.g. xdg-open) by installing the package perl-file-mimeinfo from the repositories, and invoke the mimeopen command like this:
Code:
mimeopen -d /path/to/file
You will then be asked what application to use when opening /path/to/file:
Code:
Please choose a default application for files of type text/plain

        1) notepad  (wine-extension-txt)
        2) Leafpad  (leafpad)
        3) OpenOffice.org Writer  (writer)
        4) gVim  (gvim)
        5) Other...
Your answer will be set as the default handler for that type of file. Works like a charm smile
If you really want to, you can also modify ~/.local/share/applications/defaults.list manually; the format is quite simple:
Code:
image/png=image-viewer.desktop
video/x-matroska=video-player.desktop
(...)
Which I happened to have even though I don't remember having installed it. It's obviously available on Debian, then.

In order to set the default application for folders to Konqueror in the file-manager mode, I had to type "other", and give as input: konqueror --profile filemanagement.
Posted in Uncategorized
Views 5842 Comments 4
« Prev     Main     Next »
Total Comments 4

Comments

  1. Old Comment
    mimetype and mimeopen work so much better than xdg-open, especially as i run a custom DE, xdg-* only really supports kde/gnome/xfce
    Posted 11-12-2016 at 09:09 AM by Keith Hedger Keith Hedger is offline
  2. Old Comment
    I think that fairly recently I've had problems with file associations, but unfortunately I had forgotten about this tool then, and sorted it out in a much more annoying and clumsy manner, whatever it turned out to be.
    Posted 11-17-2016 at 03:55 PM by the dsc the dsc is offline
  3. Old Comment
    Thanks. I'll look into this, rather than xdg-open for my Openbox pipe menus. Maybe it will make sharing them easier. xdg-open works for me, never ran into any issue Keith has (I use Openbox, no DE) but then again I guess some application I have installed may have pulled in what makes it work.
    Posted 11-20-2016 at 03:54 AM by goumba goumba is offline
  4. Old Comment
    xdg-open will ise the native desktop tools to open files if the desktop is detectable, eg exo-open when using xfce.
    Posted 11-20-2016 at 06:13 AM by Keith Hedger Keith Hedger is offline
 

  



All times are GMT -5. The time now is 09:15 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration