4

I've looked through some of the answers to question close to mine, but none of them was satisfactory.

As one could guess from the title, I'm desperately trying to add to my "open with" list a certain application for a certain application type, namely I'm talking about .sgf files which I want to be opened with qgo. I could have gone with kigo or other Go applications, but qgo is the best to me. (talking about the board game GO, aka weiqi, aka baduk)

About those other answers which don't help with this problem of mine:

  1. I can't append any %F to the exec line in any /usr/share/applications/qgo.desktop or similar, since no such file exists.
  2. I tried with ubuntu-tweak but it didn't work.
  3. qgo appears in my "luncher/dash" so the fourth answer here doesn't work

Any help would really mean a lot. Thank you very much! D.

P.s: i'm on LTS12.04

2 Answers 2

4

There's a command line method which might work for you:

CLI Method to Change Application & Set Default:

You can easily open a file with another application using the mimeopen command in the terminal. However, if the program isn’t already in the list of recommended applications, you’ll need to make it the default for that filetype first. Simply open a terminal in the folder where the file is and run a command like the following (substituting Recipes.pdf with the appropriate filename and filetype):

mimeopen -d Recipes.pdf

Please choose a default application for files of type application/pdf

1) GIMP Image Editor (gimp)
2) Adobe Reader 9 (AdobeReader)
3) Document Viewer (evince)
4) Other…

use application #4
use command: pdfedit

Simply choose the number that corresponds to Other… (in this case it’s 4), then type the command of the program after use command: (you probably won’t need to specify the path, but if it doesn’t work without it, it should be something like /usr/bin/pdfedit).

After that, you can switch default applications quite easily with the above command, or use the --ask option to just open the file in the desired app without changing the default (note there is no option to choose Other…, which is why you have to use the -d switch first):

mimeopen --ask Recipes.pdf

Please choose an application

1) pdfedit (pdfedit-usercreated-2)
2) GIMP Image Editor (gimp)
3) Adobe Reader 9 (AdobeReader)
4) Document Viewer (evince)

use application #
5
  • That (almost) solved it! Thank you very much!!! ( I'm saying it almost solved it because when I'm downloading .sgf file from websites and asking firefox to open them without saving, an empty file is opend and the following error is displayed: "Could not find file: file:///tmp/gameName.sgf". Other than this, your answer solved any problem!) Jul 3, 2014 at 23:43
  • Didn't quite make it? I was of the impression that would set the default for the filetype that you are opening, and (probably) create the .desktop file as well. Jul 3, 2014 at 23:48
  • Yeah, I gave up on this version of Firefox because of the problems with flash. I'll try again later, as I really prefer that browser. Jul 3, 2014 at 23:49
  • Excellent solution to a problem that had been bothering me for ages -- Many thanks. BTW is this a sign of a poorly written app? or is there a logical reason why this important feature is missing from some apps?
    – user587469
    Feb 7, 2018 at 17:22
  • @elmclose - I'm glad the answer helped you, but I think I must have been brilliant 4 years ago... I don't know that this is because of a poorly written app, but more likely an app written to run on many different *nix systems. Feb 7, 2018 at 17:30
0

There's a similar question in this link which helped me.

As an example of *.desktop file, the next file content correspond to the software Master PDF Editor 4:

[Desktop Entry]
Name=Master PDF Editor 4
Comment=Edit PDF files
Exec=/opt/master-pdf-editor-4/masterpdfeditor4 %f
Path=/opt/master-pdf-editor-4
Terminal=false
Icon=/opt/master-pdf-editor-4/masterpdfeditor4.png
Type=Application
Categories=Office;Graphics;
MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf;

I don't know the meaning of every field, but i have changed only the Exec (path of executable file) and Path (path to all the files of the application). Also, if you want to see the icon of the application, you could change the Icon path. You also have to change the Name and maybe the Comment field, because you have to create a new file.

Finally, I think that in the MimeType you have to put the mime types related to the files you want to open. In this link you could see a supposedly complete list.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .