How to create a shortcut on my desktop to a link?

Moderator: Forum moderators

Post Reply
Muzunduleno
Posts: 9
Joined: Mon Feb 15, 2021 7:11 pm
Has thanked: 2 times

How to create a shortcut on my desktop to a link?

Post by Muzunduleno »

Please how can I create a shortcut link on my desktop ?
I've a link and I would like to access

User avatar
mikeslr
Posts: 3080
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 179 times
Been thanked: 991 times

Re: Shortcut

Post by mikeslr »

Hi Muzunduleno,

By "link" I assume you mean a link to a web-page. But, if not, the following is a general method --probably one of several-- which can do that; and serve as a template for using other applications.

file-browse to /root/my-applications/bin. That folder is unique to Puppys --making it a good location to put things which won't interfere with anything else-- and 'on the path'. 'On the path' means the operating system looks for executables there.

Right-Click an empty space and from the pop-up menu select New>script. Give it a name. In this case I've named it pup. Right-Click the 'pup' file and from the pop-up window select "Open as text". You'll see that script already contains this line:
#!/bin/sh
Press Return to create a new line and on it type:
exec defaultbrowser "$@"
The 'orange' color will appear automatically.
Now add the URL of the webpage so that the entire line reads, e.g.
exec defaultbrowser "$@" https://forum.puppylinux.com/
[The blue color and underlining was added by the Forum's software. It isn't in the script, itself.]
Save he file. Then drag it to your desktop. [Optional: When it's on your desktop you can Right-Click it, Select 'file ITS NAME' and from the pop-up menu select "set icon". A GUI will open onto which you can drop an icon of your choosing].
Don't forget to Save your changes.

You can substitute your choice of browser for 'defaultbrowser' and, of course, change the URL it is to open. Look at the Exec= argument of /usr/share/application desktop files of your choice of web-browser for the executable Puppy recognizes. You can open application/xxx.desktop files in a text editor.
You can use the above example as a template for applications other than web-browsers. For example:

exec abiword "$@" /root/my-applications/bin/pup
would open the script named pup you created above in abiword.
Final word: In writing scripts, capitalization, punctuation and spacing are important.

User avatar
April
Posts: 493
Joined: Tue Dec 29, 2020 9:06 pm
Has thanked: 57 times
Been thanked: 28 times

Re: How to create a shortcut on my desktop to a link?

Post by April »

I didn't read all mike's post ,sorry Mike.
If its a link in your file system.
Go to the file you want to put on the desktop. Say in rox /usr/bin/abiword ( open the filer and back click to the root)
Right click on it and drag it across to your desktop.

Shortcut on desktop.

So if its a link to something right click on it and choose "show target" to get there then do the above.

The Australian State Governments have all enacted laws to steal your assets on your death. All legal paperwork is binned and all assets seized on one disgruntled child's complaint.Move them well before you die or go into a home.

timg11
Posts: 17
Joined: Mon Dec 18, 2023 5:40 pm
Been thanked: 2 times

Re: How to create a shortcut on my desktop to a link?

Post by timg11 »

@mikeslr, I used your approach to create a desktop shortcut to a URL. I'm using BionicPup32 19.03
I created the script in /root/my-applications/bin.

They work perfectly when I click on them while in the /root/my-applications/bin.
Then I dragged them to the desktop which appears to create copies on the desktop. A click on the desktop copies opens the scripts in the Geany text editor and does not execute them.

What did I miss?

User avatar
Keef
Posts: 291
Joined: Tue Dec 03, 2019 8:05 pm
Has thanked: 3 times
Been thanked: 80 times

Re: How to create a shortcut on my desktop to a link?

Post by Keef »

I can't think what the problem is - could you post the actual script?
Please note that the script can be anywhere, does not need to be in the "PATH". Also the "$@" is redundant, but will do no harm. Even 'exec' can be left out, as the script knows what to do with 'defaultbrowser' or the name of the executable.
Simple as possible is the best way usually, as it makes it easier to spot errors.

User avatar
bigpup
Moderator
Posts: 7512
Joined: Tue Jul 14, 2020 11:19 pm
Location: Earth, South Eastern U.S.
Has thanked: 1021 times
Been thanked: 1682 times

Re: How to create a shortcut on my desktop to a link?

Post by bigpup »

Muzunduleno wrote: Thu Mar 04, 2021 5:13 pm

Please how can I create a shortcut link on my desktop ?
I've a link and I would like to access

What are you calling a link?

A link to what?

Need more info?

The things you do not tell us, are usually the clue to fixing the problem.
When I was a kid, I wanted to be older.
This is not what I expected :o

timg11
Posts: 17
Joined: Mon Dec 18, 2023 5:40 pm
Been thanked: 2 times

Re: How to create a shortcut on my desktop to a link?

Post by timg11 »

@keef, thanks for reply! the script is quite simple, just taken from above with the URL changed:

Code: Select all

#!/bin/sh
exec defaultbrowser "$@" https://geeksforgeeks.org/python-for-kids

I just deleted the shortcut and started over and now it works. Odd.

Post Reply

Return to “Xenial”