200 loops just in case

This commit is contained in:
inigoortega 2019-10-10 23:08:19 +02:00
parent 7ce3f490d7
commit b732d846b0
1 changed files with 6 additions and 5 deletions

View File

@ -15,18 +15,19 @@ get_window_id () {
}
telegram-desktop
xdotool key alt+7
telegram_id="$(pgrep Telegram)"
window_id="$(get_window_id "$telegram_id")"
while true
i=0
while [ "$i" -lt 200 ]
do
correct="$(xprop -id "$window_id" | grep "window state: Normal")"
[ -n "$correct" ] && break
[ -n "$correct" ] && break || i="$(( $i + 1))"
done
xdotool key Return
if [ "$i" -lt 200 ]; then
xdotool key alt+7 && xdotool key Return
fi