summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/shell/quickshell-plugins
diff options
context:
space:
mode:
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell-plugins')
-rw-r--r--accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp27
-rw-r--r--accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp3
2 files changed, 12 insertions, 18 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp
index 884ea17f..308659e9 100644
--- a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp
+++ b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp
@@ -51,26 +51,17 @@ void Systemd::onLogindSessionPropertiesChanged(const QString& interface_name, co
51 emit this->lockedHintChanged(); 51 emit this->lockedHintChanged();
52} 52}
53 53
54void Systemd::stopUserUnit(const QString& unit, const QString& mode) { 54void Systemd::stopUserUnit(const QString& unit, const QString& mode) { this->systemdManager->StopUnit(unit, mode); }
55 this->systemdManager->StopUnit(unit, mode);
56}
57 55
58void Systemd::setBrightness(const QString& subsystem, const QString& name, quint32 brightness) { 56void Systemd::setBrightness(const QString& subsystem, const QString& name, quint32 brightness) { this->logindSession->SetBrightness(subsystem, name, brightness); }
59 this->logindSession->SetBrightness(subsystem, name, brightness);
60}
61 57
62bool Systemd::idleHint() { 58bool Systemd::idleHint() { return this->logindSession->idleHint(); }
63 return this->logindSession->idleHint(); 59void Systemd::setIdleHint(bool idle) { this->logindSession->SetIdleHint(idle); }
64} 60bool Systemd::lockedHint() { return this->logindSession->lockedHint(); }
65void Systemd::setIdleHint(bool idle) { 61void Systemd::setLockedHint(bool locked) { this->logindSession->SetLockedHint(locked); }
66 this->logindSession->SetIdleHint(idle); 62void Systemd::lockSession() { this->logindSession->call("Lock"); }
67} 63void Systemd::suspend() { this->logindManager->Suspend(true); }
68bool Systemd::lockedHint() { 64void Systemd::hibernate() { this->logindManager->Hibernate(true); }
69 return this->logindSession->lockedHint();
70}
71void Systemd::setLockedHint(bool locked) {
72 this->logindSession->SetLockedHint(locked);
73}
74 65
75std::string SystemdInhibitorParams::toString(SystemdInhibitorParams::WhatItem what) { 66std::string SystemdInhibitorParams::toString(SystemdInhibitorParams::WhatItem what) {
76 if (what == SystemdInhibitorParams::Shutdown) 67 if (what == SystemdInhibitorParams::Shutdown)
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp
index 84752d76..615024d2 100644
--- a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp
+++ b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp
@@ -28,6 +28,9 @@ public:
28 Q_INVOKABLE void setBrightness(const QString& subsystem, const QString& name, quint32 brightness); 28 Q_INVOKABLE void setBrightness(const QString& subsystem, const QString& name, quint32 brightness);
29 Q_INVOKABLE void setIdleHint(bool idle); 29 Q_INVOKABLE void setIdleHint(bool idle);
30 Q_INVOKABLE void setLockedHint(bool locked); 30 Q_INVOKABLE void setLockedHint(bool locked);
31 Q_INVOKABLE void lockSession();
32 Q_INVOKABLE void suspend();
33 Q_INVOKABLE void hibernate();
31 34
32 bool idleHint(); 35 bool idleHint();
33 bool lockedHint(); 36 bool lockedHint();