Skip to content

Commit

Permalink
fix: check wayland before x11 (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
HakonHarnes authored Jun 5, 2024
1 parent d7ddfd8 commit 1924e20
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lua/img-clip/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ local error = vim.health.error or vim.health.report_error
M.check = function()
start("img-clip.nvim")

-- Linux (X11)
if os.getenv("DISPLAY") then
if util.executable("xclip") then
ok("`xclip` is installed")
else
error("`xclip` is not installed")
end

-- Linux (Wayland)
elseif os.getenv("WAYLAND_DISPLAY") then
if os.getenv("WAYLAND_DISPLAY") then
if util.executable("wl-copy") then
ok("`wl-clipboard` is installed")
else
error("`wl-clipboard` is not installed")
end

-- Linux (X11)
elseif os.getenv("DISPLAY") then
if util.executable("xclip") then
ok("`xclip` is installed")
else
error("`xclip` is not installed")
end

-- MacOS
elseif util.has("mac") then
if util.executable("osascript") then
Expand Down

0 comments on commit 1924e20

Please sign in to comment.