is it possible add a emergcy stop option to ydotool?
currently i am using a script, that pkills ydotool (but not ydotoold), if something goes wrong..
i bind it to win+ctrl+v, which can type from clipboard, then if something goes wrong, press same to stop..
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p wl-clipboard procps ydotool notify-send
TEMP_FILE="/tmp/cliptype"
if ! pgrep -x "ydotoold" >/dev/null; then
notify-send "ydotoold not running" -t 500
exit 1
fi
if [ -e "$TEMP_FILE" ]; then
rm /tmp/cliptype
notify-send "stopping" -t 500
pkill -x ydotool
exit
fi
sleep 5
wl-paste >/tmp/cliptype
ydotool type -f /tmp/cliptype -d 40
rm /tmp/cliptype
the issues is, by the time i press win+ctrl, script would have pressed some other buttons... and by the time i am able to stop it, it would have opened 10 terminals and would have sent cryptic message summoning ancient spirits to my manager on Microsoft teams...
it would be nice to have a option in that can stop ydotool while tying, something like esc...
like
ydotool type -f file.txt -k 27 # for key code for esc
if it doesn't come under ydotool, is there any work around in script that i can use?
is it possible add a emergcy stop option to ydotool?
currently i am using a script, that pkills ydotool (but not ydotoold), if something goes wrong.. i bind it to win+ctrl+v, which can type from clipboard, then if something goes wrong, press same to stop..
the issues is, by the time i press win+ctrl, script would have pressed some other buttons... and by the time i am able to stop it, it would have opened 10 terminals and would have sent cryptic message summoning ancient spirits to my manager on Microsoft teams...
it would be nice to have a option in that can stop ydotool while tying, something like esc... like
if it doesn't come under ydotool, is there any work around in script that i can use?