![]() Registered Member ![]()
|
Hi,
I am writing an application which registers icon for a mimetype. But in KDE for registering an icon you need to put that icon in the theme folder. i.e In case current theme is oxygen you need to copy your icons to $HOME/.local/share/icons/hicolor/ Hence i wanted to know if there is an API which gets me the current theme so that i can register icons for my application. |
![]() Administrator ![]()
|
Hicolor is the generic fallback theme for virtually all icon themes.
For KDE applications, you can use KConfig to read "kdeglobals". Use the group "Icons" and read the value "Theme".
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Thanks for the reply.
But i am looking for is a system binary available on KDE distros which tells us the theme, As i have using shell scripts to register the icons. >> Hicolor is the generic fallback theme for virtually all icon themes Hicolor was a typo. what i meant was the say if current theme is xyz then you need to add icons to $HOME/.local/share/icons/xyz folder in order to register the icons. |
![]() Administrator ![]()
|
The following command should do the job. Note that if the theme hasn't been set, then the value may not be present.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() KDE Developer ![]()
|
I think it is more appropriate to use xdg-icon-resource for this kind of purpose (installing icons as part of an application installation process)
Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
![]() Registered Member ![]()
|
Yes i also tried to use the same , but xdg-icon-resource doesnt work on some of KDE distributions and Ubuntu 9.10.
So i want to change/modify the script to make it work on all distributions. |
![]() KDE Developer ![]()
|
Have you checked why it didn't work?
Do they move the icon path somewhere non-standard? Or not install the hicolor default fallback theme? Anyway, since this is about installing, getting the current theme of a single user will only "help" for that respective user and only as long as the user does not change the theme. This are two of the very reasons why there is "hicolor" theme which always exists and is always used for lookup if an icon is not found in the current them. See second paragraph, first sentence here: http://standards.freedesktop.org/icon-t ... atest.html Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]