This commit is contained in:
千住柱間 2024-06-28 22:56:08 -04:00
parent 553a9feb42
commit e5e5c1cc99
Signed by: hashirama
GPG key ID: 53E62470A86BC185

View file

@ -1,40 +1,14 @@
9,26c9,16 diff -urN ../mpvacious/platform/nix.lua ../mpvacious-patch/platform/nix.lua
< local self = { healthy = true, clip_util = "", clip_cmd = "", } --- ../mpvacious/platform/nix.lua 2024-06-28 22:39:00.110717010 -0400
< +++ ../mpvacious-patch/platform/nix.lua 2024-06-28 22:51:09.477937080 -0400
< if h.is_mac() then @@ -26,8 +26,8 @@
< self.clip_util = "pbcopy" return handle.status == 0 and handle.stderr:match("xclip version") ~= nil
< self.clip_cmd = "LANG=en_US.UTF-8 " .. self.clip_util end
< elseif h.is_wayland() then
< local function is_wl_copy_installed() - self.clip_util = "xclip"
< local handle = h.subprocess { 'wl-copy', '--version' } - self.clip_cmd = self.clip_util .. " -i -selection clipboard"
< return handle.status == 0 and handle.stdout:match("wl%-clipboard") ~= nil + self.clip_util = "xsel"
< end + self.clip_cmd = self.clip_util .. " --input --clipboard"
< self.healthy = is_xclip_installed()
< self.clip_util = "wl-copy" end
< 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')