From f7ec66362e487565b74e65a8025e5f4b714d9ea2 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 26 Oct 2022 00:55:26 -0400 Subject: [PATCH] Only get dbus user on sudo-user-present --- piker/ui/_notify.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/piker/ui/_notify.py b/piker/ui/_notify.py index c3da8d4b..c4804663 100644 --- a/piker/ui/_notify.py +++ b/piker/ui/_notify.py @@ -58,8 +58,11 @@ async def notify_from_ems_status_msg( if is_subproc: global _dbus_uid - if not _dbus_uid: - su = os.environ['SUDO_USER'] + su = os.environ.get('SUDO_USER') + if ( + not _dbus_uid + and su + ): # TODO: use `trio` but we need to use nursery.start() # to use pipes?