Expose AbstractClient's colorScheme as a property
ClosedPublic

Authored by davidedmundson on Oct 3 2018, 12:05 AM.

Details

Summary

This exposes colorScheme as a property which is then usable by kwin effects
Wanted by T9769.

Test Plan

Not tested.
Hoping Michail has a script he wanted to use

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Oct 3 2018, 12:05 AM
Restricted Application added a project: KWin. · View Herald TranscriptOct 3 2018, 12:05 AM
Restricted Application added a subscriber: kwin. · View Herald Transcript
davidedmundson requested review of this revision.Oct 3 2018, 12:05 AM
zzag accepted this revision.Oct 3 2018, 7:14 AM
zzag added a subscriber: zzag.

by kwin effects

Did you mean "by kwin scripts"?

This revision is now accepted and ready to land.Oct 3 2018, 7:14 AM

this is awesome...

graesslin accepted this revision.Oct 5 2018, 5:26 PM

@davidedmundson it works just fine!

I used the following kwin script to confirm it:

function processClient(client) {
    if (client && client.active) {
        callDBus("org.kde.lattedock", "/Latte", "org.kde.LatteDock", "activeWindowColorScheme", client.colorScheme);
    }
}

function setupConnection(client) {
    client.activeChanged.connect(client, function() {
        processClient(this);
    });
}

workspace.clientAdded.connect(setupConnection);
// connect all existing clients
var clients = workspace.clientList();
for (var i=0; i<clients.length; i++) {
    setupConnection(clients[i]);
}
This revision was automatically updated to reflect the committed changes.