200 loops just in case
This commit is contained in:
parent
7ce3f490d7
commit
b732d846b0
|
@ -15,18 +15,19 @@ get_window_id () {
|
||||||
}
|
}
|
||||||
|
|
||||||
telegram-desktop
|
telegram-desktop
|
||||||
xdotool key alt+7
|
|
||||||
|
|
||||||
telegram_id="$(pgrep Telegram)"
|
telegram_id="$(pgrep Telegram)"
|
||||||
|
|
||||||
window_id="$(get_window_id "$telegram_id")"
|
window_id="$(get_window_id "$telegram_id")"
|
||||||
|
|
||||||
|
i=0
|
||||||
while true
|
while [ "$i" -lt 200 ]
|
||||||
do
|
do
|
||||||
correct="$(xprop -id "$window_id" | grep "window state: Normal")"
|
correct="$(xprop -id "$window_id" | grep "window state: Normal")"
|
||||||
|
|
||||||
[ -n "$correct" ] && break
|
[ -n "$correct" ] && break || i="$(( $i + 1))"
|
||||||
done
|
done
|
||||||
|
|
||||||
xdotool key Return
|
if [ "$i" -lt 200 ]; then
|
||||||
|
xdotool key alt+7 && xdotool key Return
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue