mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-08-03 09:44:28 +02:00
i3-companion: remove duplicate code
This commit is contained in:
parent
b6ab2d3c12
commit
5994b8a0fd
1 changed files with 4 additions and 9 deletions
|
@ -628,7 +628,7 @@ async def bluetooth_notifications(i3, event, path, interface, changed, invalid):
|
|||
@retry(2)
|
||||
@debounce(0.2)
|
||||
async def bluetooth_status(i3, event, *args):
|
||||
"""Update bluetooth status for polybar."""
|
||||
"""Update bluetooth status for Polybar."""
|
||||
if event is StartEvent:
|
||||
# Do we have a bluetooth device?
|
||||
if not os.path.exists("/sys/class/bluetooth"):
|
||||
|
@ -720,11 +720,7 @@ async def bluetooth_status(i3, event, *args):
|
|||
)
|
||||
)
|
||||
async def dunst_status_update(i3, event, path, interface, changed, invalid):
|
||||
"""Update notification status in polybar."""
|
||||
if interface != "org.dunstproject.cmd0":
|
||||
return
|
||||
if "paused" not in changed:
|
||||
return
|
||||
"""Update notification status in Polybar."""
|
||||
polybar(
|
||||
"dunst",
|
||||
icons[
|
||||
|
@ -735,14 +731,13 @@ async def dunst_status_update(i3, event, path, interface, changed, invalid):
|
|||
|
||||
@on(StartEvent)
|
||||
async def dunst_status_check(i3, event):
|
||||
"""Display notification status for polybar."""
|
||||
"""Display notification status for Polybar."""
|
||||
conn = i3.session_bus["org.freedesktop.Notifications"]
|
||||
obj = conn["/org/freedesktop/Notifications"]
|
||||
dunst = await obj.get_async_interface("org.dunstproject.cmd0")
|
||||
paused = await dunst.paused
|
||||
polybar(
|
||||
"dunst",
|
||||
icons[paused and "notifications-disabled" or "notifications-enabled"],
|
||||
"dunst", icons[paused and "notifications-disabled" or "notifications-enabled"]
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue