Scripted Plasmoid icon

Thomas Olsen tanghus at gmail.com
Wed Oct 14 15:41:17 CEST 2009


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/code/main.py 
:

# 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