This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to set icon for script

Tags: None
(comma "," separated)
De_Dood
Registered Member
Posts
18
Karma
0
OS

How to set icon for script

Wed Dec 01, 2010 7:42 am
Hi,

Sorry if it is already explained somewhere but I can't find it.

I want to create a custom icon for my Amarok 2 script but I can't seem to find how I have to do this.
I know I should change it in the script.spec file and this probably by setting the Icon value. But when I set this to the filename of my icon (icon.png) it doesn't show the icon I made. The icon is located in the same folder as my script.
I also don't know if the Icon variable even accepts a filename as icon because when I look at the example on http://amarok.kde.org/wiki/Development/ ... _HowTo_2.0 it looks more like it accepts another variable in stead of a file. But I can't figure out where and how to set this variable.

Thanks for any help.
frapell
Registered Member
Posts
14
Karma
0

Re: How to set icon for script

Sun Dec 05, 2010 12:18 am
I'm having this exact same issue, i'm following how Librivox is implemented and it uses:

Icon=view-services-librivox-amarok

inside [Desktop Entry]

Now, i have no idea what "view-services-librivox-amarok" is, and how to create one for my project. I cannot find documentation either...
De_Dood
Registered Member
Posts
18
Karma
0
OS

Re: How to set icon for script

Sun Dec 05, 2010 8:04 am
I figured out that view-services-librivox-amarok is the filename and that multiple versions of these files are located on the following locations:
/usr/share/kde4/apps/amarok/icons/hicolor/16x16/actions/
/usr/share/kde4/apps/amarok/icons/hicolor/22x22/actions/
But I have no idea how to get our icons in there when you are installing your script because I don't think that much users install there script with root access.
frapell
Registered Member
Posts
14
Karma
0

Re: How to set icon for script

Sun Dec 05, 2010 4:25 pm
I copied my icon in those 2 directories, then i used the icon name in the script.spec file (with and without the extension) but that didn't worked... there seems to be an "icon-cache.kcache" in "~/.kde/cache-[name]/" where these icons are registered with names, but no idea how to generate it again.

After a lot of testing i found that using the absolute path for the icon in the script.spec works, even more, using the relative path works too. So adding "./" in front of the icon name (if it is located in the same folder) seems to work.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: How to set icon for script

Sun Dec 05, 2010 10:30 pm
Note that removing the cache outside of KDE is sufficient to trigger it to be rebuilt by KDE on next login.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
De_Dood
Registered Member
Posts
18
Karma
0
OS

Re: How to set icon for script

Tue Dec 07, 2010 11:56 am
Thanks frapell,

Using the absolute path works for me. The relative path however doesn't.
Any thoughts?
frapell
Registered Member
Posts
14
Karma
0

Re: How to set icon for script

Fri Dec 10, 2010 1:19 am
mmm... i really don't know, i use ./Icon.png and it works :-S


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], Sogou [Bot]