how associate an icon with a script? (solved)

Forum rules
Before you post please read how to get help

how associate an icon with a script? (solved)

Postby Asimov on Wed Aug 01, 2012 8:06 pm

Many desktop lack a tool to switch keyboard layout. Thrust me, you don't want't make C programming on a canadian layout.
Last edited by Asimov on Sun Aug 12, 2012 2:46 pm, edited 1 time in total.
Asimov
Level 2
Level 2
 
Posts: 95
Joined: Wed Aug 01, 2012 4:04 am

Linux Mint is funded by ads and donations.
 

Re: how associate an icon with a script?

Postby Gazpacho on Fri Aug 03, 2012 3:54 am

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
Gazpacho
Level 1
Level 1
 
Posts: 8
Joined: Thu Aug 02, 2012 7:07 am

Re: how associate an icon with a script?

Postby Jamesc359 on Mon Aug 06, 2012 7:46 pm

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. :-)
“Gosh, you've... really got some nice toys here.”
User avatar
Jamesc359
Level 3
Level 3
 
Posts: 136
Joined: Sun May 06, 2012 1:42 pm

Re: how associate an icon with a script?

Postby Asimov on Tue Aug 07, 2012 6:35 pm

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?
Asimov
Level 2
Level 2
 
Posts: 95
Joined: Wed Aug 01, 2012 4:04 am

Re: how associate an icon with a script?

Postby Pilosopong Tasyo on Wed Aug 08, 2012 3:47 am

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.
Image
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
User avatar
Pilosopong Tasyo
Level 6
Level 6
 
Posts: 1190
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

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

Postby Asimov on Fri Aug 10, 2012 6:53 am

I solved the problem by creating two icons, no more need for a script. Just two icon with specific command. Thank you!
Asimov
Level 2
Level 2
 
Posts: 95
Joined: Wed Aug 01, 2012 4:04 am

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

Postby Asimov on Sun Aug 12, 2012 2:44 pm

thank
Asimov
Level 2
Level 2
 
Posts: 95
Joined: Wed Aug 01, 2012 4:04 am

Linux Mint is funded by ads and donations.
 

Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 1 guest