7

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?

user2514157
  • 783
  • 8
  • 19

1 Answers1

7

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
user2514157
  • 783
  • 8
  • 19