· 1 min read
Simulating keyboard typing from the clipboard
Get around fields that block paste on Linux by replaying the clipboard as keystrokes with xclip and xdotool.
Also available in Français

Sometimes a website or application blocks copy-paste in certain text fields (for example a password or a form).
Good news: on Linux, you can get around this limitation by simulating the typing of the clipboard content, as if you were typing it on the keyboard.
Here is the magic command:
xclip -selection clipboard -out | tr \n \r | xdotool selectwindow windowfocus type --clearmodifiers --delay 25 --window %@ --file -👉 Quick explanation:
- xclip: retrieves the clipboard contents.
- tr \n \r: converts line breaks to avoid bugs.
- xdotool type: simulates typing character by character, like a human on the keyboard.
Handy, simple and 100% effective for saving time!