Score:0

Set default appliation to open files

ng flag

I have files with the extension .case that I want to open with the software paraview. I can open such a file either using the terminal (paraview file.case) or opening it directly from the software.

But when I double-click on the file in the terminal, it says that there is no application installed to open such a file, and in the menu Open with another application, Paraview doesn't appear in the list (while it appears in the list of application).

Is there a way to tell ubuntu that I want all case files to be open with /usr/bin/paraview ? I'm using ubuntu 20.04.

I found some posts dealing with this problem, but I didn't manage to solve mine with them...

FedKad avatar
cn flag
If there is no `.desktop` file for the `paraview` software, you can create one and put it under your `~/.local/share/applications/` directory. After that, you should be able to "associate" the `.case` extension with this "application" as you tried already.
Score:1
gq flag

One possible problem why this is happening is because the .desktop file doesn't accept files.

  • Locate the paraview.desktop file (it could be in a number of locations. Start looking in /usr/share/applications/ or /var/lib/snapd/desktop/applications/)
  • Open it with a text editor. In the Exec line there should be a %U at the end.
  • If not, make a copy of the file in ~/local/share/applications/
  • Modify the file by adding the %U at the end of the Exec line like this: Exec=paraview %U line.
  • Make the file executable.
  • Log out and in again.
  • Try opening a .case file with the right-click Open with command.
  • If successful, right-click the file again, choose Properties followed by open with.
Thomas avatar
ng flag
I made what you said, but this doesn't work : I have the same behavior as earlier. I tried to add the `%U` or to give the full path to paraview (as explained on [this page](https://www.maketecheasier.com/create-desktop-file-linux/))
gq flag
Are you sure you made the .desktop file executable?
Thomas avatar
ng flag
Yes : I tried `chmod u+x paraview.desktop` and also `chmod +x paraview.desktop`. When I try to open a `.case` file by double-clicking on it, the error message is « no application is installed for files " fichier IFF " [...]» (nb : as my system language is French, I translated for this post only what is outside the quotes in the message)
gq flag
What happens if you run `paraview /path/to/.case file` in a terminal?
Thomas avatar
ng flag
it works well : paraview opens it
gq flag
Did you leave a space before the `%U`? Also make sure you're launching the modified .desktop file and not the original one. To be sure you're launching the correct one, you could modify the `Name=` field slightly to distinguish between the two .desktop files.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.