From 54f4f1601a50fc7a4e7e0d13c0cc2e1a7e33f9e0 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sat, 9 Apr 2022 17:40:47 +0300
Subject: [PATCH] Improvement for notifying from a Toolbox container.

---
 Documents/bin/notify | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documents/bin/notify b/Documents/bin/notify
index c2ce2d3..07d3cdc 100755
--- a/Documents/bin/notify
+++ b/Documents/bin/notify
@@ -32,8 +32,8 @@ else
     hostname="$(sysctl -a 2>/dev/null | awk -F '=' '/^kern[a-z]*\.hostname/ {print $2}')"
 fi
 
-# Get the host' hostname in case
-if [ "$hostname" = 'toolbox' ]
+# Get the host' hostname in case it's a toolbox container.
+if [ "$hostname" = 'toolbox' ] && [ -x /usr/libexec/flatpak-xdg-utils/flatpak-spawn ]
 then
     hostname="$(/usr/libexec/flatpak-xdg-utils/flatpak-spawn --host hostname)"
 fi
-- 
GitLab