Eisa01 / mpv-scripts

This repository contain scripts I have made for mpv media player...
BSD 2-Clause "Simplified" License
507 stars 35 forks source link

Use clipboard on linux #6

Closed noctuid closed 4 years ago

noctuid commented 4 years ago

xclip -o gives the primary selection, which is the last highlighted/selected text. I think the clipboard should be used by default (i.e. xclip -selection clipboard -o and xclip -selection clipboard -in) maybe with an option to use the primary selection instead. Currently the script does not work if text copied to the clipboard was not not done with highlighting/selection (and most copying I do does not affect the primary selection). Also if you highlight some text, C-c it, and then highlight some other text without copying it, the script will currently use the last highlighted text instead of what you actually copied last.

gyvess commented 4 years ago

I recently discovered SmartCopyPaste-2.0.lua and had the same problem. I made a minor change to correct the behavior.

Line 76 originally looks like this local args = { 'xclip', '-o' }

Change it to this local args = { 'xsel', '-bo' }

Eisa01 commented 4 years ago

@noctuid thank you for clarifying, did not know how linux handles clipboard. It should be fixed now in version 2.1. @gyvess Thank you also, xsel command sure is also helpful.

Test and let me know so I close this ^ ^