Skip to content

Instantly share code, notes, and snippets.

@nanpuyue
Created November 12, 2018 11:06
Show Gist options
  • Save nanpuyue/757018a6a56e875db0da10049a8037ed to your computer and use it in GitHub Desktop.
Save nanpuyue/757018a6a56e875db0da10049a8037ed to your computer and use it in GitHub Desktop.
#!/bin/bash
# file: x-input.sh
# date: 2018-11-12
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt
# author: nanpuyue <[email protected]> https://blog.nanpuyue.com
#
# 依赖:zenity xdotool xclip
#
# 使用时将脚本绑定快捷键,例如:
# 设置快捷键 alt + t 绑定 x-input.sh
text="$(zenity --entry --title 中文输入 --text 中文输入 --width=600)"
echo -n "$text"|xclip -i -sel clip
xdotool key --delay 200 --clearmodifiers ctrl+v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment