Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some applications are missing icons in gnome-shell activity and dock (not reproducible in a fresh account) #45935

Closed
alexeymuranov opened this issue Sep 2, 2018 · 24 comments
Labels
0.kind: bug Something is broken 6.topic: GNOME GNOME desktop environment and its underlying platform

Comments

@alexeymuranov
Copy link
Contributor

alexeymuranov commented Sep 2, 2018

Issue description

I have several applications (installed with nix-env -i) that are missing icons in gnome-shell activity and dock (dash-to-dock). Here are a few: Chromium, Emacs, Inkscape, Geary, LibreOffice, VLC.

Firefox was also missing the icon, but it was fixed: #38536.

Similar issues are mentioned in #247 and #16758.

There is no problems with applications installed using environment.systemPackages.

Steps to reproduce

I cannot currently reproduce the issue in a fresh user account, but I have it in my user accounts on two different machines.

In my case, with GNOME desktop:

nix-env -i vlc

If i restart gnome-shell and look for VLC, the VLC icon is missing.

Technical details

Output of nix-shell -p nix-info --run "nix-info -m":

 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.67, NixOS, 18.03.133183.a37638d4670 (Impala)`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.0.4`
 - channels(alexey): `"nixos-17.03-17.03.1949.78e9665b48f, nixos-17.09-17.09.3238.e984f9e48e1"`
 - channels(root): `"nixos-18.03.133183.a37638d4670"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`
@jtojnar jtojnar added 6.topic: GNOME GNOME desktop environment and its underlying platform 0.kind: bug Something is broken labels Sep 2, 2018
@jtojnar
Copy link
Member

jtojnar commented Sep 2, 2018

And I still cannot reproduce. Could you share your configuration.nix?

P.S. nix-env -iA is much faster (without -A it needs to go through the whole nixpkgs and check name attributes of packages, instead of just traversing attribute path)

@alexeymuranov
Copy link
Contributor Author

alexeymuranov commented Sep 2, 2018

Here is my configuration.nix.

I have this issue on both machines where i installed NixOS.

@jtojnar
Copy link
Member

jtojnar commented Sep 2, 2018

One thing that comes to mind is gtk-update-icon-cache in system-path module:

if [ -x $out/bin/gtk-update-icon-cache -a -f $out/share/icons/hicolor/index.theme ]; then
$out/bin/gtk-update-icon-cache $out/share/icons/hicolor
fi

Try nix-env -iA gtk3. (Though, I do not have it installed in user profile and icons still works for me.)

@alexeymuranov
Copy link
Contributor Author

alexeymuranov commented Sep 2, 2018

I tried nix-env -iA nixos.gtk3 on one of the two machines, it did not help.

Note that Firefox also had this issue, but then it was fixed, apparently in this commit: 6ca5577.

@alexeymuranov
Copy link
Contributor Author

@jtojnar, could you try reinstalling your GNOME Shell? Apparently my icons disappeared after i reinstalled it somehow.

@jtojnar
Copy link
Member

jtojnar commented Sep 2, 2018

I did restart GNOME Shell (using alt-f2 r) because the launchers would not appear without it due to #12757.

Firefox issue was caused by a broken symlink in the package. Also unrelated,
Libreoffice had a similar issue caused by a wrong Icon= value in the desktop file, but that has been fixed as well.

Chromium’s icon matches, therefore the issue must be unrelated to those two:

$ grep Icon $(nix-build -A chromium)/share/applications/chromium-browser.desktop
Icon=chromium
$ find $(nix-build -A chromium)/share/icons -follow -name chromium.png
/nix/store/hmnd65lwj5zgd3hm18s1h8sahspjkfs2-chromium-68.0.3440.106/share/icons/hicolor/24x24/apps/chromium.png
/nix/store/hmnd65lwj5zgd3hm18s1h8sahspjkfs2-chromium-68.0.3440.106/share/icons/hicolor/256x256/apps/chromium.png
/nix/store/hmnd65lwj5zgd3hm18s1h8sahspjkfs2-chromium-68.0.3440.106/share/icons/hicolor/48x48/apps/chromium.png
/nix/store/hmnd65lwj5zgd3hm18s1h8sahspjkfs2-chromium-68.0.3440.106/share/icons/hicolor/64x64/apps/chromium.png
/nix/store/hmnd65lwj5zgd3hm18s1h8sahspjkfs2-chromium-68.0.3440.106/share/icons/hicolor/128x128/apps/chromium.png
/nix/store/hmnd65lwj5zgd3hm18s1h8sahspjkfs2-chromium-68.0.3440.106/share/icons/hicolor/22x22/apps/chromium.png

@alexeymuranov
Copy link
Contributor Author

alexeymuranov commented Sep 2, 2018

