how associate an icon with a script? (solved)
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
how associate an icon with a script? (solved)
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 LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: how associate an icon with a script?
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
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?
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.
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.
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;
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?
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?
- Pilosopong Tasyo
- Level 6
- Posts: 1432
- Joined: Mon Jun 22, 2009 3:26 am
- Location: Philippines
Re: how associate an icon with a script?
Post the actual script you wrote here. It might help pinpoint the cause.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?
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].
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
Re: how associate an icon with a script? (Solved)
I solved the problem by creating two icons, no more need for a script. Just two icon with specific command. Thank you!