FelixKratz / dotfiles

My personal macOS configuration
GNU General Public License v3.0
929 stars 92 forks source link

default icon displayed even though actual icon exists #39

Closed timchr42 closed 7 months ago

timchr42 commented 7 months ago

Hello,

In the spaces tab the icon for some applications, f.e. WhatsApp does not appear even though the corresponding sketchybar-app-icon exists. Any ideas why the app is not recognised/seen as ':default:'? Really curious to know.

Screenshot 2024-01-20 at 18 27 25

Screenshot 2024-01-20 at 18 29 38

Thanks in advance :D

FelixKratz commented 7 months ago

Probably because it is not properly contained in the event payload for the space_windows_change event, you can check what is sent through this event when inserting echo "$INFO" here: https://github.com/FelixKratz/dotfiles/blob/8d5754c0a9a217a31a2d9e8caaaf244fe31a8e54/.config/sketchybar/plugins/space_windows.sh#L8 And then running sketchybar from the commandline. See if whatsapp is contained in the apps key for the space where it is opened.

timchr42 commented 7 months ago
Screenshot 2024-01-21 at 12 43 52

This is the output I get when running sketchy bar from command line after inserting echo "$INFO$". Kind of confused cause this does not seem faulty right?

FelixKratz commented 7 months ago

That looks good so far, try inserting echo "$app" above this line: https://github.com/FelixKratz/dotfiles/blob/8d5754c0a9a217a31a2d9e8caaaf244fe31a8e54/.config/sketchybar/plugins/space_windows.sh#L13

timchr42 commented 7 months ago
Screenshot 2024-01-21 at 14 20 32

Also seems fine I guess.

FelixKratz commented 7 months ago

So the problem must be in the icon_map file, you could try to copy and paste the output from this command 1:1 into to icon_map file as the key to the whatsapp icon, maybe it is because of some unicode shenanigans.

timchr42 commented 7 months ago

Too bad, that does also not seem to cause the problem. Pasted the output 1:1.

FelixKratz commented 7 months ago

This is wild, will try to look into it because I am also a bit puzzled :D

timchr42 commented 7 months ago

Yeah, really weird. Bet its something stupid :D Tanks a lot for looking into it 🙏

FelixKratz commented 7 months ago

Ok so it turns out that whatsapp includes the byte sequence e2 80 8e as the leading bytes in their app name, this is the unicode character U+200E and is an invisible control character that indicates that this word shall be printed left to right in all languages, even if they are right to left.... the fix is to include this invisible control character in the icon map.

FelixKratz commented 7 months ago

You need to update the font, because it contains new icons for the terminals:

curl -L https://github.com/kvndrsslr/sketchybar-app-font/releases/download/v1.0.23/sketchybar-app-font.ttf -o $HOME/Library/Fonts/sketchybar-app-font.ttf
timchr42 commented 7 months ago

that's what I've realised also xD But there's still a problem. I guess the key is wrong because in icon_map.sh it says "iTerm" and not "iTerm2".

FelixKratz commented 7 months ago

Oh that might be a regression introduced here: https://github.com/kvndrsslr/sketchybar-app-font/pull/38 You could report that there so it geta fixed upstream as well

timchr42 commented 7 months ago

yup, just did