Sample Header Ad - 728x90

How can I set default application for unknown file on xdg-open / mimeopen?

6 votes
2 answers
6228 views
On my Lubuntu (18.10), xdg-open launches VLC Player when the file is not associated to any applications. $ xdg-mime query filetype jquery.js application/javascript $ xdg-mime query default application/javascript # no output $ xdg-open jquery.js Error: no "view" mailcap rules found for type "application/javascript" Opening "/tmp/jquery.js" with VLC media player (application/javascript) On some files, it launches Calibre's E-book viewer (.rb for example). ---- **EDIT** I digged into xdg-open and found it executes following commands: 1. Check filetype with xdg-mime query filename "$file" and xdg-mime query default $filetype 1. run-mailcap --action=view "$file" 1. mimeopen -L -n "$file" The problem lies in mimeopen. Then how can I change mimeopen to open any **unknown files** with featherpad, or specific app? In other words, I'd like to set default fallback application if mimeopen can not find any suitable apps.
Asked by user291449
Nov 6, 2018, 08:25 AM
Last activity: Aug 16, 2019, 08:46 AM