From b2e7765b13069b12505337c7456dcc00f802dd06 Mon Sep 17 00:00:00 2001 From: Shihaam Abdul Rahman Date: Sun, 20 Aug 2023 11:32:38 +0500 Subject: [PATCH] check if x11 or not --- scripts/tginput.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/tginput.sh b/scripts/tginput.sh index 1764d99..c6f89ac 100755 --- a/scripts/tginput.sh +++ b/scripts/tginput.sh @@ -1,5 +1,10 @@ #!/bin/bash +if [[ $XDG_SESSION_TYPE != "x11" ]]; then + echo "Unsupported session type: $XDG_SESSION_TYPE" + exit 1 +fi + get_tg_window_id(){ tg_window_id=$(wmctrl -lx | grep telegram-desktop | awk '{print $1}') }