Plasma 6.1.3: Pinned kde application icons go blank after GC(NixOS)

When pinning icons to the Plasma 6.1.3 Task Manager (i.e. task bar), after a Garbage Collection (NixOS unstable) the icons get corrupted. Both left-click and right-click still work as expected. Left-click will open the respective program and whilst running, the blank icon will be replaced by the correct icon. When the program is closed it returns to a blank icon.

Issue can be mitigated by unpinning then re-pinning the icons, but as this is a regular occurrence this is somewhat annoying.

Steps To Reproduce

Steps to reproduce the behavior:

  1. In Plasma 6.1.3 pin a few short-cuts to the Task Manager
  2. # Garbage Collection nix.gc = { automatic = true; dates = "weekly"; options = "--delete-older-than 7d"; };
  3. or sudo nix-collect-garbage -d

Screenshots
Screenshot_20240722_142919

Screenshot_20240729_140406

OS: NixOS 24.11pre659698.52ec9ac3b123 (Vicuna) x86_64
Host: MS-7D76 (2.0)
Kernel: Linux 6.10.1
Packages: 1790 (nix-system)
Shell: bash 5.2.26
Display (DEL41E6): 1920x1080 @ 144 Hz in 27″ [External] *
Display (W2442): 1920x1080 @ 60 Hz in 24″ [External]
DE: KDE Plasma 6.1.3
WM: KWin (Wayland)
WM Theme: Breeze
Theme: Breeze [Qt]
Icons: breeze [Qt], breeze [GTK2/3/4]
Font: Noto Sans (10pt) [Qt], Noto Sans (10pt) [GTK2/3/4]
Cursor: We10XOS (24px)
Terminal: Konsole
CPU: AMD Ryzen 7 7800X3D (16) @ 5,05 GHz
GPU 1: NVIDIA GeForce RTX 4080 [Discrete]
GPU 2: AMD Raphael [Integrated]
Memory: 6,04 GiB / 30,47 GiB (20%)
Swap: Disabled
Disk (/): 118,25 GiB / 1,83 TiB (6%) - ext4

How would I fix this?

That is because for some applications, what KDE Plasma pins is the path to the desktop file in /nix/store, even though it’s accessible in /etc/profiles/per-user/<user>/share/applications or /run/current-system/sw/share/applications. Inspect your .config/plasma-org.kde.plasma.desktop-appletsrc and search for /nix/store, and you’ll find those applications’ desktop files. You can replace file:///nix/store/xxxx/foo.desktop with applications:foo.desktop.

@oo-infty
Thanks!
I think it’s a temporary solution.
It would be desirable if KDE Plasma used relative paths or the “applications:” scheme instead of absolute paths.

I have created a script “/home/nixosuser/scripts/fix-plasma-icons.sh”.
mkdir -p /home/nixosuser/scripts
nano /home/nixosuser/scripts/fix-plasma-icons.sh

#!/run/current-system/sw/bin/bash

# Vorherige Pfade anzeigen
echo "Vorherige Pfade:"
grep 'launchers' ~/.config/plasma-org.kde.plasma.desktop-appletsrc

# Pfade in der plasma-org.kde.plasma.desktop-appletsrc Datei ersetzen
sed -i 's|file:///nix/store/[^/]*/share/applications/|applications:|' ~/.config/plasma-org.kde.plasma.desktop-appletsrc

# Spezieller Fall fĂĽr Thunderbird und Firefox
sed -i 's|file:///nix/store/[^/]*/share/applications/thunderbird.desktop|applications:thunderbird.desktop|' ~/.config/plasma-org.kde.plasma.desktop-appletsrc
sed -i 's|file:///nix/store/[^/]*/share/applications/firefox.desktop|applications:firefox.desktop|' ~/.config/plasma-org.kde.plasma.desktop-appletsrc

# Nachherige Pfade anzeigen
echo "Nachherige Pfade:"
grep 'launchers' ~/.config/plasma-org.kde.plasma.desktop-appletsrc

# KDE Plasma neu laden
pkill plasmashell
nohup plasmashell > /dev/null 2>&1 &

chmod +x /home/nixosuser/scripts/fix-plasma-icons.sh

Screenshots
Before the script
Screenshot_20240801_215843
After the script
Screenshot_20240802_002419

1 Like

@nixOSuser
It’s highly recommended to give plasma-manager a try. Personally, I use it to declaratively manage all my plasma-related stuff, including panels and applications on the task bar.