Meego Wiki
From MeeGo wiki
Jump to: navigation, search

Contents

Proposal for Icon names and paths in desktop files

After observing the many ways we do use icons for applications in Nemo I though to write a proposal and recommendation on two ways of doing things, because I do not see more than two ways that would make sense.

I want my icon to be themable

[Desktop Entry]
Name=Terminal
Icon=icons-Applications-terminal

This is a named icon. Named icon comes from the theme and can have any supported suffix like png, jpg or svg. Icons are in the icons directory in the theme - not the other directories like images or svg.

How does it get there?

  • Platform applications already have icons available in the Base theme. If your app is a platform app or can use those icons, use them.
  • The application can install the icon itself to /usr/share/themes/base/meegotouch/icons and refer to them by as named icons.

If icon exists in base theme, it is available no matter what theme is used. It can be themed by new themes if needed, its size and meaning can be modified by theme designers. Overall - this is easy way to make the icon of your app to fit.

I want my icon to be specifically the one I provide

[Desktop Entry]
Name=Bunny Racer Pro
Icon=/usr/share/icons/hicolor/80x80/bunny-racer.png

By giving a path to the icon things are made easy and clear. There is never a confusion over who owns an icon and who provides it. The application in question does. The icon is given and will not be themed or changed by anyone, ever. The location on the filesystem can be anywhere, few suitable places come to mind:

* /usr/share/icons/hicolor/80x80
* /usr/share/icons/hicolor/64x64
* /usr/share/pixmaps

What to avoid

[Desktop Entry]
Name=Terminal
Icon=/usr/share/themes/base/meegotouch/svg/icons-Applications-terminal.svg

Why not?

  1. Wrong place - svg directory is for assets, not for icons.
  2. Do not refer to icons in the theme directory by absolute paths, that beats the purpose
  3. Also, there is already a terminal icon in the base theme, why not using that?
[Desktop Entry]
Name=Marble
Icon=/usr/share/themes/n900de/meegotouch/icons/icons-Applications-marble.svg

Why not?

  1. do not install application icons into some derived theme - install into base theme (/usr/share/themes/base/meegotouch/icons)
  2. Do not use absolute paths to icons inside the theme directories, if you want to use absolute path, put the icon into some typical location (/usr/share/pixmaps or /usr/share/icons/hicolor/)
Personal tools