You are not logged in.

#1 2013-02-02 14:12:14

bance
Member
From: London, UK
Registered: 2012-07-11
Posts: 8

Changed mime type associations !

I recently installed gimp, and now when I open any downloaded pdf files, they are opened in gimp.

Files previously downloaded and saved are however opened in 'evince'. I use open-box, Chromium, Rox-filer and evince, as DE, browser, file-manager and document viewer respectively.

I searched the wiki and found two entries that I thought might help, Default Applications and Custom file associations, I've tried both user specific options in these pages, here are the files I created:-

 
[bance@archbox ~]$ cat .local/share/applications/defaults.list 
[Default Applications]
pdf=evince.desktop
[bance@archbox ~]$ cat .local/share/applications/evince.desktop 
[Desktop Entry]
Name=Evince
Exec=/usr/bin/evince
MimeType=application/x-evince
Icon=evince
Terminal=false
Type=Application
Categories=DocumentViewer
Comment=

Neither of these has worked, do the files look ok? Have I made a mistake somewhere?

OK whilst writing this post, I noticed that I have a file /usr/share/applications/mimeinfo.cache, It contains a list of mime type associations, would editing this work?

TIA Steve

Offline

#2 2013-02-02 14:21:09

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,866

Re: Changed mime type associations !

On my LXDE/openbox system, the defaults.list file is not present.

It's likely created/used by 1 of the WM/DE combos like kde/gnome/xfce .

Check the wiki on xdg-open & xdg-mime .

Last edited by Lone_Wolf (2013-02-02 14:21:36)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Online

#3 2013-02-02 14:47:59

bance
Member
From: London, UK
Registered: 2012-07-11
Posts: 8

Re: Changed mime type associations !

Thanks Lonewolf,

Those files didn't exist on my system either, but the wiki suggest "edit or create" so I created them.....

Took a look at 'xdg-open/mime' on the wiki, and tried :-

xdg-mime default evince.desktop application/pdf

It didn't change .local/share/applications/defaults.list as it should have... it created a new file called mimeapps.list in the same dir?

Now when I try to open a downloaded pdf it tries to use evince but errors with "error opening file no such file or directory'

What could it be?

I also use middori no problem there, so it must be a chromiun issue.

Last edited by bance (2013-02-02 14:55:28)

Offline

#4 2013-02-02 16:01:19

browntown
Member
From: Salem, OR USA
Registered: 2012-11-20
Posts: 63

Re: Changed mime type associations !

I don't know if this helps you, but I've been fighting chromium on mime-types for a while, and finally figured out the problem on my openbox system.  xdg-open has pcmanfm as the hard coded fm (at least on my machine).  Since I don't use pcman, everything broke.

So, after editing

$ sudo nano ~/.local/share/applications/mimeapps.list

to include

inode/directory=spacefm-folder-handler.desktop;

I then edited xdg itself

$ sudo nano /usr/bin/xdg-open

and changed the line that reads: pcmanfm "$file"  to spacefm "$file"

Suddenly everything works when I click on downloads in chromium.

Offline

#5 2013-02-02 16:54:29

bance
Member
From: London, UK
Registered: 2012-07-11
Posts: 8

Re: Changed mime type associations !

Thanks browntown,

tried your solution but it doesn't work for me.... if I try to open a downloaded pdf ..... nothing happens!

Offline

#6 2013-02-02 17:34:14

browntown
Member
From: Salem, OR USA
Registered: 2012-11-20
Posts: 63

Re: Changed mime type associations !

If you go into your filemanager (space pcman etc) and click on various files, do they open?  confirm that xdg-open works by calling it in a terminal for a pdf file.  Navigate to a directory with a pdf like Downloads

$ xdg-open ~/Downloads/crap.pdf

See what xdg tells you.  For pdf's I have the following in my ~/.local/share/applications/mimeapps.list

