alttab icon indicating copy to clipboard operation
alttab copied to clipboard

Application icons not fetched from desktop files

Open tallero opened this issue 7 years ago • 7 comments

Apparently alttab does not fetch .desktop files from ~/.local/applications and probably does not use available icons of any dimension when an icon of a dimension "similar" to the one given to the widget is missing. In particular, this happening with repo-installed dillo/telegram. PS: really great software

tallero avatar Jul 30 '18 20:07 tallero

You are right about .desktop files, this behaviour is fully documented in man page, type: man alttab or man -l path_to_alttab_repo/doc/alttab.1 and search for -s option description, and also -theme option. Implementing full freedesktop standards would complicate the code and bring dependencies.

For native Telegram client, I have the following as /usr/share/icons/hicolor/256x256/apps/telegram.png :) telegram Good luck.

sagb avatar Jul 31 '18 07:07 sagb

I don't know if this works well for interoperability. Official telegram .desktop file searches for "telegram" icon despite WM_CLASS being telegram-desktop. Wouldn't be better a solution that does not requires root access edits to fix things?

tallero avatar Aug 06 '18 06:08 tallero

Well, I'm going to provide some explanation for future references.

Unfortunately, .desktop file concept isn't suitable for working with windows: it doesn't associate X11 windows with icons. What it associates with icon is "Exec" entry, which may contain any crap not relevant to X11 windows, like "some-wrapper.sh". I.e., window manager (not alttab) is supposed to execute a program and then track its windows etc.

It's not for third party utility like alttab. Usually, such an utility doesn't try to parse file icons at all and uses only icons rarely available from X11 properties.

But alttab tries to do this, because i love icons :) The only X11 window property which roughly correspond to icon names is WM_CLASS. Many programs have two class strings, i.e. my telegram client has: WM_CLASS(STRING) = "Telegram", "TelegramDesktop" and both telergam.png and telegramdesktop.png (case-insensitive) are searched by alttab.

It's a hack. I would listen to everybody who knows a better lightweight approach to associate icons with X11 windows.

sagb avatar Aug 15 '18 08:08 sagb

Wouldn't be better a solution that does not requires root access edits to fix things?

Root isn't necessary, use ~/.local/share/icons/hicolor/256x256/apps/whatever.png

sagb avatar Nov 02 '18 13:11 sagb

Openbox does search in NET_WM_ICON first, then fallbacks to XGetWMHints. It works for telegram, but not for dillo.

https://github.com/danakj/openbox/blob/9e8813e111cbe6c1088f6abbc771a29470f05fc2/openbox/client.c#L2238-L2269

xzfc avatar Nov 24 '18 01:11 xzfc

You are probably right, alttab should use NET_WM_ICON and _NET_WM_ICON when available.

sagb avatar Apr 01 '19 21:04 sagb

Since 1df30b1 alttab also scans for icons in legacy directories without freedesktop structure, for ancient apps like rxvt, dillo: /usr/share/pixmaps, ~/.local/share/pixmaps.

sagb avatar May 07 '19 11:05 sagb

Pixmap-related bug fixed in 5895d40.

sagb avatar Mar 08 '23 13:03 sagb