From 06b80ff9edff66488aa245415c63d489da6a68d1 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 17 Apr 2023 17:28:43 -0400 Subject: [PATCH] ARRG, disable `dunst` notifications for now in order mode --- piker/ui/_notify.py | 6 ++++-- piker/ui/order_mode.py | 12 ++++++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/piker/ui/_notify.py b/piker/ui/_notify.py index 4a33dabb..8cc45e89 100644 --- a/piker/ui/_notify.py +++ b/piker/ui/_notify.py @@ -93,7 +93,7 @@ async def notify_from_ems_status_msg( # TODO: add in standard fill/exec info that maybe we # pack in a broker independent way? f"'{msg.pformat()}'", - ], + ], capture_stdout=True, capture_stderr=True, check=False, @@ -104,4 +104,6 @@ async def notify_from_ems_status_msg( log.runtime(result) except FileNotFoundError: - log.warn('Tried to send a notification but \'notify-send\' not present') + log.warn( + 'Tried to send a notification but \'notify-send\' not present' + ) diff --git a/piker/ui/order_mode.py b/piker/ui/order_mode.py index ec789d66..578babc2 100644 --- a/piker/ui/order_mode.py +++ b/piker/ui/order_mode.py @@ -973,6 +973,12 @@ async def process_trade_msg( client: OrderClient, msg: dict, + # emit linux DE notification? + # XXX: currently my experience with `dunst` is that this + # is horrible slow and clunky and invasive and noisy so i'm + # disabling it for now until we find a better UX solution.. + do_notify: bool = False, + ) -> tuple[Dialog, Status]: fmsg = pformat(msg) @@ -1092,7 +1098,8 @@ async def process_trade_msg( ) mode.lines.remove_line(uuid=oid) msg.req = req - await notify_from_ems_status_msg(msg) + if do_notify: + await notify_from_ems_status_msg(msg) # response to completed 'dialog' for order request case Status( @@ -1101,7 +1108,8 @@ async def process_trade_msg( req=req, ): msg.req = Order(**req) - await notify_from_ems_status_msg(msg) + if do_notify: + await notify_from_ems_status_msg(msg) mode.lines.remove_line(uuid=oid) # each clearing tick is responded individually