linuxxdotool

print to gedit whit xdotool


I want to read the content of a text file, copy it to the clipboard (if it is not empty) and then paste to the gedit window where the mouse cursor is positioned.

Here is my script:

while true
do
  if [ -s textfile ]
  then
    cat textfile | xclip -selection clipboard
    xdotool key --clearmodifiers Control_L+v
    truncate -s 0 textfile
  fi
done

All works except xdotool:

I have tried some other commands, like:

No Luck.

Can someone help me?


Solution

  • I solved, the problem was that Libx11-dev was missing. Once the library was installed, the script worked correctly.