diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-09-11 23:17:57 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-09-11 23:17:57 +0200 |
commit | 564853110a6e1367cc379bd8418d874829302d00 (patch) | |
tree | a6d548f7ae9379810f6d3942b10217364ca54c99 /accounts/gkleen@sif/shell/quickshell-plugins | |
parent | dd2df931a3be1a6518c1e9fbff438de4274456cd (diff) | |
download | nixos-564853110a6e1367cc379bd8418d874829302d00.tar nixos-564853110a6e1367cc379bd8418d874829302d00.tar.gz nixos-564853110a6e1367cc379bd8418d874829302d00.tar.bz2 nixos-564853110a6e1367cc379bd8418d874829302d00.tar.xz nixos-564853110a6e1367cc379bd8418d874829302d00.zip |
...
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell-plugins')
-rw-r--r-- | accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp | 4 | ||||
-rw-r--r-- | accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp | 1 |
2 files changed, 4 insertions, 1 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp index 790f514f..884ea17f 100644 --- a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp +++ b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.cpp | |||
@@ -118,6 +118,8 @@ std::string SystemdInhibitorParams::toString(SystemdInhibitorParams::Mode mode) | |||
118 | 118 | ||
119 | bool SystemdInhibitor::enabled() const { return static_cast<bool>(this->activeInhibitor); } | 119 | bool SystemdInhibitor::enabled() const { return static_cast<bool>(this->activeInhibitor); } |
120 | void SystemdInhibitor::setEnabled(bool enabled) { | 120 | void SystemdInhibitor::setEnabled(bool enabled) { |
121 | this->mEnabled = enabled; | ||
122 | |||
121 | if (enabled) | 123 | if (enabled) |
122 | this->update(); | 124 | this->update(); |
123 | else | 125 | else |
@@ -173,7 +175,7 @@ void SystemdInhibitor::release() { | |||
173 | } | 175 | } |
174 | 176 | ||
175 | void SystemdInhibitor::update() { | 177 | void SystemdInhibitor::update() { |
176 | if (!this->mWhat || this->mWho.isEmpty() || this->mWhy.isEmpty() || !this->mMode) | 178 | if (!this->mWhat || this->mWho.isEmpty() || this->mWhy.isEmpty() || !this->mMode || !this->mEnabled) |
177 | if (this->activeInhibitor) | 179 | if (this->activeInhibitor) |
178 | this->release(); | 180 | this->release(); |
179 | else | 181 | else |
diff --git a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp index cf978fea..84752d76 100644 --- a/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp +++ b/accounts/gkleen@sif/shell/quickshell-plugins/Systemd.hpp | |||
@@ -134,6 +134,7 @@ private: | |||
134 | 134 | ||
135 | void update(); | 135 | void update(); |
136 | 136 | ||
137 | bool mEnabled = true; | ||
137 | std::unique_ptr<ActiveSystemdInhibitor> activeInhibitor; | 138 | std::unique_ptr<ActiveSystemdInhibitor> activeInhibitor; |
138 | SystemdInhibitorParams::What mWhat = static_cast<SystemdInhibitorParams::What>(0); | 139 | SystemdInhibitorParams::What mWhat = static_cast<SystemdInhibitorParams::What>(0); |
139 | QString mWho; | 140 | QString mWho; |