Commit 302e5408 authored by Jakob Kummerow's avatar Jakob Kummerow Committed by V8 LUCI CQ

[gm.py] Check for $DISPLAY before showing notifications

This improves the experience over an SSH connection.

No-Try: true
Change-Id: Id6971f2ad2c75c85f91bea71f7215ce7a948ee71
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3586987
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79992}
parent 7dd71005
......@@ -243,7 +243,8 @@ def _Write(filename, content):
f.write(content)
def _Notify(summary, body):
if _Which('notify-send') is not None:
if (_Which('notify-send') is not None and
os.environ.get("DISPLAY") is not None):
_Call("notify-send '{}' '{}'".format(summary, body), silent=True)
else:
print("{} - {}".format(summary, body))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment