I’ve found this to be a great idea as I often fall asleep listening to something via YouTube Vanced, which sometimes out of nowhere tends to give very high CPU load and drain battery.
So I made a very simple app that has a slider to select timeout in minutes and then a singleshot QTimer which on timeout makes the following call via DBus:
QDBusMessage mm = QDBusMessage::createMethodCall("com.jolla.apkd",
"/com/jolla/apkd",
"com.jolla.apkd",
"controlService");
mm << false;
QDBusConnection::systemBus().call(mm);
It works perfectly fine, but only if I disable sandboxing in .desktop file using
Sandboxing=Disabled
Does anyone know what to do (e.g. which permissions to use, or whatever else needs to be done) to make it work with sandboxing enabled?