LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-01-2008, 12:00 PM   #1
craftereric
LQ Newbie
 
Registered: Mar 2008
Posts: 21

Rep: Reputation: 15
how to create a desktop url shortcut


How can I automatically write an installation script that will create a desktop shortcut to an URL. I am using the Redhat 3 gnome desktop.
 
Old 07-01-2008, 04:31 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
How can I automatically write an installation script that will create a desktop shortcut to an URL.
You can't "automatically write" it, you have to write it.

What have you tried? Give us some examples of it "not working".

Please see: http://www.linuxsilo.net/docs/smart-questions_en.html
 
Old 07-02-2008, 10:07 AM   #3
craftereric
LQ Newbie
 
Registered: Mar 2008
Posts: 21

Original Poster
Rep: Reputation: 15
Creating a desktop file under /root/.gnome-desktop creates the shortcut that I want. However, the problem appears to be that the Exec and Icon entries contain spaces. If I change the paths to something that does not contain a space everything works.

Can some tell me how to properly escape things so that the paths can contain spaces?


[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Exec="/usr/local/abc/my gui/desktop/mygui.sh"
TryExec=
Icon=\"/usr/local/abc/my\ gui/desktop/icon.gif\"
X-GNOME-DocPath=
Terminal=false
Name[en_US]=My Gui
GenericName[en_US]=
Comment[en_US]=
 
Old 07-02-2008, 10:42 AM   #4
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Did you already try to use the desktop's way of creating a shortcut (i.e. right-click desktop, create shortcut, fill in information, ...) to a file that in a directory the name of which contains spaces and then viewing the created file with a text editor? I suspect that's the fastest way to find a solution for your problem (sorry, can't do it here -- on Windows atm.)
 
Old 07-02-2008, 11:26 AM   #5
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
Quote:
Can some tell me how to properly escape things so that the paths can contain spaces?
Like this: escape/ some/ spaces or
"Put them in quotes"

Looking at your post of the desktop file, I think it should have worked:
Code:
Exec="/usr/local/abc/my gui/desktop/mygui.sh"
here you have put the spaces inside quotes
Code:
Icon=\"/usr/local/abc/my\ gui/desktop/icon.gif\"
Here you have escaped both the " marks (unnecessary, and I am not sure if this is "bad") and the space.
What happens if you set Terminal=true ?
Maybe you'll see some helpful error messages.
The best thing is not to use spaces in filenames, and use the underscore instead: my_gui

Last edited by tredegar; 07-02-2008 at 11:40 AM. Reason: lowercase t in true
 
Old 11-16-2010, 05:08 PM   #6
RickyRockRat
LQ Newbie
 
Registered: Apr 2005
Location: boise
Distribution: Red Hat - 6.2,7.3,9.0,FC3,FC4, FC5, Debian-3.1, Ubuntu 7x,8x,10x, DSL
Posts: 14

Rep: Reputation: 0
Quote:
Originally Posted by craftereric View Post
Creating a desktop file under /root/.gnome-desktop creates the shortcut that I want. However....
Please tell us you *AREN'T* running X as root?!

You know what they say...Don't use root in vain.

And yes, I know this is years later, however hopefully is serves as warning for others.

Cheers.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how create a shortcut on the linux desktop for a executive program cy163 Linux - Newbie 2 12-10-2007 11:41 PM
How to create a desktop shortcut ? juanb Linux - General 1 07-01-2004 03:27 AM
How to create a shortcut? gmoney Linux - Software 3 10-08-2003 07:51 PM
create a shortcut/alias allelopath Linux - Software 6 04-01-2003 09:45 AM
How to create shortcut in Linux ? futurist Linux - General 2 03-21-2003 01:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration