Bug 455444 - Custom Shortcuts are gone in 5.25 on Wayland
Summary: Custom Shortcuts are gone in 5.25 on Wayland
Status: CLOSED INTENTIONAL
Alias: None
Product: systemsettings
Classification: Applications
Component: general (show other bugs)
Version: 5.25.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: regression, wayland
: 455765 457560 462303 463462 469245 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-06-16 21:09 UTC by Fabio Lenherr
Modified: 2024-11-30 19:05 UTC (History)
22 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
On X11 (28.03 KB, image/png)
2022-06-16 21:09 UTC, Fabio Lenherr
Details
On wayland (170.57 KB, image/png)
2022-06-16 21:10 UTC, Fabio Lenherr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Lenherr 2022-06-16 21:09:40 UTC
Created attachment 149832 [details]
On X11

SUMMARY
***
I tried to add a custom shortcut on 5.25 only to find them gone.
They were still there on 5.24.5 with both wayland and X11.
***


STEPS TO REPRODUCE
1. Start a Wayland session.
2. Try to configure a custom shortcut.


OBSERVED RESULT

Global Shortcuts are gone?

EXPECTED RESULT

Adding, editing,... a custom shortcut

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch/5.25/Wayland
KDE Plasma Version: 5.25
KDE Frameworks Version: 5.95.0
Qt Version: 5.15.4


ADDITIONAL INFORMATION
Comment 1 Fabio Lenherr 2022-06-16 21:10:05 UTC
Created attachment 149833 [details]
On wayland
Comment 2 Fabio Lenherr 2022-06-16 21:13:20 UTC
Also Note that the custom shortcuts that have been configured do still work, only adding, editing, etc is not possible, as the page is gone.
Comment 3 Nate Graham 2022-06-17 15:14:02 UTC
Custom Shortcuts are unreliable on Wayland so we have hidden the page by default for Wayland users. You can add any shortcuts you'd like using the Shortcuts page instead.
Comment 4 Fabio Lenherr 2022-06-17 15:21:15 UTC
How would I go about doing that? I have found no way to connect a command to a shortcut with the regular shortcuts page.
There is a custom shortcuts service page, but it doesn't offer any configuration other than changing the hotkey for already created commands.
This seems a bit strange, all custom shortcuts were fine for me. 
Now I have to start X11 just to add and edit, while using them is still possible on wayland.

I urge you to reconsider this decision.
Comment 5 Nate Graham 2022-06-17 15:35:59 UTC
You make a script file and then assign a global shortcut to run it. It's a little clumsy, I know. We will improve it in the future.

Ultimately having two systems to do the same thing is silly, and on Wayland we've decided to focus on only one to de-confuse the UI.
Comment 6 Andrew Shark 2022-06-20 13:31:12 UTC
I second vote to reconsider this, at least until there is no alternative implementation. Maybe there is some way to temporary force show that page? I tried `kcmshell5 kcm_hotkeys`, and it says there is no such module.

Currently we loose functionality to send dbus commands and send emulated keyboard input. But more importantly, it is not only about keyboard shortcuts. There are also Mouse Gestures and Window Actions in that menu.

I agree, the UI is confusing now. I reported my ideas in Bug 401628.
Comment 7 Nate Graham 2022-06-21 16:19:51 UTC
Sending emulated keyboard input and mouse gestures are pieces of functionality that don't work on Wayland. That was one of the big reasons we decided to hide this KCM--to avoid exposing features that are known to be broken, and that can't easily be made to work anytime soon given the fundamental architecture of Wayland.

Sending dbus commands is something you can do in a more awkward way with the Shortcuts page. You can add global shortcut to execute a script file that runs `dbus-send [whatever]`. This is fairly advanced functionality.
Comment 8 Andrew Shark 2022-06-21 17:13:45 UTC
Thanks for clarification. And what about Window Actions? I used this functionality in X11. Despite window detection is broken there (Bug 401391), you can fill in the values, and window events (focusing, loosing focus, etc.) actually could trigger a command. I used that in my experimental project https://gitlab.com/AndrewShark/monitor-commander/-/blob/master/switch_preset.py to switch monitor preset based on active application. And I would like to have such possibility in Wayland.
But I guess this is redundant, and I probably could create some kinda "listener" kwin script, that will be notified about such events. If that is true, than dropping that config page is more than reasonable.
Comment 9 Patrick Silva 2022-06-22 01:42:50 UTC
*** Bug 455765 has been marked as a duplicate of this bug. ***
Comment 10 Oliver Hiorns 2022-07-18 05:19:53 UTC
Respectfully, I don't think this is the right decision.

I was using this feature to add custom bindings between keyboard combinations and commands, and it worked perfectly reliably - and still does. Today I found that when I wanted to add a new shortcut, the feature had disappeared - yet it did and still does work perfectly well.

Creating a new script file for every single shortcut is hugely impractical and a massive waste of time - not to mention the fact that for some users less familar with creating scripts, they may not properly understand how to do so. (To be honest, until I read this thread, I didn't realise I could bind a custom script with 'browse' and thought this was limited to desktop files for launching more conventional "apps".)

Also, since the feature still works well, I am much more inclined to go editing  ~/.config/khotkeysrc  to add my new shortcut than creating files that clutter up my disk. Yet this is now much more of a pain than the GUI was, and I am immediately nervous that I'll break something when I open up the file and see UUIDs...

On top of that, this creates an actual driving force towards X - why would you ever switch to Wayland if as soon as you do, you lose features? This actively hurts Wayland adoption, which seeing as Wayland is supposed to be the future, doesn't make any sense.

I understand that the motivation for this was to remove a "broken" feature - some of the options didn't work on Wayland, and providing a feature that won't work for a while doesn't make sense. But some of the options - very very useful options - work perfectly right now.
Would it not make more sense to remove only the option to create new shortcuts/actions that are known to not work? Or perhaps just leave them in with a warning that they won't work on Wayland for now?
(You may say this is unpolished, but arguably so is removing a feature like this - just removing it is confusing when users go looking for something they've been using before.)
Comment 11 Nate Graham 2022-07-19 15:47:41 UTC
Not only do some of the features of khotkeys not work on Wayland, its codebase is ancient and buggy and unmaintained. It does not work with modern components of the system and is slowly bit-rotting. Nobody wanted to touch it to disable the features in question on wayland because it is too fragile. Ultimately having two different GUIs to do the same thing is a bad idea and we made the decision for the Wayland session to focus on the one that is modern and maintainable, correcting an earlier mistake of allowing two parallel systems to be created in the first place.

The complaint about having to create a script file to use the other page is legitimate. Feel free to file a bug report about that in https://bugs.kde.org/enter_bug.cgi?product=systemsettings&component=kcm_keys.

Also, feel free to request features there for things that you miss from KHotkeys. The faster those are added, the sooner we can truly delete KHotkeys for everyone and remove the confusion and bugginess of two parallel overlapping global shortcut systems once and for all.
Comment 12 Oliver Hiorns 2022-07-20 17:10:21 UTC
I understand. Thanks for your time.

I have filed a report as suggested (https://bugs.kde.org/show_bug.cgi?id=456951).
Comment 13 Nate Graham 2022-07-20 17:13:39 UTC
You're welcome!
Comment 14 Nate Graham 2022-08-08 17:16:37 UTC
*** Bug 457560 has been marked as a duplicate of this bug. ***
Comment 15 nicos 2022-09-05 09:51:33 UTC
(In reply to Nate Graham from comment #5)
> You make a script file and then assign a global shortcut to run it. It's a
> little clumsy, I know. We will improve it in the future.
> 
> Ultimately having two systems to do the same thing is silly, and on Wayland
> we've decided to focus on only one to de-confuse the UI.

Hi,

I can't see any "global shortcut" entry in the shortcut settings menu. How can I find it ?
Comment 16 Nate Graham 2022-09-05 15:37:29 UTC
The correct page name on Wayland is just "Shortcuts."
Comment 17 sk.griffinix 2022-10-05 11:56:43 UTC
So is the ability to add custom shortcuts gone? Is there even any way to add them in UI in wayland? In x11, it was DE agnostic with utilities like xbindkeys, but don't know if anything works similarly in wayland
Comment 18 nicos 2022-10-05 21:35:07 UTC
Can I ask why I have been added to the CC list of this bug ?
Comment 19 Nate Graham 2022-10-05 22:38:03 UTC
When you post a comment on a bug report, you get CCd automatically. You can edit the CC list and remove yourself; there's a link to it in the top-right corner of the page.

As for the ability to add custom shortcuts, it's still there, but you do it now in the Shortcuts page. The workflow is a bit lousy and awkward compared to the old Custom Shortcuts page, which we're aware of; see Bug 456951 and Bug 440431. Hopefully this will be improved upon at some point.
Comment 20 nicos 2022-10-06 08:10:29 UTC
(In reply to Nate Graham from comment #19)
> When you post a comment on a bug report, you get CCd automatically. You can
> edit the CC list and remove yourself; there's a link to it in the top-right
> corner of the page.
> 
> As for the ability to add custom shortcuts, it's still there, but you do it
> now in the Shortcuts page. The workflow is a bit lousy and awkward compared
> to the old Custom Shortcuts page, which we're aware of; see Bug 456951 and
> Bug 440431. Hopefully this will be improved upon at some point.

OMG I totally forgot that I commented on this one, sorry. I was confused because I created anothe bug a few weeks ago and I expected a mail from that one but not from this one here. Sorry for the silly question.
Comment 21 gudvinr+kde 2022-10-12 19:53:30 UTC
That's so fucked up. Why remove feature until replacement that reached feature parity is present?

> You can add any shortcuts you'd like using the Shortcuts page instead.

No, you can't. I have number of shortcuts that are just same script with different arguments. Right now you can't assign arguments to command and you can't edit command itself. You need to remove it and add as new "application".
Comment 22 Nicolas Fella 2022-11-27 13:30:24 UTC
*** Bug 462303 has been marked as a duplicate of this bug. ***
Comment 23 Roy Orbitson 2022-12-01 01:57:53 UTC
So what is the expected migration path for "Send keyboard input" shortcuts? I have a few to simulate missing keys from my notebook's built-in keyboard, and provide parity with some programs that are missing common shortcuts. What "application" can one add to to the other Shortcuts section that can perform equivalent actions?
Comment 24 Nate Graham 2022-12-01 20:33:29 UTC
At the moment, nothing. I'm not aware that such a thing is possible on Wayland right now.
Comment 25 Andrew Shark 2022-12-01 23:21:10 UTC
@Roy, take a look at evsieve project, or other utility from https://wiki.archlinux.org/title/Input_remap_utilities.
Comment 26 Roy Orbitson 2022-12-05 01:46:38 UTC
Thanks, it looks very comprehensive for what it does, but I don't think it'll be suitable. The readme states "It is not a tool for keyboard macro's [sic] or complex event manipulation". I don't think there's a simple way to give it awareness of what the current program and its window properties are, and adjust keyboard bindings accordingly.
Comment 27 Andrew Shark 2022-12-05 12:02:03 UTC
You are not right. See https://github.com/KarsMulder/evsieve/issues/18, and read that part with fifo socket. However, I do not currently know how to do a kwin script that will notify that socket, because window actions are also gone. See comment #8.
Comment 28 Roy Orbitson 2022-12-06 00:31:28 UTC
@AndrewShark I am confused as to whether you're saying it is or isn't possible. From your comments it seems the upgrade path is to learn the intricacies of evsieve to create desired mappings, create a system- or user-level systemd service to reliably run each evsieve invocation, add some relevant commands to a file in /etc/sudoers.d/ so that one can use sudo to write toggle instructions to the FIFOs without having to authenticate each time, and then not be able to trigger said toggles automatically anyway because there's nothing to run tasks based on specific windows gaining/losing focus.
Comment 29 Andrew Shark 2022-12-06 11:38:35 UTC
Again, I do not think there will be a problem to emulate typing with one of the utilities. But regarding triggering by windows getting focus/loosing focus - I currently do not know how to read this info from kwin. Need to learn how it works.
Comment 30 Andrew Shark 2022-12-06 12:21:09 UTC
> Also, feel free to request features there for things that you miss from KHotkeys.
I created Bug 462702 for Window Actions.
Comment 31 Andrew Shark 2022-12-06 12:38:33 UTC
For those who want to ensure it is not working on Wayland or want to still access that kcm for deleting their shortcuts or just for ability to see how interface was made in that kcm, it is possible to show it. This commit hides it: https://invent.kde.org/plasma/khotkeys/-/commit/ed47291d1676dc0b9cddd75e3e0090cb5d3673c1
To show, comment that line in `/usr/share/kservices5/khotkeys.desktop`
Comment 32 Nate Graham 2023-01-09 19:45:00 UTC
*** Bug 463462 has been marked as a duplicate of this bug. ***
Comment 33 Nate Graham 2023-01-09 19:45:41 UTC
FWIW, the UX in Plasma 5.27 is much better, closer to what folks are used to from the old KHotKeys KCM.
Comment 34 Mehrad Mahmoudian 2023-02-14 11:52:57 UTC
Ok, I read the thread and I still strongly believe that this is poor design choice. Two easy example that I'm struggling with after trying to use Plasma Wayland for less than 20 minutes. I might have missed something, so please be gentle and correct me if I'm wrong. But here are the examples and later a brief conclusion:

## Example 1

I want to replace `rofi` (does not work on Wayland) with `fuzzel` or `wofi`. I have installed fuzzel using my distro's package manager, and I can run it from terminal and it works just fine. Now, I want to add a keyboard binding to run it. When I click on "+ Add Application..." button from the bottom middle column, I cannot find fuzzel. Another way would be to use sh/bash/zsh binaries and pass a command, none of those can be found either!! An alternative way can be to run a terminal (e.g alacritty or konsole) and make it to run a command, but guess what, after selecting Alacritty, I cannot pass any subcommands and arguments to that!!

## Example 2

Some software are dependent on subcommands. Flameshot is a good example (as I'm one of the maintainers). When I select Flameshot from the "+ Add Application..." menu, I cannot choose which subcommand to run and which what arguments.

## Conclusion

What you have done is forcing the user to create numerous scripts for the smallest things they want to do with their DE. None of the above examples are against the Wayland design or is restricted by Wayland protocol in any shape or form, and yet the Plasma Wayland is deliberately (or as you officially stated "intentionally") not letting the user to do the most basic action that all minimalistic window managers are letting user to do. You have also left users no guidance or choice! This is bad in another layer. I have been KDE Plasma user for over a decade, and yet I'm totally lost.
Comment 35 Nate Graham 2023-02-14 14:37:55 UTC
The UI for adding shortcuts for custom commands has been hugely improved to cover all those use cases in Plasma 5.27, which was released today.
Comment 36 Edward Oubrayrie 2023-02-18 19:24:34 UTC
From what I understand, there's a lot of progress with 5.27 release in configuring global shortcuts, both in Plasma as Nate said, and in apps with the Portal support https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/80

However there's no progress on Keyboard input (macros). As workaround, in addition to what's mentioned in https://wiki.archlinux.org/title/Input_remap_utilities there is also https://github.com/snyball/Hawck, but these tools are much harder to use and can make your system unusable, unlike the basic key input functionality in the old KCM.

Even after reading https://blog.martin-graesslin.com/blog/2016/12/how-input-works-keyboard-input/ something is not clear:
=> Can something be done in Kwin? Is even the compositor not permitted to inject keyboard events in the Wayland architecture?
Comment 37 Nate Graham 2023-05-15 21:56:24 UTC
*** Bug 469245 has been marked as a duplicate of this bug. ***
Comment 38 Grief 2023-06-03 08:55:07 UTC
If you configure some hotkeys in x11 and re-login to wayland after that, the hotkeys continue to work, but the UI for their configuration is gone and cannot be opened. 

That looks like an inconsistency to me.
Comment 39 Jefri 2023-07-10 19:21:05 UTC
The reason why I still cling to using X11 is due to the convenience of its mouse gestures and global shortcuts. However, despite the rapid advancements in technology, these features have yet to be fixed even as of the current date of July 10, 2023. To my surprise, I recently downloaded Fedora KDE 38 and AlmaLinux KDE, both of which come equipped with Wayland and custom shortcuts that are fully functional and working flawlessly. This begs the question: How were these features implemented in Wayland, and is there a way to replicate them in Kubuntu? I am eager to know if anyone has any insights or suggestions on this matter.
Comment 40 Andrew Shark 2023-07-12 14:11:31 UTC
>  both of which come equipped with Wayland and custom shortcuts that are fully functional and working flawlessly
This is False. I tried Fedora KDE 38 in Virtualbox and the Shortcuts page is the same as in Arch.
The problem here is that wayland lacks support of mouse gestures and other features described above.
Comment 41 Jefri 2023-07-13 17:14:50 UTC
Thanks Andrew for your time, I have checked again AlmaLinux was 5.24.6 so you are right; though Fedora had the basic functions (close, max, min, and present windows) of mouse gesture implemented,
Comment 42 John Bennett 2023-11-21 10:39:39 UTC
Trying to change my Screenshot app in 5.27.9/Tumbleweed/Wayland.
Can somebody please explain how to do this?
No, I am NOT a developer, just a mere user...
Thanks.
Comment 43 Nate Graham 2023-11-21 14:54:08 UTC
Hi John,
Bug reports aren't the optimal place to ask for support questions. I'd recommend https://discuss.kde.org/c/help/6 instead.
Comment 44 John Bennett 2023-11-22 02:58:09 UTC
Whoops...
Sort of relevant, just after a workaround until it's fixed... ;-)
Comment 45 Nate Graham 2023-11-22 04:06:36 UTC
There's nothing to fix; the old unmaintained "Custom Shortcuts" page in System Settings has been removed for Plasma 6, and was hidden in the Wayland session for Plasma 5 starting in 5.25. So this isn't a bug but rather an intentional decision. In its place is the newer actively maintained "Shortcuts" page in System Settings.

If you have further questions, including questions about how to migrate to the new system, I'd recommend asking them on https://discuss.kde.org/c/help/6, as I mentioned earlier.
Comment 46 Roy Orbitson 2023-11-22 23:52:58 UTC
>There's nothing to fix

Well, we've gone from a point-and-click interface that allowed users to draw gestures, select specific programs & windows and neatly organise things to enhance their desktop experience to ‘you can launch programs, maybe some specific actions if the program exposes them, or you can write your own software, it's not our problem.’ KDE knows this does not have the same specificity and is not nearly as accessible to users. That's not nothing, to me.

I understand that this specific KCM is not really fixable for Wayland, but it would be great if KDE could add _something_ to their roadmap. Having at least a plan for window/app targeting and a little input mapping as a nice-to-have feature would be preferable to this ‘go away’-style bug closure.
Comment 47 Neal Gompa 2023-12-20 00:26:53 UTC
The missing piece is emulated input support in Plasma Wayland, and that requires someone to implement the support in kwin and xdg-desktop-portal-kde: https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/issues/12

Once that's in place, we'd have a framework to do fancier things in Wayland.