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:
- Check filetype with
xdg-mime query filename "$file"andxdg-mime query default $filetype run-mailcap --action=view "$file"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.