0

In Ubuntu 18.04 I installed a program called FSLeyes and would like this program to become associated with files containing the '.nii.gz' extension. I have created a '.desktop' file for the application, which I placed in the /usr/share/applications folder, and I can now find the application from the Activities menu and run it without problems. However, when I right-click a '.nii.gz' file and go 'properties->open with' or 'open with other application' the installed program (fsleyes) is not in the list of available applications. Why not?

Linking the application to /usr/bin

sudo ln -s /usr/share/fsl/5.0/bin/FSLeyes /usr/bin/FSLeyes

does not solve the problem either.

  • It is installed under /usr/share/fsl/5.0/bin/FSLeyes. I added this to the path variable in .bashrc and so I can run this from the terminal without problems. Then I created a .desktop file that I put in '/usr/share/applications' and this allows me to find the application under 'Activities' and it also runs fine (the desktop file also has the same root:root permissions as the others files in this folder). Then I right click a 'nii.gz' file and click Open With Other Application->View All Applications and the application I set up before does not appear... – Niels Janssen Sep 20 '18 at 16:32
0

You may have incorrectly set up your .desktop file.

If you have /usr/share/applications/$application.desktop, change Exec=$command to Exec=$command %F in the file., where $application is the name of application, and $command is the command to execute for desired action.

If the %F is not in your desktop file, it won't show up in the list.

|improve this answer|||||
  • Thanks! That indeed worked. I very much appreciate the time you put into this. However, I have to say that in my many years of computer experience I have never seen such a cumbersome process of associating a file type with a program. It does not bode well for my future with 18.04. – Niels Janssen Sep 20 '18 at 17:11
  • I was way off with adding the symlink sorry about that it is totally unnecessary... all you have to do is correctly create your .desktop files... most apps will create this .desktop for you when you install them so this should not be a regular issue. if you don't have the %F part in the desktop there is no way for gnome to know that it's meant to open a file and it will therefore not show up in that list. – Joshua Besneatte Sep 20 '18 at 17:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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