This allows more complicated rules, useful for matching Chrome webapps to their
respective desktop file where we need to change crx_foo to chrome-foo-default.
Details
- Chrome app shows proper icon instead of generic Chrome icon
- Chrome app can be added as launcher and started independently of Chrome
They are still grouped as Chrome windows and I just noticed that sometimes the grouper gets confused and uses the webapp icon as group icon (well, it just uses the icon of the first item in the group or so)
There can be multiple rewrite rules, it looks for [Rewrite Rules][window class class] and then iterates all groups within, name doesn't matter, I used [1] for clarity. It iterates until it finds a service, the iterations aren't cumulative.
The keys:
- Property - which property of the window to work with, either ClassName or ClassClass (the default)
- Identifier - which field to query for in KService (default DesktopEntryName)
- Match - the Regular Expression, the match named "match" will be used, or the first capture as fallback
- Target - the rewritten rule, %1 is substituted for the match of the regexp
Diff Detail
- Repository
- R120 Plasma Workspace
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
I won't accept this patch, sorry. I'm not willing to add special cases for individual applications, especially to compiled code.
Would you instead accept an extension of the taskmanagerrulesrc mechanism in the style of:
[Rewrite Rules][google-chrome] crx_$1=chrome-$1-default
?
Basically yes, but couldn't we use QRegExp syntax instead of coming up with a DSL? Then we could also precompile the regexes when the rc file changes (if we want to make the impl that complex) in case we hit a hotpath.
I'd prefer a stricter approach that rejects incomplete rules, e.g. instead of falling back to classClass if Property is not set, skip the rule. Reasoning: The behavior of the heuristic is already magic and obtuse enough, and debugging what happens is not made any easier if interpreting rules requires context knowledge or looking at code. These rules are written so rarely the format doesn't need to be lazy-typing-friendly.
Parse config strict:
- Property is required (either ClassClass or ClassName)
- Identifier is required (eg. DesktopEntryName)
- only use named regexp match "match"
Kai, could you rebase this against the new lib? The heuristic is in XWindowsTasksModel now. It's the one slice of code still similar to the old lib so it shouldn't be much work.
Will do, once I figure out what I forgot to update: plasmashell: symbol lookup error: /usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/plasma/private/taskmanager/libtaskmanagerplugin.so: undefined symbol: _ZN11TaskManager12GroupManagerC1EP7QObject :)
Looks like you forgot to update plasma-desktop. TaskManager::GroupManager is a class from the old libtaskmanager, which was renamed to legacylibtaskmanager in the plasma-workspace changes. So it looks like you're trying to run the old applet against an updated p-w.
- Rebase ontop of new libtaskmanager - was a straight forward port :)
Cool side-effect: Chome webapp windows are no longer grouped to other Chrome browser windows, making them behave like real applications.