Application icons not fetched from desktop files
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
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 :)
Good luck.
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?
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.
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
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
You are probably right, alttab should use NET_WM_ICON and _NET_WM_ICON when available.
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.
Pixmap-related bug fixed in 5895d40.