Eisa01 / mpv-scripts

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

[Feature Request] Wayland support via wl-clipboard #8

Closed mielouk closed 4 years ago

mielouk commented 4 years ago

As xclip is X11 only, I wondered if you could substitute it with wl-clipboard to enable those scripts under Wayland.

Eisa01 commented 4 years ago

Thought of a way to allow more customization and handle any bash program for any OS. Can you try version 2.2 attached and let me know,

There is now settings in the script. Simply open the script with any text editor, and change mac_copy = 'pbcopy' to the wl-clipboard copy command mac_paste = 'pbpaste' to the wl-clipboard paste command they could be something like 'wl-copy' 'wl-paste'

SmartCopyPaste-II-2.2.zip

Let me know if it works for you ^ ^

mielouk commented 4 years ago

local linux_copy = 'wl-copy' --copy command that will be used in Linux. OR write a different command

local linux_paste = 'wl-paste' --paste command that will be used in Linux. OR write a different command

Works great! Thank you!

I got another question somewhat related to this, but I'm not sure whether I should open another issue. Is it possible to add the mouse middle click as a key binding to paste the content of the clipboard? How should additional lines look like?

mp.add_key_binding('ctrl+v', 'paste', paste) mp.add_key_binding('ctrl+V', 'pasteCaps', paste)

Eisa01 commented 4 years ago

Glad that it works :) As for your question, if I remember correctly mouse middle click is MOUSE_BTN1 in mpv. Under Keybindig settings of the script, for MAC OS, you should see:

mp.add_key_binding('Meta+v', 'paste', paste)
mp.add_key_binding('Meta+V', 'pasteCaps', paste)

You can add an additional line mp.add_key_binding('MOUSE_BTN1', 'pasteMouse', paste)

If it didn't work, let me know so I double check ^ ^

mielouk commented 4 years ago

It works quite well. Thx!

I use Arch btw ;)