From 2c2b72a297fed7c415116ee417de6055d1ee8aab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Harnes?= Date: Thu, 9 May 2024 17:34:16 +0200 Subject: [PATCH] fix: dont use xclip on macos (#67) --- lua/img-clip/clipboard.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lua/img-clip/clipboard.lua b/lua/img-clip/clipboard.lua index 52e172e..8f83c73 100644 --- a/lua/img-clip/clipboard.lua +++ b/lua/img-clip/clipboard.lua @@ -14,14 +14,6 @@ M.get_clip_cmd = function() elseif (util.has("win32") or util.has("wsl")) and util.executable("powershell.exe") then M.clip_cmd = "powershell.exe" - -- Linux (Wayland) - elseif os.getenv("WAYLAND_DISPLAY") and util.executable("wl-paste") then - M.clip_cmd = "wl-paste" - - -- Linux (X11) - elseif os.getenv("DISPLAY") and util.executable("xclip") then - M.clip_cmd = "xclip" - -- MacOS elseif util.has("mac") then if util.executable("pngpaste") then @@ -29,6 +21,14 @@ M.get_clip_cmd = function() elseif util.executable("osascript") then M.clip_cmd = "osascript" end + + -- Linux (Wayland) + elseif os.getenv("WAYLAND_DISPLAY") and util.executable("wl-paste") then + M.clip_cmd = "wl-paste" + + -- Linux (X11) + elseif os.getenv("DISPLAY") and util.executable("xclip") then + M.clip_cmd = "xclip" else return nil end