What I do is this:
In Systemsettings - Keyboard - Shortcuts I click
Add new
and then select
Command or script
A pop-up opens and I copy-paste the command which is the code to start Libreoffice --calc with a spreadsheet.
No matter which one I use (I have 5 of them) I get the error message. Also when I just type the name of another program or script this happens.
What do I need to do to not get the error message which also blocks further input of shortcuts?
Your distribution should have set up the kglobalaccel package/service to run in the background in a Plasma session. Please check whether that package is installed on your system. Assuming that it is, I would check journalctl -S today for recent system log messages. You may find some relevant error messages in the log that point you toward why the service isn’t running.
I used this command:
journalctl -S today |grep kglobalaccel > journal.txt
In the text file I see this:
May 10 07:27:29 Fedora-KDE systemd[1816]: Starting plasma-kglobalaccel.service - KDE Global Shortcuts Server…
May 10 07:27:29 Fedora-KDE systemd[1816]: Started plasma-kglobalaccel.service - KDE Global Shortcuts Server.
May 10 07:28:43 Fedora-KDE systemsettings[3573]: org.kde.kcm_keys: “org.kde.kglobalaccel.NoSuchComponent” “The component ‘libreoffice-5.desktop’ doesn’t exist.”
When I check if the service is running, I see this:
sudo systemctl status plasma-kglobalaccel.service
Unit plasma-kglobalaccel.service could not be found.
This asks for a system service. plasma-kglobalaccel.service is started on the user/session bus, so use this invocation instead:
systemctl --user status plasma-kglobalaccel.service
But the fact that systemd has apparently started it, according to your logs, is an indication that the problem might be elsewhere. The “NoSuchComponent” error could be related, one would have to know more about the inner workings about kglobalaccel though than I do at the moment.
Hello again, I have tried the command you gave me:
systemctl --user status plasma-kglobalaccel.service
○ plasma-kglobalaccel.service - KDE Global Shortcuts Server
Loaded: loaded (/usr/lib/systemd/user/plasma-kglobalaccel.service; static)
Drop-In: /usr/lib/systemd/user/service.d
└─10-timeout-abort.conf
Active: inactive (dead) since Sat 2024-05-11 06:38:38 CEST; 1h 11min ago
Process: 2125 ExecStart=/usr/libexec/kglobalacceld (code=exited, status=0/SUCCESS)
Main PID: 2125 (code=exited, status=0/SUCCESS)
CPU: 42ms
May 11 06:38:38 Fedora-KDE systemd[1858]: Starting plasma-kglobalaccel.service - KDE Global Shortcuts Server.>
May 11 06:38:38 Fedora-KDE systemd[1858]: Started plasma-kglobalaccel.service - KDE Global Shortcuts Server.
The service is loaded but inactive since directly after boot.
I just manually re-started it and it is inactive straight away, meaning in this case after 36mS.
Hi, I just tried your use case here locally. My plasma-kglobalaccel.service is also “inactive (dead)”, I figure it just gets started on demand when another program (KWin and/or settings) asks for it. However, in my setup I’m not seeing the same error if I make a new “Command or script” for libreoffice --calc. The application starts as intended.
I’m sure there is a bug somewhere, but I don’t know enough about the code to pinpoint it. Sorry for not being more helpful here. I think opening a bug report would be reasonable thing to do, I could see either the Fedora or KDE bug trackers being a good next step. Unless someone more knowledgeable shows up here and has a good idea.
I have just found out when I create a new user and log in as that user it does work. I can add shortcuts. In my normal user it doesn’t work.
It must be something in my environment, but what?
Hi, do you have an idea what could be wrong in my setup? As I wrote when using a different user it works, with other people on the Fedora forum, where I also have this thread active, it works.
What is causing this behavior?
I thought I had found the reason, but after some time it turned it is not it.
Since many years I use a keyboard layout called Eurkey, it can be added to your keyboard in the KDE settings. This layout makes it possible to use characters like ä, ü, ö, ï, ë, ß, ñ, etc. Just a combination of the right Ctrl key with a certain letter.
When adding shortcuts worked in a different user environment I started thinking what is different? I found the Eurkey keyboard layout.
I logged in into my own user account, removed the layout and rebooted. It then worked.
I added the layout again and it still worked. So, it is not that.
I now did a complete re-install, which takes only a few hours and I could add shortcuts, added the keyboard layout and am a happy Fedora KDE user again.
Difficult to say what is the reason, must have been something in my former account, but what?
I now close this thread because I have a nice working computer and can go on with my business.
Thanks for the help. Bye
It’s actually a bug in how KDE System Settings names the net.local.*.desktop file that is created inside your ~/.local/share/applications when a new shortcut is created.
Imagine if your command is something like echo 'Hello World', a file whose name’s net.local.echo.desktop will be created. In general, it will take a string that is anything from the first char to the char before the first space char and then run through a parsing logic which I don’t know about to extract the command name. Something like /usr/bin/echo 'Hello World' would also result in net.local.echo.desktop .
But sometimes we want to use absolute paths right? For overthinker like me I feared that the directories in my PATH variable is not available to the command, so I use write a command like /home/$USER/.local/bin/awesome_cli_app --option1 foo -o bar .... Guess what: It can’t parse the string /home/$USER/.local/bin/awesome_cli_app to awesome_cli_app. Instead, KDE creates a deep-nested directories, whose name starting from net.local./, then net.local./home/ then net.local./home/$USER, … you get the gist.
So my recommendation is checked your ~/.local/share/applications, see if there is a weird file/folder name. Wrap your future commands with sh -c.
P/s: Use plocate more often, I found out about this when I ran plocate flameshot-2.desktop, in your case it would be plocate libreoffice-5.desktop