Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need a button to stop ydotool #258

Open
Vaisakhkm2625 opened this issue Nov 12, 2024 · 1 comment
Open

need a button to stop ydotool #258

Vaisakhkm2625 opened this issue Nov 12, 2024 · 1 comment

Comments

@Vaisakhkm2625
Copy link

Vaisakhkm2625 commented Nov 12, 2024

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?

@Vaisakhkm2625
Copy link
Author

for now i just binded XF86Calculator key to pkill ydotool in hyprland... but it would be great if there was a inbuilt option

bind = SUPER, code:148, exec, pkill -x ydotool 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant