Ranger's default filetype association

2

I want to make ranger open GIFs in mpv instead of in feh.

I added the line image/gif=mpv.desktop; in ~/.config/mimeapps.list (under [Default Applications]), updated the database with update-mime-database ~/.local/share/mime/. Now xdg-mime query default image/gif outputs mpv.desktop.

I tried opening .gif file in PCManFM and it opens up in mpv, but ranger still opens .gif files in feh.

Does someone know how to fix this?

Hanlon

Posted 2018-01-31T20:28:36.103

Reputation: 431

Answers

2

Ranger holds it's file associations in ~/.config/ranger/rifle.conf, so adding filetype gif and associating it with mpv should do the job.

Just add this line to ~/.config/ranger/rifle.conf:
^mime image/gif, has mpv, X, flag f = mpv -- "$@".

Hanlon

Posted 2018-01-31T20:28:36.103

Reputation: 431