Merge remote-tracking branch 'origin/main'

This commit is contained in:
siggi 2023-10-03 22:36:23 +02:00
commit 68de299763
9 changed files with 213 additions and 20 deletions

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)

View file

@ -61,6 +61,7 @@ class Module(core.module.Module):
# if requested then run not async version and just execute command in this thread
if not self.__async:
self.__output = util.cli.execute(self.__command, shell=True, ignore_errors=True).strip()
core.event.trigger("update", [self.id], redraw_only=True)
return
# if previous thread didn't end yet then don't do anything

View file

@ -50,8 +50,9 @@ class Module(core.module.Module):
# create a connection with i3ipc
self.__i3 = i3ipc.Connection()
# event is called both on focus change and title change
# event is called both on focus change and title change, and on workspace change
self.__i3.on("window", lambda __p_i3, __p_e: self.__pollTitle())
self.__i3.on("workspace", lambda __p_i3, __p_e: self.__pollTitle())
# begin listening for events
threading.Thread(target=self.__i3.main).start()