Open asbachb opened 2 years ago
works for me with the papirus theme installed with home-manager snippet from strace
newfstatat(AT_FDCWD, "/home/artturin/.nix-profile/share/applications/firefox.desktop", {st_mode=S_IFREG|0555, st_size=302, ...}, 0) = 0
openat(AT_FDCWD, "/home/artturin/.nix-profile/share/applications/firefox.desktop", O_RDONLY) = 12
read(12, "[Desktop Entry]\nCategories=Netwo"..., 8191) = 302
read(12, "", 8191) = 0
openat(AT_FDCWD, "/home/artturin/.nix-profile/share/icons/Papirus/96x96/apps/firefox.svg", O_RDONLY) = 13
@Artturin thanks for having a look into this. With home manager the paths seems to be a little bit different:
openat(AT_FDCWD, "/run/current-system/sw/share/applications/spotify.desktop", O_RDONLY) = 13
read(13, "[Desktop Entry]\nType=Application"..., 8191) = 238
read(13, "", 8191) = 0
write(2, "ERROR: ", 7ERROR: ) = 7
write(2, "Failed to load icon '", 21Failed to load icon ') = 21
write(2, "spotify-client", 14spotify-client) = 14
write(2, "': ", 3': ) = 3
write(2, "Icon 'spotify-client' not presen"..., 50Icon 'spotify-client' not present in theme Adwaita) = 50
write(2, "\n", 1
) = 1
openat(AT_FDCWD, "/usr/share/pixmaps/spotify-client", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "ERROR: ", 7ERROR: ) = 7
write(2, "Failed to load icon '", 21Failed to load icon ') = 21
write(2, "spotify-client", 14spotify-client) = 14
write(2, "': ", 3': ) = 3
write(2, "Failed to open file \342\200\234/usr/shar"..., 86Failed to open file “/usr/share/pixmaps/spotify-client”: No such file or directory) = 86
As mentioned on Matrix, the primary issue is that the package lacks librsvg gdk-pixbuf loader.
@jtojnar I guess we already figured out last time that it does not fix the issue.
Might not be a sufficient condition but definitely is a necessary one.
Made a discovery when analyzing environment variables, since most icons appeared for me when running nwggrid from waybar, whereas elsewhere (from shell or hyprland keybind), many of the icons wouldn't show.
Adding on to the librsvg discussion mentioned earlier in this thread, the (probably incomplete) workaround for this, is running the command with GDK_PIXBUF_MODULE_FILE set to the proper librsvg loaders.cache file. This fixed (most of) this issue for me (on nixos-unstable branch). Here's my config snippet if it helps anyone:
home.packages = with pkgs; [
nwggrid
(pkgs.writeScriptBin "nwggrid-wrapper" ''
#!/bin/sh
GDK_PIXBUF_MODULE_FILE=${pkgs.librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache nwggrid
'')
];
Then, just call nwggrid-wrapper
instead of nwggrid
*If any of the version numbers change, the above config snippet might not be plug and play.
Describe the bug
A clear and concise description of what the bug is.
Steps To Reproduce
Window Manager:
sway
configuration.nix
:Expected behavior
Show icons.
Screenshots
Notify maintainers
@bbigras @Artturin
Metadata
Additional context
Icon Loading in nwg_launcher: https://github.com/nwg-piotr/nwg-launchers/blob/4dde40e2a0d82ae87a262e0c2babd22e309d28bf/common/nwg_classes.cc#L243-L263