Announcement

Collapse
No announcement yet.

How can I add a unique icon for a script?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How can I add a unique icon for a script?

    I've written a script to open a program (which to start, formerly required opening Konsole, moving to the proper directory, and then opening a startup script).

    The new script works well when tested, and appears now on the desktop -- but with the usual script icon -- a small thumbnail preview of the script contents.

    My question is two part:

    How can I associate an individual icon with an individual script, instead of the overall class of scripts (*.sh, *.csh)? Is there something equivalent to a windows "shortcut" with a user definable icon?

    And second, is there a changeable window preference that applies to Desktop icons only, which allows you to show the Icon on the Desktop, and not the preview thumbnail?

    Thanks.

    #2
    Re: How can I add a unique icon for a script?

    Right-click the object.
    Select Properties.
    Click the 'wrench' icon (create new file type).
    Click on the large item icon. This will allow you to 'choose' a different icon. DO NOT CHANGE THE FILE NAME PATTERNS.
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Re: How can I add a unique icon for a script?

      You can create a new Shortcut to Application (right-click in a folder or on your desktop) and point it to the script's location Then , back in the shortcut dialog's first tab, click on the blue gear icon, which will bring up the icon selection area, where you can select standard system icons (quite a few there) or browse to a particular one you may have

      Comment


        #4
        Re: How can I add a unique icon for a script?

        Right-click the object.
        Select Properties.
        Click the 'wrench' icon (create new file type).
        Click on the large item icon. This will allow you to 'choose' a different icon. DO NOT CHANGE THE FILE NAME PATTERNS.
        Nope. Already tried that before posting this question. (I try to work stuff out myself before bothering you guys -- but this one didn't work)

        If I follow the above procedure. Then close the Properties dialog. The icon on the Desktop is still a thumbnail of the script, not a new icon.

        You can create a new Shortcut to Application (right-click in a folder or on your desktop) and point it to the script's location Then , back in the shortcut dialog's first tab, click on the blue gear icon, which will bring up the icon selection area, where you can select standard system icons (quite a few there) or browse to a particular one you may have
        Couldn't figure this one out at first.Right clicking and then pointing---. The sequence is actually: Right click on the Desktop, then click on "Create New", than click on "Link to Application", then click on "Application Tab", then click on "Browse" and point to the script's location, etc.

        This worked to create a shortcut, but the blue gear icon could not be changed.

        I suspect that this has something to do with the size of the displaed icons on the desktop vs the icons shown in the pick list in the Properties dialog.

        As an example -- if I move the two newly created shortcuts above to the "Quicklauncher" at the bottom left of the desktop, then I DO see the icons -- they are much smaller there.

        If you look in /usr/share/icons/hicolor/apps/ you'll see a lot of different sizes for icons. I'm thinking that the Properties Icon picker is only allowing one size icon to be picked, and if the desktop is not set for that size icon, you get the preview thumbnail instaed of the icon.

        That's a guess.......

        Comment


          #5
          Re: How can I add a unique icon for a script?

          it may be that not all icons are available in all sizes. I made a couple of test links with a couple different random icons from the picker, with no issues in either the quicklauncher, taskbar, or thee desktop

          The system type icons should be in all sizes, but , for example, an application specific icon may only have one or 2 sizes

          for example, I used the icon for 'basket', and that one is present in most if not all the sizes so it shows up everywhere.

          at least its my guess

          Comment


            #6
            Re: How can I add a unique icon for a script?

            Yes I know Claydoh. I have done that, then picked out the new icon from the lisyt of Icons.

            The new Icon is associated with the shortcut, but does no appear as such on the desktop, for some reason.

            It does appear as a new Icon if I drag it to the "Quicklauncher"

            I think this is a resolution related problem (bug).

            I probably have a different display resolution for icons and desktop than you do, so it is working for you, but not for me.

            Comment


              #7
              Re: How can I add a unique icon for a script?

              lol see my edited post above, I was a bit quick on the draw

              Comment


                #8
                Re: How can I add a unique icon for a script?

                Here's a snapshot of the script and a view of its properties. As you can see the properties show a different icon than what is shown on the desktop to the left.

                Attached Files

                Comment


                  #9
                  Re: How can I add a unique icon for a script?

                  Thanks Claydoh, I read your updated post.

                  Now something stranger. I tried it one more time with the blue gear, only this time picking the Tux Icon in Applications. It Then worked.

                  I then tried it with the Plan Icon, which didn't work before (see my snapshot) and now it DOES work to replace the Blue gear.

                  Something weird here. I wonder if picking Tux (a high res image) switched the icons to high res, so when I went to choose again, the Plan Icon was shown in high res in the picker.

                  I notice that the properties in the snapshot I posted shows an Icon size of a tiny 36 bytes. But now If I pick it again with your shortcut the same icon is shown as 378 bytes.

                  Something has changed in the Properties Icon picker...........

                  Comment


                    #10
                    Re: How can I add a unique icon for a script?

                    is the left one the actual script itself? The shortcut will definitely have whatever icon is selected, while the actual script will have whatever it is supposed to based on its mime-type and desktop/folder settings (in this case it is the default preview of a text file)

                    I'd suggest putting any scripts in a folder in your home dir, and point the shortcut to there. I don't see an easy way to change the icon for just one file of a given type without using a shortcut

                    Comment


                      #11
                      Re: How can I add a unique icon for a script?

                      Well, doing all this has given me a better solution overall to what I was trying to achieve.

                      The script was unnecessary. The shortcut was able to do what the script did -- change the working path to a folder and execute another script to start the program.

                      Once I knew how to set up a shortcut through KDE, I was able to modify the shortcut to do what I needed.

                      For some reason, it wouldn't display a new icon the first couple of times I picked one for it, then later would. I don't know why.

                      But everything works now, and I did get rid of the script that I couldn't alter the icon for. So I guess all is weel.

                      Just seems odd that it didn't work at first, then did later.....

                      Comment

                      Working...
                      X