first patch
This commit is contained in:
commit
79886282a0
4
README.md
Normal file
4
README.md
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
- use_xsel is a patch that reduces the latency of clipboard transactions, making it smoother while properly managing the memory.
|
||||||
|
xsel has been around since 2001, and it's stable and has less dependencies than xclip, not to mentionn the compelling group of devs.
|
||||||
|
|
||||||
|
|
40
use_xsel.patch
Normal file
40
use_xsel.patch
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
9,26c9,16
|
||||||
|
< local self = { healthy = true, clip_util = "", clip_cmd = "", }
|
||||||
|
<
|
||||||
|
< if h.is_mac() then
|
||||||
|
< self.clip_util = "pbcopy"
|
||||||
|
< self.clip_cmd = "LANG=en_US.UTF-8 " .. self.clip_util
|
||||||
|
< elseif h.is_wayland() then
|
||||||
|
< local function is_wl_copy_installed()
|
||||||
|
< local handle = h.subprocess { 'wl-copy', '--version' }
|
||||||
|
< return handle.status == 0 and handle.stdout:match("wl%-clipboard") ~= nil
|
||||||
|
< end
|
||||||
|
<
|
||||||
|
< self.clip_util = "wl-copy"
|
||||||
|
< self.clip_cmd = self.clip_util
|
||||||
|
< self.healthy = is_wl_copy_installed()
|
||||||
|
< else
|
||||||
|
< local function is_xclip_installed()
|
||||||
|
< local handle = h.subprocess { 'xclip', '-version' }
|
||||||
|
< return handle.status == 0 and handle.stderr:match("xclip version") ~= nil
|
||||||
|
---
|
||||||
|
> local self = {}
|
||||||
|
> local clip = (function()
|
||||||
|
> if h.is_mac() then
|
||||||
|
> return 'LANG=en_US.UTF-8 pbcopy'
|
||||||
|
> elseif h.is_wayland() then
|
||||||
|
> return 'wl-copy'
|
||||||
|
> else
|
||||||
|
> return 'xsel --input --clipboard'
|
||||||
|
28,32c18
|
||||||
|
<
|
||||||
|
< self.clip_util = "xclip"
|
||||||
|
< self.clip_cmd = self.clip_util .. " -i -selection clipboard"
|
||||||
|
< self.healthy = is_xclip_installed()
|
||||||
|
< end
|
||||||
|
---
|
||||||
|
> end)()
|
||||||
|
39c25
|
||||||
|
< local handle = io.popen(self.clip_cmd, 'w')
|
||||||
|
---
|
||||||
|
> local handle = io.popen(clip, 'w')
|
Loading…
Reference in a new issue