By "reinstalling GNOME shell" I meant something like nix-env -iA nixos.gnome3.gnome-shell. I remember that it was this or similar command that provoked the issue in my case.

However, now I do not have gnome-shell explicitly installed anywhere, but the issue remains. (I think i might have installed it before with nix-env -i trying to debug something.)

@alexeymuranov
Copy link
Contributor Author

alexeymuranov commented Sep 2, 2018

Indeed, i could not reproduce the issue in a fresh user account. However, i have the issue on two different machines in user accounts created more than 2 years ago, which i did not synchronise between them. I wonder where to look for the problem...

I'll try to bisect the problem when i have more time. Thanks for your help.

@alexeymuranov alexeymuranov changed the title Some applications are missing icons in gnome-shell activity and dock Some applications are missing icons in gnome-shell activity and dock (not reproducible in a fresh account) Sep 2, 2018
@alexeymuranov
Copy link
Contributor Author

I cannot reproduce the issue in a fresh account even after copying over my ~/.config, ~/.local, ~/.cache, and a few other dot-files and dot-folders.

Where else could some configuration be hiding? Could something get out of order in my ~/.nix-profile?

@jtojnar
Copy link
Member

jtojnar commented Sep 2, 2018

Try to check if the profile you installed the packages to is listed in $XDG_DATA_DIRS environment variable and if the icons are in the profile. Not sure what else could that be.

@alexeymuranov
Copy link
Contributor Author

The output of echo $XDG_DATA_DIRS is identical in old and fresh accounts -- apart from the difference in the account name.

@alexeymuranov
Copy link
Contributor Author

alexeymuranov commented Sep 3, 2018

It seems that my icons are in place:

$ ls /nix/store/*-vlc-*/share/icons/hicolor/*/apps/*.png
/nix/store/bjh7z6mcx1jhgmdfn72gp70j049cw6b3-vlc-3.0.3/share/icons/hicolor/128x128/apps/vlc-kb.png
/nix/store/bjh7z6mcx1jhgmdfn72gp70j049cw6b3-vlc-3.0.3/share/icons/hicolor/128x128/apps/vlc.png
/nix/store/bjh7z6mcx1jhgmdfn72gp70j049cw6b3-vlc-3.0.3/share/icons/hicolor/128x128/apps/vlc-xmas.png
/nix/store/bjh7z6mcx1jhgmdfn72gp70j049cw6b3-vlc-3.0.3/share/icons/hicolor/16x16/apps/vlc.png
/nix/store/bjh7z6mcx1jhgmdfn72gp70j049cw6b3-vlc-3.0.3/share/icons/hicolor/256x256/apps/vlc.png
/nix/store/bjh7z6mcx1jhgmdfn72gp70j049cw6b3-vlc-3.0.3/share/icons/hicolor/32x32/apps/vlc.png
/nix/store/bjh7z6mcx1jhgmdfn72gp70j049cw6b3-vlc-3.0.3/share/icons/hicolor/48x48/apps/vlc.png
/nix/store/bjh7z6mcx1jhgmdfn72gp70j049cw6b3-vlc-3.0.3/share/icons/hicolor/48x48/apps/vlc-xmas.png

@jtojnar, could you suggest me some documentation or explain how icon lookup works in GNOME Shell, so that i could try to trace where it breaks?

By the way, from which directory did you execute this line?

$ find $(nix-build -A chromium)/share/icons -follow -name chromium.png

@jtojnar
Copy link
Member

jtojnar commented Sep 3, 2018

Icon Theme Spec should be used. Basically, icons subdirectories of paths in $XDG_DATA_DIRS are checked for the icon. Try something like

IFS=: for d in $XDG_DATA_DIRS; do
    find $d -name vlc.png -follow
done

I ran the nix-build command in nixpkgs checkout.

@alexeymuranov
Copy link
Contributor Author

alexeymuranov commented Sep 3, 2018

Thanks for the link to Icon Theme Specification.

Running find as you suggested for vlc icons, gave me this in the affected account:

find: ‘/etc/profiles/per-user/alexey/share’: No such file or directory
/home/alexey/.nix-profile/share/icons/hicolor/16x16/apps/vlc.png
/home/alexey/.nix-profile/share/icons/hicolor/128x128/apps/vlc.png
/home/alexey/.nix-profile/share/icons/hicolor/32x32/apps/vlc.png
/home/alexey/.nix-profile/share/icons/hicolor/256x256/apps/vlc.png
/home/alexey/.nix-profile/share/icons/hicolor/48x48/apps/vlc.png
find: ‘/nix/var/nix/profiles/default/share’: No such file or directory

and the same thing in the fresh account.

I tried

$ xdg-open /home/alexey/.nix-profile/share/icons/hicolor/256x256/apps/vlc.png

and it worked fine.

(There was a small anomaly in 128x128 sizes: the old account had a symlink for vlc.png there as usual, but the fresh account had actual files (or hardlinks?) with permissions -r--r--r--.)

Looking for inkscape icons finds strictly more files in the affected account than in the fresh one:

find: ‘/etc/profiles/per-user/alexey/share’: No such file or directory
/home/alexey/.nix-profile/share/icons/hicolor/16x16/apps/inkscape.png
/home/alexey/.nix-profile/share/icons/hicolor/24x24/apps/inkscape.png
/home/alexey/.nix-profile/share/icons/hicolor/32x32/apps/inkscape.png
/home/alexey/.nix-profile/share/icons/hicolor/256x256/apps/inkscape.png
/home/alexey/.nix-profile/share/icons/hicolor/48x48/apps/inkscape.png
/home/alexey/.nix-profile/share/icons/hicolor/22x22/apps/inkscape.png
/home/alexey/.nix-profile/share/icons/HighContrast/16x16/apps/inkscape.png
/home/alexey/.nix-profile/share/icons/HighContrast/24x24/apps/inkscape.png
/home/alexey/.nix-profile/share/icons/HighContrast/32x32/apps/inkscape.png
/home/alexey/.nix-profile/share/icons/HighContrast/256x256/apps/inkscape.png
/home/alexey/.nix-profile/share/icons/HighContrast/48x48/apps/inkscape.png
/home/alexey/.nix-profile/share/icons/HighContrast/22x22/apps/inkscape.png
find: ‘/nix/var/nix/profiles/default/share’: No such file or directory
/run/current-system/sw/share/icons/HighContrast/16x16/apps/inkscape.png
/run/current-system/sw/share/icons/HighContrast/24x24/apps/inkscape.png
/run/current-system/sw/share/icons/HighContrast/32x32/apps/inkscape.png
/run/current-system/sw/share/icons/HighContrast/256x256/apps/inkscape.png
/run/current-system/sw/share/icons/HighContrast/48x48/apps/inkscape.png
/run/current-system/sw/share/icons/HighContrast/22x22/apps/inkscape.png

Nothing is found in ~/.nix-profile/share/icons/HighContrast/ in the fresh account.

@jtojnar
Copy link
Member

jtojnar commented Sep 3, 2018

Are the icons shown when you install the packages using environment.systemPackages?

@alexeymuranov
Copy link
Contributor Author

Yes.

@alexeymuranov
Copy link
Contributor Author

alexeymuranov commented Sep 5, 2018

I will remove my previous comment. So, i fixed the problem on both computers. What fixed it was upgrading to 18.09 (this itself did not fix the icons) and then executing

nix-env -u '*'

This was quite strange, because VLC and some other affected applications were not updated, but all icons got fixed.

Downgrading back to 18.03, while keeping applications installed with nix-env -i, did not make the icons disappear.

@alexeymuranov
Copy link
Contributor Author

I am closing this as i still do not see how to reproduce it, and maybe it will not occur again.

@alexeymuranov
Copy link
Contributor Author

I observe that installing, upgrading, or reinstalling packages imperatively in user profile behaves rather strangely, and the effects are difficult to predict or reproduce.

For example, my icons disappeared after some command of the form nix-env -i. Now i upgraded NixOS to 18.09 and did nix-env -iA nixos.vlc, but VLC icon did not appear. Then i did nix-env -u '*', which did not touch VLC, but its icon appeared. Then i noticed that network streaming in VLC did not work anymore. I did nix-env -iA nixos.vlc once again and it got fixed.

I do not know yet how to report this as an issue...

@alexeymuranov
Copy link
Contributor Author

After the latest upgrade to NixOS 18.09.1853.c2950341d03, a few icons disappeared again: Chromium, Geary, VLC, and some others. I could not reproduce the issue on another machine.

Reinstalling affected applications did not help.

@alexeymuranov
Copy link
Contributor Author

I am reopening this. I still cannot reproduce the problem in a fresh account, but I have it again in my usual account with apparently the same symptoms, and I cannot fix it.

@alexeymuranov alexeymuranov reopened this Jan 15, 2019
@alexeymuranov
Copy link
Contributor Author

I upgraded to 19.03 and the icons got fixed again. I missed the exact operation that got them fixed, but i noticed it after upgrading manually installed packages.

Closing this (at least for another half a year).

@maxkrieger
Copy link

For me, my issue was selecting GNOME instead of GNOME+Xorg on login (click the cog icon).

@matheus23
Copy link

For me, my issue was selecting GNOME instead of GNOME+Xorg on login (click the cog icon).

Fascinating.
I had this issue as well. However, I was not on GNOME+Xorg.
But simply the act of switching from one to the other fixed it for both for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: GNOME GNOME desktop environment and its underlying platform
Projects
None yet
Development

No branches or pull requests

4 participants