How can I without any manual GUI use check what will open file with a specific file extension - for example .rb
?
Not a duplicate of how can I change file association globally? as mine is about programmatically reading, not changing in any way, including manual through GUI (though https://askubuntu.com/a/289339/349903 hints that parsing some set of config files may give an answer)
To avoid XY problem: I have system installation script, that works fine except that Okular ends associated with .rb
, .py
, .txt
and other text files, instead of text editor. I want to rerun installation script and log what is now opening specific file extensions after every step. I hope that will allow me to debug what is going wrong.
xdg-mime
to query the default association ex.xdg-mime query default text/plain
– steeldriver Nov 10 '19 at 19:12touch test.rb
+mimetype test.rb
gives metest.rb: application/x-ruby
what allows me to runxdg-mime query default application/x-ruby
Are you interested in making an answer? – reducing activity Nov 10 '19 at 20:27