DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I had been using Debian Wheezy for a few months and as soon as I began to use it, I noticed the file associations did not please me. That alone I found inconvenient, because I always have a very comprehensive .mailcap file in my HOME directory. It seems Debian completely ignores it.
I always use LXDE/Openbox/pcmanfm, so I would right-click a file, select "Open With..." then go to the second tab "Custom Command Line" to enter the name (it won't accept full path) of the application that should open that file. I also selected the box that says "Set selected application as default action for this file type."
It used to work. The application I chose would work every time. With one frightful exception: wine.
I once updated Wine then ran 'winetricks' or some such combination and... many file types were associated with Windows programs. Plain text files would open with Notepad or Wordpad, images would open in a Windows stock image viewer and something else would invoke Internet Explorer. That was all really awful because I hate those applications and they take a long time to launch and just let me read the text or view the image.
I migrated to Debian Jessie very recently and even before I install wine, I am having problems. For example, Debian really absolutely adamantly wants to open all plain text files with Libre Office Writer, a choice that I deeply resent because it usually takes a while to load and it's overkill for a plain text file. Using the "Open With..." then "Set selected application as default action for this file type" trick isn't working this time. The .mailcap file is still ignored. I don't know what else I can do.
And I still need wine, but now I'm afraid of installing it because it will associate lots of my file types to horrible Windows stock applications.
Hmm... I think I got the habit of relying on .mailcap when I used Puppy Linux. I think that distro honors the .mailcap file system-wide, if my memory serves.
The .txt file association is now working correctly after a reboot. Maybe rebooting fixes it. I don't know.
I still haven't gotten around to installing Wine. I dread it.
Interesting, but seems incorrect in my case. I checked ~/.local/share/applications/defaults.list and ~/.local/share/applications/mimeapps.list. They are identical, and contain this:
...plus 100 lines, all about audio. I am now struggling with image files.
I found all the offending associations (including vlc for video, which I hate but I need it because god knows why only in Jessie it is required for kid3, which I love) in /etc/mailcap. But I edited /etc/mailcap and nothing changed.
I was fooling around with the menus and found something that almost solves all of my problems:
Menu > Preferences > Default applications for LXSession
On the terminal, that's lxsession-default-apps.
Note this works on Debian/LXDE. I don't know about other graphical environments.
I could fix almost all of the associations that were annoying me. The notable exception is associating movies with mplayer. That one just doesn't work at all. Coincidentally, it's the one application I choose that doesn't have any icon, so I wonder if this has to do with .desktop files (or lack thereof).
I will rate this SOLVED for now because it might help googlenauts.
I had marked this thread as solved, but have to revert back to unsolved. This problem is driving me crazy. I have problems with video files.
I like to use mplayer. I messed with "Default applications for LXSession" (mentioned above) and seemed to associate mp4 files with it. Videos are played immediately when I hit an mp4 file. But other formats, such as the much more common avi, do not. Instead, I get the dialog (in pcmanfm, LXDE/Openbox, Debian Jessie) that asks me what program to use to open the file.
On Debian Wheezy, I could select a program (or even the command line with arguments if so desired) and check "Set selected application as default action for this file type" and the association would become permanent. That does absolutely not work on Jessie. The file runs, but the system forgets my preference. I've messed with "Default applications for LXSession" some more but still can't make the system learn that avi files must be opened with mplayer.
wine sucks.
it puts lots of stuff into ~/.local/share that interferes with filetype associations. just delete most of it.
i use pcmanfm and generally don't have problems with filetype associations.
with mplayer, have you done this: http://iki.fi/dt/stuff/pcmanfm-openwith.png (note "optional, set it to keep association")?
it should work, but you have to repeat it with every movie type (.avi, .mp4, .mkv...).
or, go to ~/.local/share/applications/*.desktop and edit/delete desktop files.
there must be a tutorial somewhere on how to edit .desktop files and what you can do with them...
I read all the replies and referenced material and couldn't find a way to fix the problem. Apparently, no one knows why custom file association works fine on Wheezy (it sticks) but won't work on Jessie (it's lost), so I installed smplayer and got this over with.
Thanks to all the dudes for sharing, like, just their opinion, man.
So I was browsing Synaptic and saw mplayer on it. And it was NOT marked as installed. How can that be? I've had it for a very long time. What do I have then? I tested it. It ran. But some subtitles were not working. I ran 'man mplayer' and got nothing. I didn't have the man pages. Honestly, I don't know what I've had.
So I installed this other mplayer. Do I have two now? Whatever. Bear with me.
I am not happy associating my video files with smplayer2. Absolutely not. I must have them all associated with pure, gui-less mplayer (actually, mplayer2). But LXDE really won't let me have that. It's adamant.
So I renamed /usr/bin/smplayer2 to something else and symlinked:
# ln -s /usr/bin/mplayer2 /usr/bin/smplayer2
That does not work! Files just won't open anymore. They used to open with the atual smplayer2, but won't open with /usr/bin/mplayer2 disguised as smplayer2.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.