Results 1 to 3 of 3

Thread: Get wine and Ubuntu to share a clipboard?

  1. #1
    Join Date
    Aug 2013
    Beans
    6

    Get wine and Ubuntu to share a clipboard?

    I have a stable copy of Kindle for PC running under Playonlinux and Espeak is configured and running well.

    I want push a button and have it play the highlighted text in my kindle book. I'm trying to use the script
    #!/bin/bash


    xclip -o | xclip -selection clipboard -i
    xclip -o | espeak


    but it never picks up highlights in wine. So how do I link the clipboards/ grab highlighted text in wine?

  2. #2
    Join Date
    Nov 2006
    Beans
    31

    Re: Get wine and Ubuntu to share a clipboard?

    Firstly what are you doing there? Why is xclip being called 3 times?

    X11 has several clipboards.
    When you copy with Ctrl+C, it goes into "CLIPBOARD", and Ctrl+V pastes from "CLIPBOARD".
    Mere text selection goes into "PRIMARY", and middle-click pastes from "PRIMARY".

    xclip's default clipboard is PRIMARY.

    Code:
    xclip -o | xclip -selection clipboard -i
    outputs from PRIMARY, then inputs into CLIPBOARD.

    Code:
    xclip -o | espeak
    outputs from PRIMARY, pipes it to espeak's stdin.

    You should only need the second line. The first line is only there to copy PRIMARY to CLIPBOARD so Ctrl+V can paste, it should not affect the second line at all.

    Now onto why it isn't working.

    Does Wine even populate PRIMARY when text is selected? Let me investigate.

  3. #3
    Join Date
    Nov 2006
    Beans
    31

    Re: Get wine and Ubuntu to share a clipboard?

    I've looked at the source code and run a few tests, and apparently Wine doesn't update the PRIMARY selection when text in a Windows application is selected. It only updates CLIPBOARD, and only when Ctrl+C is pressed.

    To get your application working, you have to select text in the Windows application running under Wine, copy it into the CLIPBOARD selection with Edit->Copy or Ctrl+C or the like, and then get xclip to paste from the CLIPBOARD selection and pipe it to espeak:

    Code:
    xclip -selection clipboard -o | espeak
    If you really want it to automatically copy selected text into the PRIMARY selection without Ctrl+C, please consider filing a bug report with the Wine project.

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
  •