Results 1 to 4 of 4

Thread: xdotool question

  1. #1
    Join Date
    Oct 2010
    Location
    Sweden
    Beans
    821
    Distro
    Ubuntu 16.04 Xenial Xerus

    xdotool question

    I'm on 12.04.
    I have xdotool and xclip installed.

    I have a script bound to a hot key that works.

    The script is:
    Code:
    #!/bin/bash
    xclip -in -selection c ~/scripts/xclip-scripts/sig
    The sig file contains my signature. (I know this is really simple. )

    So now, I can hit the hot key and then ctrl+v to paste my name in a document, web brownser etc.

    I thought it would be cool, if my name was automatically pasted where ever the cursor is when I press the hot key.

    That is the problem. I can't get that part to work.
    I tried adding
    Code:
    xdotool key ctrl+v
    and I swear that it worked yesterday in gedit, but nothing else. Today, it does not work in gedit either.

    I tried following the post here, but that doesn't work either.

    Any ideas on what I am doing wrong?

    I'd really appreciate some advice.
    Thank you,
    GG -----------
    GUI we don't need no stinking GUI: A collection of Bash scripts
    Mutt (email), cmus (music),Google Calendar and Google Tasks cli

  2. #2
    Join Date
    Oct 2008
    Location
    Ottawa, Canada
    Beans
    809
    Distro
    Xubuntu 16.04 Xenial Xerus

    Re: xdotool question

    I had the same problem recently. Turned out my text file was not properly encoded for xclip and contained extended characters. Saving it with UTF-8 encoding solved it. Perhaps you have exotic Swedish characters in your sig?

    Hope this helps!
    husband@wife$ make sandwich
    Permission denied
    husband@wife$ sudo make sandwich

  3. #3
    Join Date
    Oct 2008
    Beans
    3,509

    Re: xdotool question

    If your pressing a shortcut key to activate a script that contains an xdotool
    command you may want to put in a 1 second sleep command before the xdotool command.

  4. #4
    Join Date
    Oct 2010
    Location
    Sweden
    Beans
    821
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: xdotool question

    Quote Originally Posted by LewisTM View Post
    I had the same problem recently. Turned out my text file was not properly encoded for xclip and contained extended characters. Saving it with UTF-8 encoding solved it. Perhaps you have exotic Swedish characters in your sig?

    Hope this helps!
    I wish that were the case. However, I and my computer are both from the US (Just live in Sweden). My name doesn't have any of the Swedish letters äöå so the file should be a regular old UTF-8 file.

    Go figure, I changed the hot key to F2 from ctrl+alt+n for name and it seems to be working now.
    Last edited by GrouchyGaijin; January 11th, 2013 at 09:17 PM. Reason: update
    Thank you,
    GG -----------
    GUI we don't need no stinking GUI: A collection of Bash scripts
    Mutt (email), cmus (music),Google Calendar and Google Tasks cli

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •