0

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?

5
  • 1
    Why is this considered such a terrible question? Jan 25, 2013 at 14:24
  • It's difficult to understand what's being asked here. @Fizz, do you mean a shortcut or launcher that launches a browser and opens a website when it is clicked? If so, what desktop are you using? Please edit and add clarification to your question.
    – George M
    Jan 25, 2013 at 15:24
  • @SimonHoare because UNIX filesystem links are intended to link to other places in the same filesystem; but perhaps systems like Plan 9 would introduce some sort of unified naming system that actually lets you link to random protocols on the network?
    – njsg
    Jan 25, 2013 at 15:39
  • @njsg - the OP only wanted desktop shortcut icons not symlinks to the ether :) Jan 26, 2013 at 18:07
  • @SimonHoare Yeah, that's a nice thing to have clarified, bringing 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.
    – njsg
    Jan 26, 2013 at 18:27

2 Answers 2

4

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.

Example of how it looks

0
1

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'

You must log in to answer this question.

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