mOdUlAr
This commit is contained in:
parent
b2e7765b13
commit
e742d169c2
@ -19,16 +19,28 @@ return_mouse(){
|
||||
xdotool mousemove $mouse_x $mouse_y
|
||||
}
|
||||
|
||||
lock_tg(){
|
||||
xdotool windowactivate --sync $tg_window_id key ctrl+l
|
||||
}
|
||||
|
||||
readpin(){
|
||||
tgpin=$(cat ~/.local/.tgpin.txt)
|
||||
}
|
||||
|
||||
unlock_tg(){
|
||||
xdotool windowactivate --sync $tg_window_id key $tgpin Return
|
||||
}
|
||||
|
||||
if [ "$1" == "lock" ]; then
|
||||
get_tg_window_id
|
||||
get_mouse_location
|
||||
xdotool windowactivate --sync $tg_window_id key ctrl+l
|
||||
lock_tg
|
||||
return_mouse
|
||||
elif [ "$1" == "unlock" ]; then
|
||||
get_tg_window_id
|
||||
get_mouse_location
|
||||
tgpin=$(cat ~/.local/.tgpin.txt)
|
||||
xdotool windowactivate --sync $tg_window_id key $tgpin Return
|
||||
readpin
|
||||
unlock_tg
|
||||
return_mouse
|
||||
else
|
||||
echo "Invalid argument. Please use 'lock' or 'unlock'."
|
||||
|
Loading…
x
Reference in New Issue
Block a user