From 72b1197aff32fa7d0265b23c899011a0bb1dead9 Mon Sep 17 00:00:00 2001 From: Alexey Avramov Date: Thu, 26 Mar 2020 02:34:53 +0900 Subject: [PATCH] fix GUI notifications see also https://github.com/hakavlad/nohang/issues/85#issuecomment-593066828 --- nohang/nohang | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nohang/nohang b/nohang/nohang index afa6257..170d19f 100755 --- a/nohang/nohang +++ b/nohang/nohang @@ -229,7 +229,14 @@ def re_pid_environ(pid): continue if i.startswith(display_env): - display = i[:10] + if i[-2] == '.': + # DISPLAY=:0.0 -> DISPLAY=:0 + display = i[:-2] + else: + display = i + if len(display) > 10: + # skip DISPLAY >= :10 + return None continue if i.startswith(dbus_env):