Results 1 to 5 of 5

Thread: Does Klipper interfere with xclip

  1. #1

    Default Does Klipper interfere with xclip

    Hello,

    I have this script:

    ---
    for f in "$@"; do
    mediainfo "$f" | grep "©xyz" | head -n 1 | while read -r clipboard_original; do
    latitude=${clipboard_original:43:8}
    longitude=${clipboard_original:51:9}
    clipboard_for_digikam_geo=""geo:""${latitude//+}"00000,"${longitude//+}"00000"
    echo "$clipboard_for_digikam_geo" | xclip -selection c
    done
    done
    exit
    ----
    which I used successfully few months ago.
    But it seems to be not working anymore. If I add echo outputs after each line I can see that the script actually works but it does not copy the result to the clipboard as I wanted.

    xclip is installed and running.

    I haven't seen Klipper before so I thought maybe it interferes with xclip somehow.
    Any ideas?

  2. #2
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,499
    Blog Entries
    2

    Default Re: Does Klipper interfere with xclip

    Based only on my observations,
    "The clipboard" is a completely different object than any app that reads and writes to it.

    Maybe recommend some simple testing with xclip... write and read some test text manually.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  3. #3

    Default Re: Does Klipper interfere with xclip

    Quote Originally Posted by WildCowboy View Post
    I haven't seen Klipper before so I thought maybe it interferes with xclip somehow.
    Sure.
    Klipper is a tool to manage a history of previous clipboard entries, and copy back older ones to the actual clipboard (which is an X11 feature).

    But, I think your "confusion" comes from the fact that the "clipboard" and the X11 "selection" are two independent things.
    The one is the current selected text, the other one is only modified if you explicitly choose "Cut" or "Copy" in an application.
    You pass the "-selection" option to xclip, so it does not change the actual clipboard.

    klipper has an option to synchronize them though, but that's disabled by default IIRC.

  4. #4

    Default Re: Does Klipper interfere with xclip

    Quote Originally Posted by wolfi323 View Post
    Sure.
    Klipper is a tool to manage a history of previous clipboard entries, and copy back older ones to the actual clipboard (which is an X11 feature).

    But, I think your "confusion" comes from the fact that the "clipboard" and the X11 "selection" are two independent things.
    The one is the current selected text, the other one is only modified if you explicitly choose "Cut" or "Copy" in an application.
    You pass the "-selection" option to xclip, so it does not change the actual clipboard.

    klipper has an option to synchronize them though, but that's disabled by default IIRC.
    I tried all possible combinations of Klipper settings today but it did not change a thing... Will keep digging

  5. #5

    Default Re: Does Klipper interfere with xclip

    Quote Originally Posted by WildCowboy View Post
    I tried all possible combinations of Klipper settings today but it did not change a thing... Will keep digging
    And did you try to run xclip without the "-selection c" parameter? So that it changes the primary selection instead?

Tags for this Thread

Posting Permissions

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