How to create a web shortcut script in a folder? (Solved)

Using applications, configuring, problems
Post Reply
Message
Author
User avatar
fabrice_035
Posts: 765
Joined: Mon 28 Apr 2014, 17:54
Location: Bretagne / France

How to create a web shortcut script in a folder? (Solved)

#1 Post by fabrice_035 »

Hello,
Simple question, how to create web link shortcut in a folder with a script ?
Thanks!

User avatar
nilsonmorales
Posts: 972
Joined: Fri 15 Apr 2011, 14:39
Location: El Salvador

#2 Post by nilsonmorales »

make a script

Code: Select all

#/bin/sh 
exec defaultbrowser http://YOUR-URL
you can set a icon with rox right options
[b][url=http://nilsonmorales.blogspot.com/]My blog |[/url][/b][b][url=https://github.com/woofshahenzup]| Github[/url][/b]
[img]https://i.postimg.cc/5tz5vrrX/imag018la6.gif[/img]
[img]http://s5.postimg.org/7h2fid8pz/botones_logos3.png[/img]

User avatar
fabrice_035
Posts: 765
Joined: Mon 28 Apr 2014, 17:54
Location: Bretagne / France

#3 Post by fabrice_035 »

oh yes, good :shock:

User avatar
Rattlehead
Posts: 368
Joined: Thu 11 Sep 2008, 11:40

#4 Post by Rattlehead »

I created a small command that might be of use. It is called "link" and creates scripts of this kind in the directory we're at in the terminal:

Code: Select all

#!/bin/bash

#If the command is invoked without arguments, print help line and exit
[ ! $1 ] && echo "usage: link <url>" && exit

#Create a script with the name we've entered as argument
nu=$1
echo "#!/bin/bash" > $nu
#Change this line if you use a browser different from Seamonkey
echo -n "seamonkey -new-window " >> $nu 

#Grab the url from clipboard
a=`xclip -o`
echo $a >> $nu
#This line is to detour error messages -seamonkey produces a lot-
echo " 2> /dev/null" >> $nu

#Allow the execution of the new script
  chmod 755 $nu
Usage:

1) Copy the URL you want to the clipboard (typically for most browsers, ^l goes to go to the url bar, then press ^c to copy)
2) Open a terminal in the folder where you want to have the script that calls the web
3) type "link nameyouwanttogivethescript" (make sure that the link script is within $PATH, or point to it with an alias, so that you can invoke it from any directory)

There you have it, now you have a one click script to the web you want :)

I also tried to create a version for rox-filer, but couldn't figure it out. :roll:

Post Reply