How does one associate a filetype with a program?

12 risposte [Ultimo contenuto]
lembas
Offline
Iscritto: 05/13/2010

I know one can right click a file > properties > open with and even click on the show other apps button but what if the program I want isn't on this goddamn list?

There are also on the list duplicates and programs I'll never use to open anything which I'd like to get rid of.

GNUser
Offline
Iscritto: 07/17/2013

That's a though one, never happened to me.
Could you please provide more info, like, what app is missing in the "open with other aplication" and what are the duplicates?
Thanks.

lembas
Offline
Iscritto: 05/13/2010

I'd like to add inkview as default to opening .svg files.

Looks like Okular is the only dupe.

GNUser
Offline
Iscritto: 07/17/2013

I can't find inkview in the add/remove apps.
Did you install it from a different source? It could be the case that only apps installed through the standard app manager appear as alternatives =S
I will try to take a look at it later and see what I can come up with ;)

lembas
Offline
Iscritto: 05/13/2010

inkview is a .svg viewer in the inkscape package.

Thanks for poking around, I couldn't figure it out.

GNUser
Offline
Iscritto: 07/17/2013

Well, I have some good news and some bad news.

Good News:
Installing Nautilus Actions (in the apps manager), you can easily add context menus. Take a look here to get a better idea:
http://askubuntu.com/questions/88480/adding-extra-options-to-right-click-menu
second or third reply actually had a step by step tutorial with images. Nice.

Now bad news:
I installed inkscape and tried to follow the procedure they suggest in the help page (command line, inkview FILE) and it wouldn't work. inkview is recognized as a command, and the syntax seems to be correct, but it always says that can't open file.

Please, try doing that (opening the command line, and using inkiew from there). If it works, you can easily add it in nautilus context menu. If it doesn't it might be a problem with inkscape/inkview. They say it's experimental after all :P

I tried searching for the inkview command/file/folder/whatever, to add in nautilus action, and couldn't. So... Might be a problem with the program. Anyway, try using Nautilus action with some other app and you will see it works =)

Hope it helps you more than me buddy ;)

lembas
Offline
Iscritto: 05/13/2010

Thanks, this works while it's slightly kludgey.

Inkview only eats .svg files.

You can find out where a binary is with which COMMANDNAME, e.g. which inkview.

Thanks again.

GNUser
Offline
Iscritto: 07/17/2013

I tried with SGV file. But it doesn't work.

janlete
Offline
Iscritto: 05/14/2013

unfortunately, i don't know how to solve the whole problem, but i know a small trick:

right click on the menu (in 'edit menu') or run 'alacarte' directely via terminal or f2. then select the desired program that does not appear when you try to assign as default for a filetype, e.g., inkview, and click on 'properties'. In the new window, select 'command' and put '%U' after the typed command (for example, i have Pinta installed, so i wanted to open a png with it so where it was 'pinta' i put 'pinta %U').

hope this helps, and sorry if my english is bad.

lembas
Offline
Iscritto: 05/13/2010

Perfect! This way I could remove the duplicate and insert inkview into the list and then select it as default from there!

Well hidden I must say!

Thanks alot!

GNUser
Offline
Iscritto: 07/17/2013

I'm sorry, but I fail to understand what exactly you did. Could you maybe rephrase it please? I really want to learn it =)
THANKS

lembas
Offline
Iscritto: 05/13/2010

Sure! Right click the Trisquel swirl > edit menus. Select e.g. the graphics category and then add an entry pointing to "inkview %U" (without the quotes) in the command field.

Now, when you right click a file > open with > show other, inkview should be on that list. And there is a set as default button.

GNUser
Offline
Iscritto: 07/17/2013

Thank you so much! That worked like a charm, and guess what.... Using this method actually works with the file I was testing earlier :P
I guess sometimes even GNU is a little bit craze as Windows itself :P

Thank you for taking the time to explain it to me =)