summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp')
-rw-r--r--accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp
new file mode 100644
index 00000000..5e607709
--- /dev/null
+++ b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp
@@ -0,0 +1,24 @@
1#include "Systemd.hpp"
2
3#include <QDBusConnection>
4#include <QDBusMessage>
5
6void Systemd::stopUserUnit(const QString& unit, const QString& mode) {
7 QDBusMessage m = QDBusMessage::createMethodCall(
8 "org.freedesktop.systemd1",
9 "/org/freedesktop/systemd1",
10 "org.freedesktop.systemd1.Manager",
11 "StopUnit"
12 ) << unit << mode;
13 QDBusConnection::sessionBus().send(m);
14}
15
16void 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}