LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 04-22-2015, 05:42 PM   #1
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 1,038

Rep: Reputation: 83
Problems with file associations (Debian Jessie)


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.
 
Old 04-23-2015, 09:50 AM   #2
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
That '.mailcap' file is used by some apps only. E.g. mutt email client uses it.
 
Old 04-23-2015, 06:48 PM   #3
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 1,038

Original Poster
Rep: Reputation: 83
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.
 
Old 04-26-2015, 01:09 PM   #4
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 1,038

Original Poster
Rep: Reputation: 83
Well, the file association for .txt seems to have been fixed somehow I don't understand.

Now I try to fix association for image files and just can't. Rebooting doesn't help. This has to be a bug. :-\
 
Old 04-26-2015, 01:36 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4867Reputation: 4867Reputation: 4867Reputation: 4867Reputation: 4867Reputation: 4867Reputation: 4867Reputation: 4867Reputation: 4867Reputation: 4867Reputation: 4867
AFAIK, Debian uses the XDG tools for file associations. You can use xdg-open to set the filetype associations, description here: https://wiki.archlinux.org/index.php...#Configuration
 
Old 04-26-2015, 05:02 PM   #6
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 1,038

Original Poster
Rep: Reputation: 83
Quote:
Originally Posted by TobiSGD View Post
AFAIK, Debian uses the XDG tools for file associations. You can use xdg-open to set the filetype associations, description here: https://wiki.archlinux.org/index.php...#Configuration
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:

[Default Applications]
application/x-designer=designer-qt4.desktop;
application/x-ms-dos-executable=wine.desktop;
audio/x-minipsf=audacious.desktop;
audio/x-psf=audacious.desktop;
application/vnd.apple.mpegurl=audacious.desktop;
application/xspf+xml=audacious.desktop;
application/x-smaf=audacious.desktop;

...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.
 
Old 05-05-2015, 12:05 AM   #7
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 1,038

Original Poster
Rep: Reputation: 83
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.
 
Old 07-29-2015, 10:53 PM   #8
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 1,038

Original Poster
Rep: Reputation: 83
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.

What else can I try???
 
Old 07-31-2015, 07:48 AM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,322
Blog Entries: 9

Rep: Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404
first wine, now 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...
 
Old 07-31-2015, 10:21 AM   #10
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 1,038

Original Poster
Rep: Reputation: 83
Dude, yes, I did that, I said so right there and I said it twice!
 
Old 08-01-2015, 06:38 AM   #11
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 15,322
Blog Entries: 9

Rep: Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404Reputation: 4404
Dude or Duderina, that is a very short reply to a variety of suggestions i made.
are you sure this is the right way to get help with your problem?
 
Old 08-01-2015, 06:57 AM   #12
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
@Dude (OP): https://wiki.debian.org/MIME
 
Old 08-03-2015, 02:54 PM   #13
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 1,038

Original Poster
Rep: Reputation: 83
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.
 
Old 11-09-2015, 06:54 PM   #14
lucmove
Senior Member
 
Registered: Aug 2005
Location: Brazil
Distribution: Debian Stretch
Posts: 1,038

Original Poster
Rep: Reputation: 83
I am reopening this thread.

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.

Why not?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Problems with Radeon video card in Debian Jessie testing okiemel Linux - Software 5 01-04-2014 05:45 PM
[SOLVED] Debian Jessie + Enlightenment E17 Git`s - problems BaptismOfFire Linux - Software 2 10-16-2013 03:48 PM
KDE4 -- Debian Squeeze -- I can't get file associations to use Amarok ajnabi Linux - Desktop 0 09-20-2012 09:30 AM
File associations in Gnome Commander vs. associations in Nautilus taylorkh Linux - Software 0 01-01-2010 05:18 PM
Problems with Gnome (Nautilus, gdmsetup, file associations) cdavidson Linux - Desktop 0 04-09-2007 02:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 10:16 AM.

Main Menu
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