How to bind protocole and/or filetype to program? Right-clicking file in dashboard isn't helping a lot and I have no tiniest idea on how to find the program and bind 'em. Googling "How to bind extension to application in Ubuntu" you won't find any great information.

So that I can:

PHP > Notepad++
Magnet > Defulge
PNG > GIMP

Recommended Answers

All 12 Replies

Most file managers for Linux GUIs have a "properties" item when you right-click on the item. Usually there you will find a tab titled something like "Open With" which will usually let you set the default application to use when double-clicking on the file type in question.

What if application doesn't pop-up?

Assuming you installed 14.04 Trusty, look in this page.

Yea. It works. Now how do I assign protocoles? Like magnet or ftp.

I'm not sure about what you mean exactly, and we don't have the same configuration because I'm in kubuntu. If nautilus is your file manager, you can access an ftp site with nautilus by using an adress such as ftp://mysite... in the nautilus address bar. Another thing you can do is create .desktop files, which can launch virtually any program. For example such a file could certainly launch a nautilus window pointing to a remote site, or a filezilla process to a site. It is very useful to learn how to write .desktop files.

I have such an example .desktop file in my code snippets here, it launches an ipython notebook. Unfortunately it is only for kde users :)

I'm not sure about what you mean exactly

You know, when you don't want wait hours to download a file through HTTP, you download it through torrent. On Linux Arch site, there's possibility to download torrent by magnet link, which, I don't know how to bind with program like Deluge.

Something like this: magnet:?xt=urn:btih:85320f7a0686f7c5f7b7425fa94eccd8a787e1a3&dn=archlinux-2014.08.01-dual.iso&tr=udp://tracker.archlinux.org:6969&tr=http://tracker.archlinux.org:6969/announce

@edit - It should change to a link but it doesn't work on DaniWeb. Look on Linux's Arch download instead of clearer look.

So far I understand, it's called a protocole. Now, since you don't know what it is and I can't manage to start it without help. We both get prompt about which program should be assigned to magnet: protocole. That's the problem, how do I assign magnet: protocole to a program that runs through Wine?

Whatever the protocol, I don't see why you would need Wine. Your ubuntu has torrent clients (among which deluge). The better solution is to look into linux programs. Only a small number of windows programs run in wine, and for most problems there are very good linux solutions.

Your ubuntu has torrent clients (among which deluge). The better solution is to look into linux programs.

Haha. Yea, sure as hell 2.5MBs is faster than 150 kBs. That's the speed. uTorrent downloads at speed of 2.5MB and almost never crashes, I tried to use it through manually adding torrent file to it, beautiful 2.5MB almost constantly, using Deluge it barely touched 100kBs, it mostly remained about 30kB.

2.0MBs vs. 80kB

See the difference? Get through it, I tried to use Linux, I don't like using Wine either because uTorrent isn't recreated graphically that well as it is on Windows. But Linux sollutions don't appeal to me with slow speeds, get frickin' used to it. In place of spamming me messages like "Use Linux's program", "Use Linux's program". Away with Linux's program, Windows' solutions better on this one!

If you like utorrent, why don't you install it on your system instead of spamming me the performance of torrent clients while I'm trying to help you. Some people use utorrent in ubuntu. There are at least 10 torrent clients which you can install and try, such as ktorrent, flush, qBittorrent, etc. I'm sure there is one fast enough for you in the bag. Don't think you are going to learn a new OS in 3 days.

If you like utorrent, why don't you install it on your system instead of spamming me the performance of torrent clients while I'm trying to help you.

Because you were spamming about your damn Deluge! That ain't helpin', that's "suggesting" someone to use one program over another, if you had read the topic, you'd knew that's crumbling about Deluge is way over a mile missing point of topic.

The problem with this request is the main problem with Linux in general (in my opinion); too many standards.

I.e. Firefox handles protocols internally (from what I understand), so you need to setup a magnet protocol handler there. I don't know how, a I mainly use Chromium.

Many application (like Chromium) have switched to a more standarized solution, by using xdg-open. I have my own magnet protocol handler (a java program that sends magnet URIs to my main download server).

To do something like this, you need to follow these steps:

# sudo nano /usr/share/applications/<application_name>.Desktop

By <application_name> I mean the program that should handle the magnet protocol (in my case it is "magnetclient").

2: Now fill the file with something like this:

[Desktop Entry]
Name=Magnet Client 
GenericName=Magnet Client
X-GNOME-FullName=Magnetizer URI Client
Comment=Send Magnet URIs to Server
Exec=java -jar "<location>MagnetClient.jar" %U
Icon=transmission
Terminal=false
Type=Application
StartupNotify=true
MimeType=application/x-bittorrent;x-scheme-handler/magnet;
Categories=Network;FileTransfer;P2P;
X-Ubuntu-Gettext-Domain=MagnetClient
X-AppInstall-Keywords=torrent

Not all settings are neccessary, but to be able to find the application in searches etc. most are useful.

The most important settings are obviously

  • Exec - To reflect what command you want to run (%U is the argument, i.e. the actual magnet:uri to use).
  • MimeType - To specify what MimeTypes to respond to.

But I suggest you fill in as many as possible, just to be on the safe side ;)

Martin

Sorry for the typos here and there...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.