diff --git a/scripts/tginput.sh b/scripts/tginput.sh index 683b4d6..ae8d730 100755 --- a/scripts/tginput.sh +++ b/scripts/tginput.sh @@ -24,6 +24,10 @@ lock_tg(){ } readpin(){ + if [[ ! -f ~/.local/.tgpin.txt ]]; then + echo "Error: PIN file not found!" + exit 1 + fi tgpin=$(cat ~/.local/.tgpin.txt) } @@ -37,9 +41,9 @@ if [ "$1" == "lock" ]; then lock_tg return_mouse elif [ "$1" == "unlock" ]; then + readpin get_tg_window_id get_mouse_location - readpin unlock_tg return_mouse else