Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardcoded icon path in launcher for GNU/Linux systems #308

Open
palob opened this issue May 28, 2015 · 5 comments
Open

Hardcoded icon path in launcher for GNU/Linux systems #308

palob opened this issue May 28, 2015 · 5 comments

Comments

@palob
Copy link

palob commented May 28, 2015

Hi,

currently the icon path specified in the created .desktop launcher file is set to:
Icon=%s/share/icons/komodo48.png

This prevents icon theming without editing the launcher file.

I'd like to ask you to change the icon location as well as the icon path line in the launcher according to the freedesktop.org standards.

Please find more info here:
http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html
https://github.com/Foggalong/hardcode-fixer/wiki/What,-Why-&-How

According to the above resources standard icon locations are:

/usr/share/icons/hicolor/[size]/apps/[icon name]
~/.local/share/icons/hicolor/[size]/apps/[icon name]
or alernatively:
/usr/share/pixmaps/[icon name]

The corresponding standard icon line in the .desktop launcher is:
Icon=[icon name] (without full path, without file extension)

Cf. this example .desktop launcher presented in the freedesktop.org documentation.

for instance
Icon=komodo

(for an icon komodo.svg or komodo.png stored in standard location

Could you please install the icon to one of those locations and adjust the icon path in the .desktop file accordingly?

@Naatan Naatan added this to the 9.2 milestone May 29, 2015
@Naatan
Copy link
Member

Naatan commented May 29, 2015

Aye this has annoyed me too - will do.

@Naatan
Copy link
Member

Naatan commented Jul 6, 2015

Reading up on this, is there no way to use this without installing an icon in an OS directory? We are not packaging Komodo for individual linux distro's atm, which means Komodo comes with all its dependencies and doesn't "infect" directories outside of its install and profile directories. It seems to me that's a problem with defining an icon that can be picked up by icon themes while still being able to fall back on the default, unless Komodo extracts its icon to the OS icon dir, which simply isnt feasible unless we package Komodo for individual distro's.

@Naatan Naatan modified the milestones: Backlog, 9.2 Jul 6, 2015
@palob
Copy link
Author

palob commented Jul 7, 2015

Well, your chosen icon path allows for both a global/local installation into /usr/share/... or $HOME/.local/share/... respectively.
It's already stored outside of Komodo's install and profile directories.

Reading the paragraph in http://standards.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html about the icon lookup procedure it occured to me $XDG_DATA_DIRS/icons is another standard directory. Hence it might very well be possible to change the icon line to simply Icon=komodo48 (or Icon=komodo if the PNG is renamed to komodo.png) without even touching the path the icon is installed to. It will show up no matter what's the chosen icon theme.

However for some reason the preferred paths are .../share/icons/hicolor/[size]/apps/[icon name] or simply .../share/pixmaps. At least that's how other application do this, may be not to clutter the icons directory.

The ´´hicolor´´ theme is standardised by freedesktop.org and AFAIK each and every icon theme coming with whatever distro inherits from it. It's the standard fallback theme.
Otherwise many application icons wouldn't show up.

TL;DR
Following the freedesktop.org standard actually is what ensures that icons

can be picked up by icon themes while still being able to fall back on the default

@palob
Copy link
Author

palob commented Jul 8, 2016

One more argument in favour of "dehardcoding":

Currently the hardcoded icon line Icon=%s/share/icons/komodo48.png causes that no matter where always the 48px X 48px will be shown.

Whenever an icon bigger than that is needed (e.g. GNOME Shell overview, HiDPI screens) the icon will appear blurry.
Whenever an icon smaller than that is needed you will lose on recognisability compared to an icon designed for smaller sizes.

However you do provide icon in various sizes from as small as 16x16 up to 256x256 (which remain unused) so this could be solved.

By changing the icon line to Icon=komodo, installing the respectively sized icons to .../share/icons/hicolor/[size]/apps/ and renaming all icon files to just komodo.png you can make sure that always the appropriately sized icon is shown.

It's specified this way in the index.theme of the hicolor icon theme.

The hicolor theme is present in all desktop environments adhering to freedesktop.org standards.
All DEs available for GNU/Linux or BSD distros I know of (GNOME, KDE Plasma, Xfce, MATE, LXDE, LXQt, Pantheon, Cinnamon, Unity, Budgie, Deepin, Enlightenment, Lumina, Hawaii Shell, Papyros Shell) do this.

@Naatan Naatan modified the milestones: 10.1, Backlog Jul 8, 2016
@Naatan
Copy link
Member

Naatan commented Jul 8, 2016

I'll try experimenting with this, but if the install directory itself cannot be used as a fallback then this is a no-go at least until we do distro specific packages.

@Naatan Naatan modified the milestones: 10.1, 11 Aug 15, 2016
@Naatan Naatan modified the milestones: Perpetual, 11 Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants