Bug 408806 - [RFE] provide API to override keybindings
Summary: [RFE] provide API to override keybindings
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: scripting (other bugs)
Version First Reported In: 5.16.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-16 21:48 UTC by Konstantin Kharlamov
Modified: 2019-06-28 13:23 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Kharlamov 2019-06-16 21:48:32 UTC
Right now the only way to bind an action to a key is by creating a new action, even if there's already one that does the same thing.

It would be great if instead an extension could override a keybinding.

First: this would allow to provide a set of predefined actions for kwin-tiling extension. Tiling managers are associated not only with "tiling ability", but also with consistent set of keybindings. So the extension could provide e.g. "i3-like" config for those migrating from i3, etc.

Second: this would allow to group relevant actions in a single config. Right now if a user has 10 virtual desktops, then to re-bind "focus virtual desktop n" one has to 1. Find the combination in systemsettings5 2. Press the action label to make "overriding" window popup 3. Press the "override" 4. Press the hotkey. 5. Dismiss the window. This needs to be repeated 10 times! And then again for "move window to desktop n" action. With a text editor this could be solved much faster.

See also: https://github.com/kwin-scripts/kwin-tiling/issues/163
Comment 1 Martin Flöser 2019-06-17 06:57:21 UTC
This is outside the scope of KWin. And kglobalaccel already supports such use cases through the dbus API. You can reassign as you wish through dbus, allowing you to shell script.
Comment 2 Konstantin Kharlamov 2019-06-28 13:07:27 UTC
(In reply to Martin Flöser from comment #1)
> This is outside the scope of KWin. And kglobalaccel already supports such
> use cases through the dbus API. You can reassign as you wish through dbus,
> allowing you to shell script.

Thanks. But I've been told that KWin scripts can not execute dbus commands, that there was callDBus function, but it doesn't work anymore. Then, how should KWin script call dbus?
Comment 3 Konstantin Kharlamov 2019-06-28 13:23:26 UTC
(In reply to Konstantin Kharlamov from comment #2)
> (In reply to Martin Flöser from comment #1)
> > This is outside the scope of KWin. And kglobalaccel already supports such
> > use cases through the dbus API. You can reassign as you wish through dbus,
> > allowing you to shell script.
> 
> Thanks. But I've been told that KWin scripts can not execute dbus commands,
> that there was callDBus function, but it doesn't work anymore. Then, how
> should KWin script call dbus?

Nvm, turns out the configuration dialog for script is implemented as part of kcmshell, so that's where the functional is required.