Bug 430498 - Does not respect the local modifications of the .desktop file
Summary: Does not respect the local modifications of the .desktop file
Status: CONFIRMED
Alias: None
Product: frameworks-kglobalaccel
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.77.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-17 10:02 UTC by Juan Simón
Modified: 2022-08-19 17:53 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juan Simón 2020-12-17 10:02:28 UTC
The new Spectacle utility "Annotate" is very useful for me but is useless with the shortcuts since they use dbus and do not open the GUI. (https://bugs.kde.org/show_bug.cgi?id=430480)

I also can't create custom shortcuts because the keyboard capture doesn't work. (https://bugs.kde.org/show_bug.cgi?id=430388)

So I have copied the system desktop file to my home directory to modify the application shortcuts:

$ cat .local/share/applications/org.kde.spectacle.desktop
[Desktop Entry]
GenericName=Screenshot Capture Utility
GenericName[es]=Utilidad de capturas de pantalla
Name=Spectacle
Name[es]=Spectacle
Comment=Screenshot capture utility
Comment[es]=Utilidad de captura de pantalla
Categories=Qt;KDE;Utility;
Keywords=snapshot;capture;print;screenshot;snipping;snip;
Keywords[es]=captura;capturar;imprimir;captura de pantalla;
Exec=/usr/bin/spectacle
Icon=spectacle
Type=Application
Terminal=false
StartupNotify=false
Actions=ActiveWindowScreenShot;RectangularRegionScreenShot;
X-KDE-Shortcuts=Shift+Print

[Desktop Action ActiveWindowScreenShot]
Name=Capture Active Window
Name[es]=Capturar la ventana activa
Exec=spectacle -a
X-KDE-Shortcuts=Meta+Print

[Desktop Action RectangularRegionScreenShot]
Name=Capture Rectangular Region
Name[es]=Capturar una región rectangular
Exec=spectacle -rw
X-KDE-Shortcuts=Print

I have restarted the Plasma session but when I press the shortcuts it keeps executing the call to qdbus instead of the commands I indicate in my home directory file.

Operating System: Arch Linux
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2
Comment 1 Nate Graham 2020-12-17 21:30:24 UTC
Seems like an issue in kglobalaccel itself.
Comment 2 Nicolas Fella 2022-08-18 23:48:18 UTC
I think I understand the problem.

The shortcut information is read from /usr/share/kglobalaccel/org.kde.spectacle.desktop, which is a symlink to /usr/share/applications/org.kde.spectacle.desktop

Therefore adding/changing .local/share/applications/org.kde.spectacle has no effect on what is read from /usr/share/kglobalaccel/org.kde.spectacle.desktop
Comment 3 David Edmundson 2022-08-19 15:42:48 UTC
The rationale of /usr/share/kglobalaccel/ was that we don't need to parse every desktop file on startup.

Maybe we can kill it and find some other options such as having kded/kservice track that somewhere when it rebuilds other service related caches.
Comment 4 Nicolas Fella 2022-08-19 15:54:27 UTC
By using KService we would use the already existing ksycoca database, no?
Comment 5 Nicolas Fella 2022-08-19 17:53:29 UTC
I threw a KApplicationTrader::query into the code and measured:

The query contributes 5% cycles of the first second of kglobalacceld running.