Merge pull request #994 from zetxx/patch-1

feat: add `disabled` parameter
This commit is contained in:
tobi-wan-kenobi 2023-09-20 14:28:53 +02:00 committed by GitHub
commit fcda13cac0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,6 +28,8 @@ class Module(core.module.Module):
self.__states = {"unknown": ["unknown", "critical"],
"true": ["muted", "warning"],
"false": ["unmuted"]}
if util.format.asbool(self.parameter("disabled", False)):
util.cli.execute("dunstctl set-paused true", ignore_errors=True)
def toggle_state(self, event):
util.cli.execute("dunstctl set-paused toggle", ignore_errors=True)