From 26ffa8b72831151432bc45ba69bd4f86f019d08c Mon Sep 17 00:00:00 2001 From: Elektroll Date: Sat, 3 Apr 2021 00:34:29 +0200 Subject: [PATCH] =?UTF-8?q?'.config/systemd/user/hikari-for-wayland-displa?= =?UTF-8?q?y.sh'=20hinzuf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/hikari-for-wayland-display.sh | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .config/systemd/user/hikari-for-wayland-display.sh diff --git a/.config/systemd/user/hikari-for-wayland-display.sh b/.config/systemd/user/hikari-for-wayland-display.sh new file mode 100644 index 0000000..b32c6d7 --- /dev/null +++ b/.config/systemd/user/hikari-for-wayland-display.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +i=1 + +while [ "$i" -ne 100 ] +do + systemctl --user show-environment | grep WAYLAND_DISPLAY > /dev/null + + # Return status of grep is 0 when found 1 if not found + status=$? + + # Break loop to skip sleep if found on first try + if [ $status -eq 0 ]; then + echo Display has been found. + break + fi + + sleep 0.1s + # Increment + i=$((i + 1)) +done +