6

How can I change the default applications from the command line (specifically from a script)?

The link below describes setting the default applications from the GUI, and also by editing ~/.local/share/applications/mimeapps.list. However, it appears mimeapps.list has been moved or is no longer present.

See, e.g., How do I set the default program?

1
  • 1
    Have you tried to create the file in question? Jun 25, 2018 at 21:33

1 Answer 1

5

After using my system for some time, it appears one of my programs caused the file to be created at ~/.config/mimeapps.list

sudo find / -name "mimeapps.list"

cat ~/.config/mimeapps.list

[Added Associations]
image/jpeg=gimp.desktop;
text/x-java=eclipse_eclipse.desktop;
application/json=sublime_text.desktop;
application/rdf+xml=sublime_text.desktop;
text/x-python=sublime_text.desktop;
video/mp4=vlc.desktop;
application/octet-stream=org.gnome.Software.desktop;
application/pdf=evince.desktop;
text/html=org.gnome.gedit.desktop;
text/plain=firefox.desktop;

[Default Applications]
application/ppdf=FoxitReader.desktop
application/octet-stream=FoxitReader.desktop
application/pdf=FoxitReader.desktop

Not the answer you're looking for? Browse other questions tagged or ask your own question.