Add try catch for when notify-send is not present on system
parent
42d2f9e461
commit
ffd707db62
|
@ -83,22 +83,26 @@ async def notify_from_ems_status_msg(
|
||||||
f'unix:path=/run/user/{_dbus_uid}/bus'
|
f'unix:path=/run/user/{_dbus_uid}/bus'
|
||||||
)
|
)
|
||||||
|
|
||||||
result = await trio.run_process(
|
try:
|
||||||
[
|
result = await trio.run_process(
|
||||||
'notify-send',
|
[
|
||||||
'-u', 'normal',
|
'notify-send',
|
||||||
'-t', f'{duration}',
|
'-u', 'normal',
|
||||||
'piker',
|
'-t', f'{duration}',
|
||||||
|
'piker',
|
||||||
|
|
||||||
# TODO: add in standard fill/exec info that maybe we
|
# TODO: add in standard fill/exec info that maybe we
|
||||||
# pack in a broker independent way?
|
# pack in a broker independent way?
|
||||||
f"'{msg.pformat()}'",
|
f"'{msg.pformat()}'",
|
||||||
],
|
],
|
||||||
capture_stdout=True,
|
capture_stdout=True,
|
||||||
capture_stderr=True,
|
capture_stderr=True,
|
||||||
check=False,
|
check=False,
|
||||||
)
|
)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
log.warn(f'No notification daemon installed stderr: {result.stderr}')
|
log.warn(f'Notification daemon crashed stderr: {result.stderr}')
|
||||||
|
|
||||||
log.runtime(result)
|
log.runtime(result)
|
||||||
|
|
||||||
|
except FileNotFoundError:
|
||||||
|
log.warn('Tried to send a notification but \'notify-send\' not present')
|
||||||
|
|
Loading…
Reference in New Issue