Last active
October 27, 2025 22:45
-
-
Save CodeZombie/c7f0e37dd67d8cc0e78064a95f56a5f4 to your computer and use it in GitHub Desktop.
pastetype
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # 1. Start ydotoold in the background | |
| # The '&' runs the command as a background job | |
| ydotoold & | |
| # 2. Save the Process ID (PID) of the background process | |
| # '$!' is a special variable that holds the PID of the last backgrounded process | |
| YDOTOOLD_PID=$! | |
| # 3. Wait for ydotoold to initialize | |
| # This is important! If ydotool runs too fast, it may fail to connect. | |
| # You might need to adjust this | |
| sleep 0.5 | |
| # 4. type out the contents of the clipboard | |
| ydotool type --key-delay=1 --key-hold=1 "$(wl-paste)" | |
| # 5. Stop the ydotoold daemon now that typing is finished | |
| kill $YDOTOOLD_PID | |
| echo "Script finished." |
Author
Author
You should be careful with this, as "pasting" a huge amount of text will take a fairly long time, even with key-delay and key-hold set to 1. Once it's started, there isn't really a way to halt it.
While ydotool is typing, it wont care which window you're focused on, and will continue typing text even if you switch to a sensitive window, so be cautious!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LLM slop script that let's me "paste" into Teradici (aka PCIOP aka HP AnyAware) from Linux, where client-to-host paste seems to be broken.
You may need to add your user to the
inputgroup to get ydotool/ydotoold to run without sudo.