You are not logged in.

#1 2024-05-04 05:02:38

carpenter
Member
Registered: 2024-04-21
Posts: 14

what's the icon solution in linux ?

I use cinnamon desktop, how does linux choose icons from /usr/share/icons ? what's the sequence ?

sometimes it choose the icons in /usr/share/icons/hicolor/32x32,

sometimes it choose the icons in /usr/share/icons/hicolor/128x128

sometimes /usr/share/icons/hicolor/scalable/apps

sometimes /usr/share/icons/'a folder of the specific theme'/apps/48

very confused

Offline

#2 2024-05-04 07:39:56

seth
Member
Registered: 2012-09-03
Posts: 59,187

Re: what's the icon solution in linux ?

"linux" chooses nothing, it's each client by itself.

Most of them will rely on some toolkit, but they can request specific sizes (eg. if you want an icon for a 16x16px button, you don't ask for the 128x128 version unless there's no 16x16 version) and the theme is typically configurable for clients/toolkits as well. /usr/share/icons/hicolor is generally understood to be the fallback theme, but nothing would prevent me to load an icon explicitly from there.

At the end of the day, they're just images.

Online

#3 2024-05-05 18:38:14

carpenter
Member
Registered: 2024-04-21
Posts: 14

Re: what's the icon solution in linux ?

seth wrote:

"linux" chooses nothing, it's each client by itself.

Most of them will rely on some toolkit, but they can request specific sizes (eg. if you want an icon for a 16x16px button, you don't ask for the 128x128 version unless there's no 16x16 version) and the theme is typically configurable for clients/toolkits as well. /usr/share/icons/hicolor is generally understood to be the fallback theme, but nothing would prevent me to load an icon explicitly from there.

At the end of the day, they're just images.

thanks, now I got some experience

Last edited by carpenter (2024-05-06 00:45:11)

Offline

#4 2024-05-05 19:32:49

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,995

Re: what's the icon solution in linux ?

If you're talking about icons for applications that are used for desktop shortcuts , system tray and such :

Those are normally set through .desktop files on a per-application basis. see  https://wiki.archlinux.org/title/Desktop_entries (especially chapter 3 and 4 ).


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#5 2024-05-06 00:44:23

carpenter
Member
Registered: 2024-04-21
Posts: 14

Re: what's the icon solution in linux ?

thanks, guys, now I found that linux would choose /usr/share/icons/your theme/** then /usr/share/icons/hicolor/scalable/apps then /usr/share/icons/hicolor/32x32 (from smaller size to large size)

and it's important to use ```gtk-update-icon-cache -q -t -f /usr/share/icons/some folder``` to update icons cache.

Offline

#6 2024-05-06 07:03:35

seth
Member
Registered: 2012-09-03
Posts: 59,187

Re: what's the icon solution in linux ?

Again: *linux* chooses *nothing* here - the ultimate authority is the actual process, your description is (mostly) correct for generic gtk icon usage, but cannot be generalized.

I assume this is an https://en.wikipedia.org/wiki/XY_problem ?
What actual situation are you concerned about?
If this is actually an generic inquiry, there simply is no definitive answer to your question. "It depends".

You can however strace any process to see what files it tries to access in what order and infer its particular icon loading strategy from that.
But some clients might also use emojis from fonts as icons or render them on the fly - that will not really show up in a strace.

Online

Board footer

Powered by FluxBB