diff --git a/platform/nix.lua b/platform/nix.lua index 40d268d..276b259 100644 --- a/platform/nix.lua +++ b/platform/nix.lua @@ -12,6 +12,13 @@ local function is_installed(exe_name) return os.execute("which " .. exe_name) == 0 end +local function is_xclip_installed() + local handle = io.popen("xclip -version 2>&1", "r") + local result = handle:read("*a") + handle:close() + return result:find("xclip version") ~= nil +end + if h.is_mac() then self.clip_util = "pbcopy" self.clip_cmd = "LANG=en_US.UTF-8 " .. self.clip_util @@ -22,7 +29,7 @@ elseif h.is_wayland() then else self.clip_util = "xclip" self.clip_cmd = self.clip_util .. " -i -selection clipboard" - self.healthy = is_installed(self.clip_util) + self.healthy = is_xclip_installed() end self.tmp_dir = function()