Forgetting to make the target program executable (this prevents it from showing up in the list).Not realizing that I spelled 'Exec' wrong.Here are some of the things that have caused the new 'Open With' to not show up, or otherwise caused me to waste a lot of time on this task: In order to get a better solution that's targeted at specific file formats/extensions, you need set up a custom 'MIME type' Adding A Custom MIME Type & Icon In Ubuntu 20.04. If your system identified the 'file type' as something very general, like 'text files' or 'binary files', then every time you try to open one of those general file types, it'll use the program you last associated with it. One disadvantage of the approach shown above is that after the first time you open your file this way, it'll keep the 'Open With' option that you selected as the default option for all files of that 'type'. Step 3) Setting Up A Custom MIME Type (Optional) desktop file above I was able to right-click on my 'something.abc' file and get it to open with 'My Custom Thingy' and it opened in gedit. I just tested these instructions with a test file called 'something.abc' that contained only the text 'Hello World!'. The format strings and desktop entry names are all documented on this page title 'Desktop Entry Specification'.ĭoing the above is enough to make the item appear as an option in 'Open With' on Ubuntu 20.04 without refreshing/relogging or running anything else as it appears to get picked up automatically. If you use '%F', that represents only a single filename. The '%f' will become the one or more filenames that will be passed to the program. The text 'My Custom Thingy' is whatever you want the name in the 'Open With' list to be. Simply change '/usr/bin/gedit' to the path of the executable that you want to open files with. The above example will cause files to be opened in 'gedit'. Now, let's add an entry: sudo vi /usr/share/applications/my_custom_sktopĪnd here is what we'll put inside of the file 'my_custom_sktop': Exec =/usr/bin/gedit %f Name =My Custom Thingy Step 2) Add The New Desktop Entryįor the '.desktop' entry, I'm going to name it 'my_custom_sktop', but you can name it whatever you want as long as it doesn't clash with another existing entry and it ends with '.desktop'. If you're reading this article in a far distant future where the folder has been changed, or you're on a different system other than Ubuntu with different paths, search for a folder on your system with lots of '*.desktop' entries in it. I can also see that in this directory, there are already tons of files that end in '.desktop', so you may be able to use them as a reference. In my case, I'm going to use the '/usr/share/applications/' directory to make this option globally accessible. Inside a specific user's folder at '/home/THE_USER/.local/share/applications/'.Inside the global folder for all users at '/usr/share/applications/'.Most likely, you'll choose one of the following two folders: To do this, you'll first need to figure out which directory to put it in. In order for your application to show up in the 'Open With' list, you need to add a '.desktop' entry for it. My overall goal was to get '.kdenlive' project files to open with the Kdenlive AppImage. I decided to write an article on this subject because the last few times that I tried to complete this seemingly simple task, it has taken me at least a couple hours due to forgetting numerous odd details and having to piece it together again from google searches. In particular, we'll review an example of how you can get files to automatically open with a AppImage executable of your choosing. This article is a quick summary of how to add a custom 'Open With' program that can be associated with files of a certain type in Ubuntu 20.04. Adding A Custom 'Open With' Program In Ubuntu 20.04 - By Robert Elder
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |