Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
68de299763
9 changed files with 213 additions and 20 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -110,8 +110,8 @@ class Module(core.module.Module):
|
|||
res = f"{res} {util.graph.hbar(self.__volume*100)}"
|
||||
|
||||
if self.__show_device_name:
|
||||
friendly_name = self.parameter(self.__devicename.lower(), self.__devicename)
|
||||
icon = self.parameter("icon." + self.__devicename.lower(), "")
|
||||
friendly_name = self.parameter(self.__devicename, self.__devicename)
|
||||
icon = self.parameter("icon." + self.__devicename, "")
|
||||
res = (
|
||||
icon + " " + friendly_name + " | " + res
|
||||
if icon != ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue