Page 1 of 1

how associate an icon with a script? (solved)

Posted: Wed Aug 01, 2012 8:06 pm
by Asimov
Many desktop lack a tool to switch keyboard layout. Thrust me, you don't want't make C programming on a canadian layout.

Re: how associate an icon with a script?

Posted: Fri Aug 03, 2012 3:54 am
by Gazpacho
Try this:

Once you have the script, right click over the folder you want to have the shortcut, create/new, and look for "link", or similar. finally, give the route to your script

Re: how associate an icon with a script?

Posted: Mon Aug 06, 2012 7:46 pm
by Jamesc359
With XFCE you can right click on the Desktop and click Create Launcher.

Otherwise you can just open a text editor and use this as a template.

Code: Select all

[Desktop Entry]
Version=1.0
Name=<NAME>
Comment=<COMMENT>
Icon=<ICONNAME>
Terminal=true
Exec=<INTERPRETER> <PATH_TO_SCRIPT>
Type=Application
Categories=Accessories;

Save the file as a .desktop file where you want it to appear. e.g. ~/Desktop/myscript.desktop

You can look into /usr/share/icons/ for the names of various icons. Don't include an extension. e.g. text-x-script.png would be Icon=text-x-script

If you script is executable you don't have to included the interpreter. For shell scripts you'll want the interpreter to be sh.

You can place it in additional categories by using a semi-colon seperated list. e.g. System; Accessories;

If you want it to appear in your menu place the .desktop file in ~/.local/share/applications

Remember to enclose pathnames with spaces in them in quotes. :-)

Re: how associate an icon with a script?

Posted: Tue Aug 07, 2012 6:35 pm
by Asimov
My script work inside a terminal, but not outside. I make a test with my script in /usr/local. But even with the path the script do not start. Any idea on the cause of my problem?

Re: how associate an icon with a script?

Posted: Wed Aug 08, 2012 3:47 am
by Pilosopong Tasyo
Asimov wrote:My script work inside a terminal, but not outside. I make a test with my script in /usr/local. But even with the path the script do not start. Any idea on the cause of my problem?

Post the actual script you wrote here. It might help pinpoint the cause.

Re: how associate an icon with a script? (Solved)

Posted: Fri Aug 10, 2012 6:53 am
by Asimov
I solved the problem by creating two icons, no more need for a script. Just two icon with specific command. Thank you!

Re: how associate an icon with a script? (solved)

Posted: Sun Aug 12, 2012 2:44 pm
by Asimov
thank