Trouble Overriding Global Desktop Entry in KDE Plasma 6

Hi there,

I’m trying to override a global Desktop Entry in KDE, but my user-level changes in ~/.local/share/applications/ aren’t reflected in the KDE application launcher menu.

I made the same change on another system where it works flawlessly, so I’m a bit puzzled why it doesn’t on this machine.

Would appreciate any hints on why the user copy isn’t taking precedence and how to make KDE honor the overridden Exec line.

What I did

I ran:

desktop-file-install --dir="$HOME/.local/share/applications" \
  --set-key=Exec \
  --set-value="/opt/google/chrome/google-chrome --disable-features=GlobalShortcutsPortal %U" \
  /usr/share/applications/google-chrome.desktop

The expected diff is:

❯ diff /usr/share/applications/google-chrome.desktop ~/.local/share/applications/google-chrome.desktop
108c108
< Exec=/usr/bin/google-chrome-stable %U
---
> Exec=/opt/google/chrome/google-chrome --disable-features=GlobalShortcutsPortal %U
115a116
> X-Desktop-File-Install-Version=0.28

However, the change is not picked up in the KDE Application Launcher:

What I’ve tried (unsuccessful)

  1. Deleting ~/.cache/ksycoca5* and running kbuildsycoca5 --noincremental
  2. Doing the same with kbuildsycoca6
  3. Running update-desktop-database ~/.local/share/applications

These attempts were based on the related threads below.

Debugging

When I rename the desktop entry to $HOME/.local/share/applications/google-chrome-test.desktop the kde menu is updating ,so it might have something todo with desktop file precedence?

Interestingly, if I rename the desktop entry to ~/.local/share/applications/google-chrome-test.desktop, the KDE menu updates correctly but obviously shows a duplicated entry.
This suggests the issue might be related to desktop file precedence?

Environment

XDG_DATA_DIRS=/home/matthias/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
System:
  Host: riser Kernel: 6.17.0-1-default arch: x86_64 bits: 64
  Desktop: KDE Plasma v: 6.4.5 Distro: openSUSE Tumbleweed 20251002
Machine:
  Type: Laptop System: LENOVO product: 21K5000GGE v: ThinkPad P14s Gen 4
    serial: <superuser required>
  Mobo: LENOVO model: 21K5000GGE v: SDK0T76530 WIN
    serial: <superuser required> UEFI: LENOVO v: R2FET61W (1.41 )
    date: 11/15/2024
Battery:
  ID-1: BAT0 charge: 53.5 Wh (97.9%) condition: 54.6/52.5 Wh (104%)
CPU:
  Info: 8-core AMD Ryzen 7 PRO 7840U w/ Radeon 780M Graphics [MT MCP]
    speed (MHz): avg: 2326 min/max: 419/5135
Graphics:
  Device-1: Advanced Micro Devices [AMD/ATI] Phoenix1 driver: amdgpu v: kernel
  Device-2: Bison Integrated Camera driver: uvcvideo type: USB
  Display: wayland server: X.org v: 1.21.1.15 with: Xwayland v: 24.1.8
    compositor: kwin_wayland driver: X: loaded: amdgpu
    unloaded: modesetting,vesa dri: radeonsi gpu: amdgpu
    resolution: 1920x1200~60Hz
  API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd mesa v: 25.2.4 renderer: AMD
    Radeon 780M (radeonsi phoenix LLVM 21.1.2 DRM 3.64 6.17.0-1-default)
  Info: Tools: api: eglinfo, glxinfo, vulkaninfo
    de: kscreen-console,kscreen-doctor gpu: amdgpu_top wl: wayland-info
    x11: xdpyinfo, xprop, xrandr
Network:
  Device-1: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    driver: r8169
  Device-2: Qualcomm QCNFA765 Wireless Network Adapter driver: ath11k_pci
Drives:
  Local Storage: total: 953.87 GiB used: 304.7 GiB (31.9%)
Info:
  Memory: total: 32 GiB note: est. available: 29.02 GiB used: 5.75 GiB (19.8%)
  Processes: 485 Uptime: 0h 5m Shell: Zsh inxi: 3.3.39

Related threads

Hi @matt-hires , as I am the author of one of the threads you mentioned, I felt compelled to share my experience, which unfortunately is not very enlightening.
After lots of tries and failures, I finally gave up and settled for the next best thing: duplicate the entries which needed update :slightly_frowning_face:
If you find a solution, please share it here so that everyone can benefit from it.

1 Like

What bothers me is that it works on my other machine, and I can’t figure out what’s different.

Unfortunately, I don’t know of any debugging tools to check which desktop entry is being used.

The next step would be to file an issue with KDE:
https://bugs.kde.org/index.cgi

And to debug the code here:

I’m not so lucky: both my machines show the same buggy behavior.
I guess filing a bug with KDE is the right thing to do.

https://bugs.kde.org/show_bug.cgi?id=510287#c0

1 Like

Thank you very much @matt-hires for opening the bug!
Actually, so many months have passed that I had completely forgot that I had opened a bug myself! It was cited in my thread, but here it is: 497714 – Modifying the "Environment variables" section of an application is not retained
At least now they know I’m not alone in experiencing this. And you also found a thread involving Fedora, so their assumption (see my bug report) that the problem was in openSUSE is moot!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.