[Added Associations]
audio/mpeg=deadbeef.desktop;
inode/directory=spacefm-folder-handler.desktop;
image/jpeg=gpicview.desktop;
application/pdf=epdfview.desktop;
text/plain=leafpad.desktop;

[Default Applications]
pdf=epdfview.desktop
application/pdf=epdfview.desktop

I just realized I have epdf in there three times, but I would try to put your pdf handler as both the application/pdf= and pdf=

Just spitballing.  I'm a beginner at this.

Offline

#7 2013-02-02 20:13:23

bance
Member
From: London, UK
Registered: 2012-07-11
Posts: 8

Re: Changed mime type associations !

Yeah,

I've only been running Arch for a few months now, but I have to admit I love it!!!

I really think the problem is with Chromium, I can open pdf's if they are in my FS, but I'm not sure what Chromium does with the file before it's saved to the FS, you know when its downloaded but not yet saved to a directory.

Running xdg-open on a saved file utilises evince as you would expect it to.

One thing, though if I go to downloads in Chromium and try "show in folder' nothing happens..... Then if I left click the mouse and select open I get four instances of evince with a "no such file' error. WTF!

Thank's for taking the time with this.

Steve

Offline

#8 2013-02-02 23:49:56

browntown
Member
From: Salem, OR USA
Registered: 2012-11-20
Posts: 63

Re: Changed mime type associations !

you need!! the inode/directory setting in the mimetype list.  That's what chromium reads to autopen your file manager. 

Make sure it matches the .desktop file appropriate for your file manager.  In the case of spacefm, it is not spacefm.desktop as you might expect, it is spacefm-folder-handler.desktop.

Check your .desktop files for your fm.

If you're still having trouble, you might want to post your mimeapps.list
I noticed in post1 you were using defaults.list instead.  Reading the wiki is not super clear on this, but since I downloaded the pkg 'mimeo' I used mimeapps.list instead.

I assume you read the file extension portion of the chromium part of the wiki:
https://wiki.archlinux.org/index.php/Ch … sociations

Moderator: Please take care to not duplicate entries when you forgot some information. Use the "Edit" button instead. And if you did inadvertently as in this case, please notify the moderators with the "Report" button so they can take action.
Deleting the doubled entry. -- bernarcher

Last edited by bernarcher (2013-02-03 02:00:49)

Offline

#9 2013-02-03 00:50:44

bance
Member
From: London, UK
Registered: 2012-07-11
Posts: 8

Re: Changed mime type associations !

hey browntown,

Seems like I might be close,when I did :-

xdg-mime default evince.desktop application/pdf

It was for my document viewer.... Probably should have done:-

xdg-mime default rox.desktop application/pdf

for my file manager!!!

I'm going to rename the files that were created thus, and try again.....

Here is my mime.list file

[bance@archbox ~]$ cat .local/share/applications/mimeapps.list 

[Default Applications]
application/pdf=evince.desktop
inode/directory=rox.desktop

I manually changed the 'inode'entry....

Offline

#10 2013-02-03 01:08:26

dag
Member
From: US
Registered: 2013-01-20
Posts: 216

Re: Changed mime type associations !

I have evince and gimp and it shows

pplication/pdf=evince.desktop;gimp.desktop;gimp.desktop;

which I believe means that both show but that the first and default is evince


--------------------------------------
alcoves wonder creates the wonder unto the ages; never lose that.

Offline

#11 2013-02-03 12:40:09

bance
Member
From: London, UK
Registered: 2012-07-11
Posts: 8

Re: Changed mime type associations !

Hi dag,

I presume you mean in your mimeapps.list file?

I have a file in /usr/share/applications called mimeinfo.cache, which contains:-

application/pdf=gimp.desktop;gimp.desktop;evince.desktop;

Anyway chromium now tries to open downloaded pdf's with evince, however when I try to open the pdf, I get four instances of evince all with error 'no such file or directory'

Offline

Board footer

Powered by FluxBB