Scripted Plasmoid icon

Thomas Olsen tanghus at gmail.com
Wed Oct 14 16:31:07 CEST 2009


On 14/10-2009 15:50 Marco Martin <notmart at gmail.com> wrote:
> On Wednesday 14 October 2009, Thomas Olsen wrote:
> > Hi
> >
> > I've been googling all day to find a way to use a custom icon for your
> > Plasmoid.
> >
> > I found the following snippet in http://code.google.com/p/gmail-
> > plasmoid/source/diff?spec=svn22&r=22&format=side&path=/trunk/contents/cod
> >e/ main.py
> 
> icon to be shown in the widgets explorer, icon of te popupapplet, or..?

Actually both :-) I haven't gotten around to making it a popup applet since I 
ran into some problems.

> 
> > # Install icon if required
> > kdehome = str(KGlobal.dirs().localkdedir())
> > if not os.path.exists(kdehome+"share/icons/gmail-plasmoid.svg"):
> >   try:
> >     shutil.copy(self.package().path() +
> >  "contents/icons/gmail-plasmoid.svg",
> >  kdehome+"share/icons/gmail-plasmoid.svg")
> >   except:
> >     print "Problem copying icon"
> >     print "Unexpected error:", sys.exc_info()[0]
> >
> > Is this really the best way to do it?
> > I think that ideally you should just place your icon somewhere under
> > contents/icons, put it in the metadata.desktop file under "Icon" and it
> >  should be recognized by Plasma.
> >
> > BTW: The file hierarchy of a Plasmoid isn't really well documented
> > anywhere that I can find. If anyone can explain it to me I will be happy
> > to document it on TechBase.
> 

-- 
Best Regards / Med venlig hilsen

  Thomas Olsen



More information about the Plasma-devel mailing list