I'm using Ubuntu 12.04 and I would to create a folder with all of my shortcuts. Is it possible to create icons (like usual links to files in my harddisk) that automatically launch my browser and open a specific page? For example, I would like to have an icon on my desktop that automatically opens the StackExchange homepage. How can I do that?
2 Answers
Assuming you are using something like Gnome, Xfce or some compliant desktop environment; a good alternative is to create a .desktop
file. For example unix_stackexchange_com.desktop
with the following contents:
[Desktop Entry]
Version=1.0
Name=Unix & Linux
Comment=Link to Unix & Linux.
Exec=google-chrome http://unix.stackexchange.com
Terminal=false
Icon=/path/to/icon
Type=Application
Now you just make it executable like this
chmod +x unix_stackexchange_com.desktop
Instead of google-chrome
you can use your favorite browser like firefox
or the like. Or use a more generic approach like xdg-open
, provided it's installed and configured. Also you can replace /path/to/icon
for a generic icon name like text-html
to use the icon used for html files in your file manager or point to an image somewhere in your disk. In my case I downloaded and borrowed the icon of this site.
A link to a website isn't exactly possible if you're trying to go the hardlink/symlink route. What you can do, and I found this suggestion here, is to create a simple script that can be executed.
#!/bin/sh
x-www-browser 'http://www.example.com/your/link'
link
in the mix surely makes it a bit confusing, I smell a bit of Windows terminology in here. For stuff that supports that (I guess anything which fills the screen background with icons? I've not used that kind of stuff for years now), the Freedesktop .desktop thing is the way to go.