Bug 421329 - New Global Shortcuts KCM: shortcuts to launch 3rd-party apps don't work
Summary: New Global Shortcuts KCM: shortcuts to launch 3rd-party apps don't work
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keys (show other bugs)
Version: unspecified
Platform: Neon Linux
: VHI normal
Target Milestone: ---
Assignee: Michael Jansen
URL:
Keywords: regression
: 413911 415183 417495 418753 422752 422887 422913 423089 424576 425696 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-05-11 11:07 UTC by Patrick Silva
Modified: 2021-01-21 12:44 UTC (History)
25 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.74


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2020-05-11 11:07:12 UTC
STEPS TO REPRODUCE
1. open system settings > shortcuts
2. click on "+ Add application..." button, select any app and click on "Ok" button (notice "_launch:" instead of "<app>:" above "No default shortcuts")
3. click on "+ Add custom shortcut" button and assign a shortcut (I assigned meta+w)
4. test the just assigned shortcut

OBSERVED RESULT
nothing happens

EXPECTED RESULT
shortcut assigned in the step 3 should work

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.18.80
KDE Frameworks Version: 5.70.0
Qt Version: 5.14.2
Comment 1 David Redondo 2020-05-11 14:44:33 UTC
I just tried it with kcalc and it worked. What application did you test with?
Comment 2 Patrick Silva 2020-05-11 15:15:40 UTC
(In reply to David Redondo from comment #1)
> I just tried it with kcalc and it worked. What application did you test with?

Ark, Firefox and Opera internet browser.
Also reproducible with kcalc.
Comment 3 tagwerk19 2020-05-11 18:54:44 UTC
Possibly related...

I notice that if I have created a shortcut on the desktop and click on the icon it *appears* that the application is opened with the name of the whatever.desktop file as an argument.

For example for a dolphin shortcut, clicking on the link opens
    Desktop/org.kde.dolphin.desktop/
folder and prompts "What do you want to do with this executable file"

This behaviour has changed since Neon (Plasma 5.18.4, Framework 5.69.0), I see it on Neon Testing (Plasma 5.18.5, Framework 5.71.0)
Comment 4 Patrick Silva 2020-05-11 19:12:34 UTC
Yes. Since Saturday 9 I noticed that when I try to open an app via an icon on desktop the app opens or tries to open its own .desktop file. For example, add Kate icon to desktop, launch Kate via its icon on desktop and Kate opens its own .desktop file.
But I think it's a different issue. The issue with Global Shortcuts kcm is not recent, it exists since such kcm landed on my system.
Comment 5 tagwerk19 2020-05-11 20:04:17 UTC
Thanks!

Created Bug 421364 with a reference to this one.

Not sure where it "really lives", filed it under Dolphin :-/
Comment 6 Nate Graham 2020-05-12 16:03:22 UTC
Weird, works for me too.
Comment 7 Patrick Silva 2020-05-14 22:19:24 UTC
humm, it's also working on Arch running plasma 5.19 beta.

Operating System: Arch Linux 
KDE Plasma Version: 5.18.90
KDE Frameworks Version: 5.70.0
Qt Version: 5.15.0 rc2
Comment 8 Frank Steinmetzger 2020-06-03 20:51:45 UTC
Last week I set up a completely new Arch system with Plasma 5.18 and Qt 5.14. I did not copy over any configs from my previous machine and instead set up everything from scratch because I did not want to take over cruft from years gone by.

I’ve been using Meta+Letter shortcuts for many years. So I assigned a few shortcuts on the new system. But apart from Meta+E to launch Dolphin, which has been made a Plasma default a short wile ago, none of my own shortcuts worked.

So I went back to my old machine and did some digging.
I have an old shortcut for Krusader, Meta+R.
It is listed in kglobalshortcutsrc in the [khotkeys] section as:
  {2fd04451-6cb6-4eda-82ca-9bf53c0e7235}=Meta+R,none,Krusader

Now I go to the menu editor. The “current shortcut” widget in the menu editor says “None”. I click on the clear button next to it and save my settings. It warns me that the shortcut is assigned to Krusader in System settings. I apply it and save. Now the line I quoted above still exists in kglobalshortcutsrc, but has its Meta+R removed. Instead, a new section has been added in the rc with a _launch= line. And now the shortcut does not work anymore.

So the workaround – until this has been resolved – is to go to Systemsettings → Shortcuts → Custom shortcuts („Eigene Kurzbefehle“ in German) and add them there under the KMenuEdit tree node.
Comment 9 Patrick Silva 2020-06-12 21:49:38 UTC
*** Bug 422887 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2020-06-19 14:13:12 UTC
Seems like this is predominately affecting 3rd-party apps. Can reproduce with GIMP for example.
Comment 11 Nate Graham 2020-06-19 14:13:41 UTC
*** Bug 423089 has been marked as a duplicate of this bug. ***
Comment 12 Nate Graham 2020-06-19 14:14:31 UTC
*** Bug 422752 has been marked as a duplicate of this bug. ***
Comment 13 Nate Graham 2020-06-19 14:15:00 UTC
*** Bug 415183 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2020-06-19 14:15:51 UTC
*** Bug 413911 has been marked as a duplicate of this bug. ***
Comment 15 Nate Graham 2020-06-19 14:16:40 UTC
*** Bug 422913 has been marked as a duplicate of this bug. ***
Comment 16 Nate Graham 2020-06-19 14:17:34 UTC
*** Bug 418753 has been marked as a duplicate of this bug. ***
Comment 17 Nate Graham 2020-06-19 15:09:35 UTC
I can confirm that this is not working for 3rd-party apps whose launch shortcuts are set in the global shortcuts KCM.
Comment 18 JanKusanagi 2020-06-23 19:27:20 UTC
I can confirm that global shortcuts thing happens here too, and I'd say that was back in Plasma 5.18 too.

Using KMenuEdit to set those global shortcuts failed just the same.
Comment 19 Bug Janitor Service 2020-06-30 10:30:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/2
Comment 20 Alexander Popel 2020-07-05 15:29:56 UTC
As hinted in
https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/2
after I created a ~/.local/share/kglobalaccel directory, on my machine everything started working fine!

So until that merge request is accepted, you can manually create the ~/.local/share/kglobalaccel directory to try to fix the issue.
Comment 21 Patrick Silva 2020-07-05 16:39:52 UTC
(In reply to Alexander Popel from comment #20)
> As hinted in
> https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/2
> after I created a ~/.local/share/kglobalaccel directory, on my machine
> everything started working fine!
> 
> So until that merge request is accepted, you can manually create the
> ~/.local/share/kglobalaccel directory to try to fix the issue.

I can confirn that your workaround works on neon unstable.
Thank you.
Comment 22 Méven Car 2020-07-10 12:05:32 UTC
*** Bug 417495 has been marked as a duplicate of this bug. ***
Comment 23 myles.jon.gordon 2020-07-15 10:11:43 UTC
I can confirm as well that creating the ~/.local/share/kglobalaccel directory fixed everything for me - before this, I was getting a weird "_launch" text instead of the standard "Launch this program" and all of the other assignable shortcut things. I just had to do mkdir ~/.local/share/kglobalaccel and everything works as expected.
Comment 24 Méven Car 2020-07-15 13:44:41 UTC
Git commit 215d325972c32f35ad004764ad0bccb40f3aba61 by Méven Car.
Committed on 15/07/2020 at 13:43.
Pushed by meven into branch 'master'.

Resolve service files from applications folder

This efficively makes installing desktop files to `prefix/share/kglobalaccel` unnecessary.
FIXED-IN: 5.73

CC @marco @ngraham

Bug was introduced in e5fa5cbc4fa7ebb96a2ec7803e2963038e3bf1a6

M  +1    -1    src/runtime/kserviceactioncomponent.cpp

https://invent.kde.org/frameworks/kglobalaccel/commit/215d325972c32f35ad004764ad0bccb40f3aba61
Comment 25 Méven Car 2020-07-15 13:44:56 UTC
Git commit 3514beccfe8c71233d58ec51aa813112db8a03da by Méven Car.
Committed on 15/07/2020 at 13:44.
Pushed by meven into branch 'master'.

kcm_keys: clean copying of desktop files to kglobalaccel data dir

M  +0    -2    kcms/keys/kcm_keys.cpp

https://invent.kde.org/plasma/plasma-desktop/commit/3514beccfe8c71233d58ec51aa813112db8a03da
Comment 26 Aleix Pol 2020-07-17 18:32:15 UTC
The merge request regressed on appllications that installed on share/kglobalaccel and will be reverted. Sorry about that. :/
Comment 27 Aleix Pol 2020-07-17 18:35:05 UTC
Git commit cfdbf5e629391dd2475193495637df2919658b2b by Aleix Pol.
Committed on 17/07/2020 at 18:32.
Pushed by apol into branch 'master'.

Revert "Resolve service files from applications folder"

This reverts commit 215d325972c32f35ad004764ad0bccb40f3aba61.

This stopped finding krunner.desktop which is currently in
share/kglobalaccel. Installing it elsewhere wouldn't make a difference
because we need to be backwards compatible.

A good way around that would be to check both directories.

M  +1    -1    src/runtime/kserviceactioncomponent.cpp

https://invent.kde.org/frameworks/kglobalaccel/commit/cfdbf5e629391dd2475193495637df2919658b2b
Comment 28 cor 2020-07-24 17:36:08 UTC
The suggestion to add kglobalaccel directory made no difference at all. Please address this issue. It is hard to believe that it was allowed to get through in the first place. Something that has worked flawlessly for years has suddenly stopped functioning. It almost seems deliberate. I report problems to you people and you do nothing but look for someone else to blame. FIX THE ISSUE! IT IS REAL! As I stated this is a fresh install. Brand new and broken.
Comment 29 Patrick Silva 2020-07-24 17:54:25 UTC
*** Bug 424576 has been marked as a duplicate of this bug. ***
Comment 30 Bug Janitor Service 2020-07-25 08:20:46 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kglobalaccel/-/merge_requests/4
Comment 31 elman 2020-07-25 12:28:03 UTC
@cor People are working on free software, they are doing it for free, they want to do their best and their work helps many others. This is not how you "repay" them or motivate them. So, please, be considerate.
Comment 32 Saul Fautley 2020-08-13 01:37:42 UTC
Can confirm creating the ~/.local/share/kglobalaccel directory resolves the issue for now. Thanks for the easy workaround @Alexander Popel.

For anyone still having trouble, I needed to remove and re-add the applications and shortcuts before they started working.
Comment 33 Nate Graham 2020-08-24 22:26:40 UTC
*** Bug 425696 has been marked as a duplicate of this bug. ***
Comment 34 proteus5 2020-08-28 11:46:33 UTC
Why don't the developers revert the instructions since the shortcuts demon works perfectly?
Comment 35 popov895 2020-08-28 14:24:56 UTC
Still reproducible on Plasma 5.19.4. It's been more than three months, but still not fixed :(
Comment 36 Méven Car 2020-08-28 14:43:40 UTC
Git commit 628c0c40147338c2dcd53c1c56af1148204e5d2e by Méven Car.
Committed on 23/08/2020 at 19:33.
Pushed by ngraham into branch 'master'.

Load service files for shortcuts for applications data dir as fallback
FIXED-IN: 5.74

M  +23   -13   src/runtime/kserviceactioncomponent.cpp
M  +1    -1    src/runtime/kserviceactioncomponent.h

https://invent.kde.org/frameworks/kglobalaccel/commit/628c0c40147338c2dcd53c1c56af1148204e5d2e
Comment 37 Nate Graham 2020-09-08 04:26:52 UTC
*** Bug 417495 has been marked as a duplicate of this bug. ***
Comment 38 YAFU 2020-12-13 12:32:21 UTC
I come from here:
https://bugs.kde.org/show_bug.cgi?id=417495

Not only has this never been fixed, it is even worse. KDE Menu Editor won't even let me enter new combinations keys.
So, what to do?

Using KDE 5.76.0 from KDE Neon (Testing)
Comment 39 Nate Graham 2020-12-15 15:59:36 UTC
Works for me. I would recommend filing a new bug report.
Comment 40 José 2020-12-15 19:55:19 UTC
It's still happening. I can't assign new custom shortcuts to 3rd party apps in a fresh install.

SOFTWARE/OS VERSIONS
Operating System: KDE neon User Edition
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2
Comment 41 Nate Graham 2020-12-15 19:59:11 UTC
Can you please file a new bug report? The fact that it works for me makes me think that you're affected by a different bug or else there is a local configuration issue at play.
Comment 42 YAFU 2020-12-15 23:52:41 UTC
Apparently the new problem that I have where it is not possible to enter new shortcuts is the same as this report:
https://bugs.kde.org/show_bug.cgi?id=430388

Regarding previous reports where keyboard shortcuts for third-party apps/scripts do not work, some of the reports about it had been closed as duplicates to this one, but had never actually been resolved.

When the new bug is fixed and I can continue testing, I may open a new report about the old problem if it continues to occur.
Comment 43 Nate Graham 2020-12-16 00:15:57 UTC
That bug report is about the "Custom Shortcuts" page in System Settings, not the system used by the "Shortcuts" page and KMenuEdit.
Comment 44 Martin B 2021-01-21 12:44:40 UTC
Had the same wrong behavior after a fresh - not further updated - install of KDE NEON 5.20 german version where I have not even been able to set a shortcut for a quickstart of an application, not in the menu editor and not in Settings > shortcuts: I activated the shortcut field but my keyboard input was not recorded.

After install of all automatic upcoming updates now I have
KDE-Plasma-Version: 5.20.5
KDE-Frameworks-Version: 5.78.0
QT-Version: 5.12.2
Kernel-Version: 5.4.0-58-generic

and the problems are gone.

For Kubuntu 20.04 LTS after a fresh install and after installing all updates the faulty behavior I had was
- it is possible to setup a shortcut for an application in menu editor
- and in Settings > Shortcuts
- but the application does not start
This error was with all kind of shortcut (Shift-x, Alt-X, Ctrl-x and kombinations).

I received a hint in Kubuntuforums.net there was the same faulty behavior some years ago in an older version of Kubuntu and followed the resolve action:
- not a must but best practice: delete all your already setup application shortcuts 
- go to "~/.config/kglobalshortcutsrc" and rename this e.g. to "~/.config/kglobalshortcutsrc_org"
- reboot the system
- check the file has been recreated
and for me from the on on two differnts notebooks this fixed the problem.

Hope this helps ...