added passcode setup if not found
This commit is contained in:
parent
709079c3e5
commit
0c092f7ab7
@ -23,16 +23,20 @@ lock_tg(){
|
||||
xdotool windowactivate --sync $tg_window_id key ctrl+l
|
||||
}
|
||||
|
||||
readpin(){
|
||||
if [[ ! -f ~/.local/.tgpin.txt ]]; then
|
||||
read_passcode(){
|
||||
if [[ ! -f $HOME/.local/.tgpasscode ]]; then
|
||||
echo "Error: PIN file not found!"
|
||||
exit 1
|
||||
echo "Enter Telegram local passcode seperated characters by space"
|
||||
echo "If passcode is 1234, then enter 1 2 3 4 "
|
||||
read -p "Enter passcode: " PASSCODE
|
||||
echo $PASSCODE > $HOME/.local/.tgpasscode
|
||||
echo Telegram Passcode saved at: $HOME/.local/.tgpasscode
|
||||
fi
|
||||
tgpin=$(cat ~/.local/.tgpin.txt)
|
||||
tgpasscode=$(cat $HOME/.local/.tgpasscode)
|
||||
}
|
||||
|
||||
unlock_tg(){
|
||||
xdotool windowactivate --sync $tg_window_id key $tgpin Return
|
||||
xdotool windowactivate --sync $tg_window_id key $tgpasscode Return
|
||||
}
|
||||
|
||||
if [ "$1" == "lock" ]; then
|
||||
@ -41,7 +45,7 @@ if [ "$1" == "lock" ]; then
|
||||
lock_tg
|
||||
return_mouse
|
||||
elif [ "$1" == "unlock" ]; then
|
||||
readpin
|
||||
read_passcode
|
||||
get_tg_window_id
|
||||
get_mouse_location
|
||||
unlock_tg
|
||||
|
Loading…
x
Reference in New Issue
Block a user