NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.46k stars 12.96k forks source link

Plasma6 plasmashell: task manager icons break with nixos rebuild #322023

Open ClockGen opened 1 week ago

ClockGen commented 1 week ago

Describe the bug

Icons added to the task manager in plasmashell break after rebuilding nixos and running nix-collect-garbage -d.

Screenshot_20240623_220439

After examining ~/.config/plasma-org.kde.plasma.desktop-appletsrc, I noticed that added entries reference absolute path in /nix/store instead of /run/current-system/sw/share/applications.

Screenshot_20240623_220826

So plasmashell can no longer find desktop entries in old system path, because it was garbage collected.

This seems to happen because desktop entries in application launcher itself are now referencing absolute path (however application launcher works fine).

Screenshot_20240623_220523

Note that old behavior in plasma5 (I have a machine that still runs tapir and I didn't rebuild or update since 2023) is to reference /run/current-system/sw/share/applications instead and this path is present in ~/.config/plasma-org.kde.plasma.desktop-appletsrc after adding icons to the task manager or browsing desktop entry paths in application launcher itself.

For now, I simply edited my applet config and replaced absolute paths with /run/current-system/sw/share/applications and it works fine.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Add some icons to the task manager
  2. Rebuild nixos and run nixos-collect-garbage -d
  3. Observe broken icons on next plasmashell restart

Notify maintainers

@K900 @SuperSandro2000

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 6.9.6-zen1, NixOS, 24.11 (Vicuna), 24.11pre642660.a71e967ef369`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixos"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

kkoniuszy commented 2 days ago

This bug occurs if an application is not running and gets added from the apps menu. If you have a running application and pin it by right clicking its taskbar icon, it will get added without the absolute path.

For example, this is steam pinned from the apps menu:

launchers=…,file:///nix/store/2i5vsb5gqcy49yv5hy61xz19igzm77dd-system-path/share/applications/steam.desktop

And this is pinned using the taskbar icon menu:

launchers=…,applications:steam.desktop                              

This applications: syntax seems to be the most sensible to use as it doesn't depend on any paths and would work for stuff installed via home-manager and whatnot as well. Could we patch some KDE package to make it use desktop file names only?