LICENSE: Public Domain
SYNOPSIS: Define .hotlink File Type
Gnome .desktop files are awkward to use for
browser bookmarks. This is the implementation of a new .hotlink
file type, which is handier. It reads Windows
Q: What do you get when you drag a hot link from Mozilla to your
A: ... a .desktop file in ~/.gnome-desktop.
A: No, only if the protocol of the link is http: ....
Q: What can you do with the .desktop link file?
A: Well, you could double click on it. Then Gnome would
open the URL of the link in the default browser.
Q: What if I dragged the .desktop link file back to
A: Gnome would tell Mozilla to open the .desktop
you would see would be the text of the .desktop file, not
the URL of
Q: I am a Windows user, and I am confused.
A: Is that a question?
Let's be clear. The
scenario is from Gnome 2.2. Windows
users are accustomed to creating and using desktop shortcuts that have
a defined purpose and regular function across various versions of the
operating system. This is not true of .desktop files
versions of Gnome although, God willing, the situation may be resolved
somehow in later versions.
For now, I have made myself comfortable with Gnome by defining my own
kind of .hotlink file that does what I want when I want.
Let's be clear. I'm not
going to use the term shortcut any
more. Shortcuts are tiny Windows files. They come in two
My .hotlink file is like a Windows .url file,
not a Windows .lnk
file. It's like a single-item bookmark -- a list of one thing; it
stores one URL. If you double click on it, it opens the URL in
the default browser, just as a Gnome .desktop link file
- One type of Windows shortcut is for launching application
programs. Behind the
scenes, it has a .lnk file-name extension and is the
implementation of .pif files from earlier versions of
knows the command to start, the parameters to pass, and the directory
to run in. Gnome has a similar implementation: a .desktop
- The other type of Windows shortcut is for opening URL links in
the default browser.
Behind the scenes, it has a .url file-name extension.
Gnome has a
similar implementation: a .desktop link file.
Let's be clear. I'm not
going to use the term bookmark any
more. Bookmark collections are updated and used within
browsers. A bookmark points to a URL, which you view in your
browser. In fact, a bookmark can point to an actual file such as
an .html file if you want your browser to load it from
file system rather than from an http server. In this case,
URL begins with file: rather than http:.
Let's be clear. I'm not
going to use the term link, either.
Unix file systems have symbolic links, html pages have
links to other
html pages, and Gnome has .desktop link files.
use the term
.hotlink to refer to the object of a .hotlink
My .hotlink file can contain a file-protocol
URL in place
http-protocol URL if appropriate. A Gnome .desktop
Every user accumulates his own peculiar collection of bookmarks, but,
when he wishes to swap browsers, he has to leave his collection
behind. I prefer to keep my bookmarks (I mean .hotlinks.)
folders (directories) arranged by topic within my local file
system. I can move, copy, and delete my .hotlinks
and reliable file-system commands or even drag and drop
procedures. My .hotlinks are stored separatetly from
browser. Furthermore, they are stored in a browser-independent
format. Thus, I can swap browsers or use more than one
browser at the same time and still have access to all my .hotlinks.
My .hotlink files are html-format files that
However, they are munged so that Gnome's mime-type sniffer doesn't
smell them. Instead, I define a new mime-type, x-special/hotlink,
based on the .hotlink file extension.
I have written two scripts to edit and to open .hotlink
These scripts are written in Python. They rely upon requisite
software already being installed:
Here is what you can do with a .hotlink file:
- You may store it in a file folder or on your Gnome desktop (in
the ~/.gnome-desktop folder). There you may double click on
it. The action is always the same: The target URL is opened in a
browser. Unlike that in a Gnome .desktop link file, the
protocol of the
URL in a .hotlink file makes no difference. (If you were to
click on a .desktop
link file referring to a file-protocol URL,
Gnome would show
the text of the .desktop file itself in Nautilus, not the
target URL in a browser.)
- You may drag it to an open browser. A browser like Mozilla
will try to display the contents of any file that you drop on it.
a .hotlink file is formatted as an html file,
what you will
see is the
title of the .hotlink, and you may then click on it to
bring up its
URL. (If you dragged a .desktop file to a browser,
would display the text of the .desktop file itself.)
HotLink.py is the .hotlink
Also, it can read .url and .desktop link
files. It puts up a
dialog box with three blanks:
If called with a file as a parameter, HotLink.py tries to
read the file as a
.url file, a .desktop file, and, then, as a .hotlink
called without a parameter, the blanks are not filled.
- Name -- the name of the .hotlink file
- Title -- a readable meaning for the link, which is
is dragged to a browser
- URL -- the source of the link
As distributed, a .desktop application launcher icon (HotLink.desktop)
is installed for
HotLink.py. You may drag a .url, .desktop
link or .hotlink file
to it, or you may double click on it to open it without a file.
You can paste values into the blanks. Alternatively, you can copy
a link with your browser's edit command and then paste both
the URL and
its Title (linked text) into HotLink.py by
button. This works from browsers like Mozilla.
Click the save button to create a new .hotlink
HotLink.py has two hot spots on the dialog box:
- The left hot spot is sensitive to links. You may use the
mouse to drag a link from your browser and drop it here to fill in the
blanks. If you drag the "thumb icon" from the navigation bar in a
browser that supplies one, the Title is filled with the
title of the
current page. You may drag a file name from Nautilus to create a .hotlink
to a (local) file.
- The right hot spot is sensitive to .hotlink
files. You may
drag existing .url, .desktop link, and .hotlink
file names here to view
their contents and make changes.
HotTraverse.py reads a .url,
link, or .hotlink file and opens the embedded link in a
This is the default action for double clicking on a .url
.hotlink file: HotLink.py opens the link in the
browser. Alternatively, you may specify a particular browser with
the -c option on the command line.
As distributed, a .desktop application launcher icon (HotTraverse.desktop)
You may drag a .url, .desktop link, or .hotlink
file to it. If
you double click on it, nothing much happens.
HotType.py defines objects common
to HotLink.py and HotTraverse.py.
Deploy.py is the install procedure.
it from the directory created by unpacking the tarball. It copies
components to their installed locations. Examine the Python
source to be sure the destination directories are appropriate for your
tar -jxvf HotLink.bz2
extends the Gnome mime-registry to include x-special/hotlink
based on file extensions of .hotlink and .url.
Gnome application-registry so that HotLink.py and HotTraverse.py
handle x-special/hotlink files.
HotLink.keys extends the Gnome
to define default treatment for .hotlink files.
* First release.