okay so this is almost working using luiscanegra’s idea of having a python script listening for the dbus service.
I have the code in github: /bit-shift-io/scripts/tree/master/cec_kwin (as you can’t post url’s on here).
But here is my main.js:
function callDbusMethod(methodName, args) {
print("callDbusMethod: ", methodName, " args:", args)
callDBus("io.bitshift.dbus_service", "/io/bitshift/dbus_service", "io.bitshift.dbus_service", methodName, args);
}
function aboutToTurnOff() {
callDbusMethod("aboutToTurnOff");
}
function wakeUp() {
callDbusMethod("wakeUp");
}
let screens = workspace.screens
print("starting cec_kwin.", screens.length, " screens found.")
if (screens.length) {
let firstScreen = screens[0]
firstScreen.aboutToTurnOff.connect(aboutToTurnOff)
firstScreen.wakeUp.connect(wakeUp)
}
This works the first time, I see a aboutToTurnOff and wakeUp call, but the next time the monitor goes to sleep it seems the functions connected to the signals are not fired.
Is this a bug in kde6 or have I done something wrong?