From d20393e077b8d97b18f4a224ddcb20caf6dac23b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 10 Sep 2025 15:57:26 +0200 Subject: ... --- accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp | 14 +++++++++++--- accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'accounts/gkleen@sif/shell/quickshell-plugins') diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp index 9ccd8ba0..5e607709 100644 --- a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp +++ b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp @@ -9,8 +9,16 @@ void Systemd::stopUserUnit(const QString& unit, const QString& mode) { "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", "StopUnit" - ); - m << unit; - m << mode; + ) << unit << mode; QDBusConnection::sessionBus().send(m); } + +void Systemd::setBrightness(const QString& subsystem, const QString& name, quint32 brightness) { + QDBusMessage m = QDBusMessage::createMethodCall( + "org.freedesktop.login1", + "/org/freedesktop/login1/session/auto", + "org.freedesktop.login1.Session", + "SetBrightness" + ) << subsystem << name << brightness; + QDBusConnection::systemBus().send(m); +} diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp index 883a96f3..f8841518 100644 --- a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp +++ b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp @@ -10,4 +10,5 @@ class Systemd : public QObject { public: Q_INVOKABLE void stopUserUnit(const QString& unit, const QString& mode); + Q_INVOKABLE void setBrightness(const QString& subsystem, const QString& name, quint32 brightness); }; -- cgit v1.2.3