Bug 429588

Summary: Window rules kcm needs a duplicate button
Product: [Applications] systemsettings Reporter: Duncan <1i5t5.duncan>
Component: kcm_kwinrulesAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: isma.af, nate, plasma-bugs
Priority: NOR Keywords: usability
Version: unspecifiedFlags: 1i5t5.duncan: Usability+
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed In: 5.21

Description Duncan 2020-11-24 12:46:24 UTC
So the last couple weeks I've been switching to wayland.  As a result I've needed to create new window rules /almost/ duplicating many of my old X-based window rules, except of course with new wayland-style org.kde.whatever window classes.

Critically, while I've basically completed the switch now, wayland's now my default and I've deleted many of the old X-based rules, at first I didn't want to touch them as I wasn't yet sure qt/kde/plasma's wayland support was going to be mature enough yet to default to wayland, so I was duplicating rules left and right, adding wayland versions duplicating my X settings but with different class settings.

For such a use-case the window-rules kcm seriously needs a duplicate button!  With it, I'd have been able to press duplicate, load one of the copies, modify the name to reflect wayland, hit detect to get the new class settings and modify them a bit if necessary, and hit apply, all without losing and having to recreate what the rules actually /did/ or their position in the rule stack.

Because that duplicate button isn't there, I had to create a new rule, hit detect to get the new match settings, apply so as not to lose it, back out to the rule list and move the new rule from the bottom into its position next to the old rule, hit apply not to lose that, then repeatedly switch between the two rules copying the settings from the old one to the new one until they basically matched except for the differing class settings.

The lack of that duplicate button therefore made the process far more laborious than it should have been.

(Of course it was made even worse due to bugs such as bug #429586, as I hadn't yet discovered that there's a back button when the individual kcm is loaded with kcmshell5, so I was having to click out of the rules kcm and back to to get back to the rules list as I was doing it in kde system settings which doesn't have that back button, but that's a different bug.)
Comment 1 Bug Janitor Service 2020-11-27 21:22:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/499
Comment 2 Ismael Asensio 2020-11-28 23:21:32 UTC
Git commit a6c51c5445dd89cb09ea110674794a312e33eccc by Ismael Asensio.
Committed on 28/11/2020 at 23:16.
Pushed by iasensio into branch 'master'.

kcm/rules: Add a Duplicate action to rules list

Useful action, especially for heavy kwin rules users

As an example, this can help users to migrate their rules to Wayland
(where some matching properties such as window class may be different)
while keeping a version of the rule compatible with X11.
FIXED-IN: 5.21

M  +16   -0    kcmkwin/kwinrules/kcmrules.cpp
M  +1    -0    kcmkwin/kwinrules/kcmrules.h
M  +9    -0    kcmkwin/kwinrules/package/contents/ui/RulesList.qml

https://invent.kde.org/plasma/kwin/commit/a6c51c5445dd89cb09ea110674794a312e33eccc