Skip to content

Instantly share code, notes, and snippets.

@holmeszyx
Last active February 8, 2017 01:22
Show Gist options
  • Save holmeszyx/deb5fc98e22e25e86f6aa35095052e34 to your computer and use it in GitHub Desktop.
Save holmeszyx/deb5fc98e22e25e86f6aa35095052e34 to your computer and use it in GitHub Desktop.
A bash to input text on focused window
#!/bin/bash
text=$1
if [[ $# -eq 0 ]]; then
# read from pipe
read -t 1 text
fi
if [[ ${text} == "" ]]; then
exit 1
fi
sleep 4
xdotool type --delay 100 "${text}"
@zhengzhou
Copy link

最后加个回车
xdotool key Return

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment