I'm trying to make the default application for .asm file extension to be a shell script that I made. Basically I have a .sh script that runs MIPS Mars and I want to make it the default application to open assembly .asm files. My problem is that while I can add my .sh script to the app menu using main menu app from the store, I can't make my script appear in the list of open with programs for .asm files.
Ubuntu – Make shell script default to run file extension
appmenudefaultdefault-programsmenuscripts
Best Answer
You can try creating a
.desktop
file in/usr/share/applications
(or~/.local/share/applications
, if only for one user) like explained here (works for other desktops too).To link this program to
.asm
files you first have to create a mimetype for.asm
files.In order to do so you have to add/modify the line
in
/etc/mime.types
In the
.desktop
file you should add the lineso it's added to the "Open with" menu.
To finally make your script the default application for
.asm
files addto
/usr/share/applications/defaults.list
Edit: To make it work immediately you should probably run
update-desktop-database
after your changes.