我想读取文本文件的内容,将其复制到剪贴板(如果它不是空的),然后粘贴到鼠标光标所在的gedit窗口。
这是我的剧本:
while true
do
if [ -s textfile ]
then
cat textfile | xclip -selection clipboard
xdotool key --clearmodifiers Control_L+v
truncate -s 0 textfile
fi
done除xdotool外,所有作品均为
我尝试过其他一些命令,比如:
xdotool key ctrl+vxdotool type $(xclip -selection clipboard -o)xdotool getactivewindow type $(xclip -selection clipboard -o),给了我错误XGetWindowProperty[_NET_ACTIVE_WINDOW] failed (code=1)sleep 1 && xdotool key Control_L+v没有运气。
有人能帮我吗?
发布于 2021-02-24 07:36:15
我解决了,问题是Libx11 11-dev失踪了。一旦安装了库,脚本就能正常工作。
发布于 2021-02-23 18:53:36
这对我起了作用:
xdotool type "$(xclip -o)"https://stackoverflow.com/questions/66335469
复制相似问题