summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/shell/quickshell-plugins
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2025-09-10 15:57:26 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2025-09-10 15:57:26 +0200
commitd20393e077b8d97b18f4a224ddcb20caf6dac23b (patch)
tree337a8630deecdb50a2c879754e6b34b71575bbe0 /accounts/gkleen@sif/shell/quickshell-plugins
parent9fab3828698199718a3d2f2faf8826f77d9258f7 (diff)
downloadnixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.tar
nixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.tar.gz
nixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.tar.bz2
nixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.tar.xz
nixos-d20393e077b8d97b18f4a224ddcb20caf6dac23b.zip
...
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell-plugins')
-rw-r--r--accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp14
-rw-r--r--accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp1
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
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}
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
11public: 11public:
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};