Bug 388270 - Custom icon for plasma widget
Summary: Custom icon for plasma widget
Status: RESOLVED WORKSFORME
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-27 12:03 UTC by Jiri Tyr
Modified: 2019-11-04 21:36 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Tyr 2017-12-27 12:03:32 UTC
Currently, icons for Plasma 5 widgets must be specified either as an absolute path or as a name of a system theme icon. When delivering Plasma 5 widget  through the store.kde.org, there is no way how to specify custom icon because absolute path is different for each user (/home/myuser/.local/share/plasma/plasmoids/my.widget.name).

It would be great if the widget icon would be search also in the widget directory. For example if I specify "icon=icons/myicon.svgz" in the metadata.desktop, the icon in "icons/myicon.svgz" in the widget directory would be used.
Comment 1 David Edmundson 2018-01-03 09:03:25 UTC
which icon do you mean?
Comment 2 Jiri Tyr 2018-01-03 10:55:22 UTC
I mean the icon which is shown in the "Widgets" slide out panel after I click on the "Add widgets". The icon which is normally indicated by the "icon=..." in the metadata.desktop file.

The "icon=..." value can be either an icon name in which case the system icon is used (/usr/share/icons/<theme>/<category>/<size>/<icon>.svg) OR it can be an absolute path. If the widget was installed into the user home directory, it's not possible to define correct absolute path in the metadata.desktop file (which is distributed with the widget) because each user has different path (/home/<user>/.local/share/plasma/plasmoids/<widget>/<icon>.png).

This is why I suggest to search for the icon in the widget directory first before trying to search for the icon in the system theme.
Comment 3 Nate Graham 2018-11-26 14:48:15 UTC
Marco and/or Kai isn't there an undocumented way to do this? I recall one of you helping Scott Harvey with this a while back.
Comment 4 David Edmundson 2019-11-04 21:20:14 UTC
screenshot.png in the package root dir.
Comment 5 Nate Graham 2019-11-04 21:36:22 UTC
Well there you have it. :)