LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to create and remove desktop icons or icons from shell scripts? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-create-and-remove-desktop-icons-or-icons-from-shell-scripts-666811/)

kkpal 09-01-2008 04:00 AM

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?

matthewg42 09-01-2008 04:51 AM

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...?

kkpal 09-01-2008 05:05 AM

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.

matthewg42 09-01-2008 05:44 AM

Is your desktop environment gnome?

kkpal 09-01-2008 06:42 AM

Quote:

Originally Posted by matthewg42 (Post 3265980)
Is your desktop environment gnome?

Yes. I am using GNOME.

matthewg42 09-01-2008 07:43 AM

  • 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.

i92guboj 09-01-2008 09:26 AM

Quote:

Originally Posted by matthewg42 (Post 3266059)
  • 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.

matthewg42 09-01-2008 10:04 AM

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.


All times are GMT -5. The time now is 07:15 AM.