diff options
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell-plugins')
-rw-r--r-- | accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp | 14 | ||||
-rw-r--r-- | accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp | 1 |
2 files changed, 12 insertions, 3 deletions
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) { | |||
9 | "/org/freedesktop/systemd1", | 9 | "/org/freedesktop/systemd1", |
10 | "org.freedesktop.systemd1.Manager", | 10 | "org.freedesktop.systemd1.Manager", |
11 | "StopUnit" | 11 | "StopUnit" |
12 | ); | 12 | ) << unit << mode; |
13 | m << unit; | ||
14 | m << mode; | ||
15 | QDBusConnection::sessionBus().send(m); | 13 | QDBusConnection::sessionBus().send(m); |
16 | } | 14 | } |
15 | |||
16 | void Systemd::setBrightness(const QString& subsystem, const QString& name, quint32 brightness) { | ||
17 | QDBusMessage m = QDBusMessage::createMethodCall( | ||
18 | "org.freedesktop.login1", | ||
19 | "/org/freedesktop/login1/session/auto", | ||
20 | "org.freedesktop.login1.Session", | ||
21 | "SetBrightness" | ||
22 | ) << subsystem << name << brightness; | ||
23 | QDBusConnection::systemBus().send(m); | ||
24 | } | ||
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 { | |||
10 | 10 | ||
11 | public: | 11 | public: |
12 | Q_INVOKABLE void stopUserUnit(const QString& unit, const QString& mode); | 12 | Q_INVOKABLE void stopUserUnit(const QString& unit, const QString& mode); |
13 | Q_INVOKABLE void setBrightness(const QString& subsystem, const QString& name, quint32 brightness); | ||
13 | }; | 14 | }; |