LinuxQuestions.org
Visit Jeremy's Blog.
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 09-01-2008, 04:00 AM   #1
kkpal
Member
 
Registered: Oct 2007
Posts: 101

Rep: Reputation: 15
Exclamation how to create and remove desktop icons or icons from shell scripts?


hi all

how to create and remove desktop icons or icons from shell scripts?
 
Old 09-01-2008, 04:51 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
A little more information needed...
  1. Which desktop environment are you using?
  2. Which distro (just for my curiosity - it doesn't matter for the answer)?
  3. What do you want the icons to do - launch a program; be a link to a file somewhere else in the filesystem; something else...?
 
Old 09-01-2008, 05:05 AM   #3
kkpal
Member
 
Registered: Oct 2007
Posts: 101

Original Poster
Rep: Reputation: 15
I am using fedora 9. I want create icon for shell scripts from another shell script.
Let suppose I have two shell script test1.sh and test2.sh. I want create icon for test1.sh (when we click on that icon test1.sh will execute) from test2.sh shell script.
 
Old 09-01-2008, 05:44 AM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
Is your desktop environment gnome?
 
Old 09-01-2008, 06:42 AM   #5
kkpal
Member
 
Registered: Oct 2007
Posts: 101

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by matthewg42 View Post
Is your desktop environment gnome?
Yes. I am using GNOME.
 
Old 09-01-2008, 07:43 AM   #6
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
  • right-click on the desktop and select "create launcher" from the context menu.
  • select "application" or "application in terminal" as appropriate for your script.
  • enter a name (this is what the label on the desktop will be)
  • in the "command" entry, put the full path to the script. You can use th "browse" button to find your script.
 
Old 09-01-2008, 09:26 AM   #7
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by matthewg42 View Post
  • right-click on the desktop and select "create launcher" from the context menu.
  • select "application" or "application in terminal" as appropriate for your script.
  • enter a name (this is what the label on the desktop will be)
  • in the "command" entry, put the full path to the script. You can use th "browse" button to find your script.
I think that what the OP is trying to do is to manipulate the desktop icons from a script, and not the other way around.

I don't use gnome, so I can't be sure, but the desktop icons will reside into a folder (a gnome user should be able to tell). It should be something like ~/Desktop or ~/.gnome/Desktop or something similar.

Inside that directory, once you locate it, the said desktop links should reside, they should be just regular files which you should be able to reference from a regular bash script, just like any other file. How to manipulate them is up to you, depending on what do you exactly want to do.
 
Old 09-01-2008, 10:04 AM   #8
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
In that case, do what I suggested, and then look at the .desktop file which is produced. It should be fairly clear how to make one - just re-directed the proper text into a file.
 
  


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
remove all the icons from the gnome desktop urifrid Red Hat 32 12-09-2008 03:05 PM
How do I remove locked desktop icons? ljtigre Mandriva 1 09-02-2007 02:09 AM
remove icons from gnome desktop? ssfrstlstnm Linux - General 3 11-25-2005 08:37 AM
Cannot remove desktop icons in KDE will103 Debian 2 01-02-2005 04:14 AM
How do I remove these icons from my desktop? Iguana Linux - General 1 10-05-2003 01:41 PM

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

All times are GMT -5. The time now is 03:11 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