-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ObsidianPasteImg never works. #692
Comments
What does I had this issue when using Neovide on Ubuntu 24.04 and realized that the above command was outputting "wayland" and not "x11" or "tty'. To fix this I did (to debug this myself I used print statements in /home/(my_user)/.local/share/nvim/lazy/obsidian.nvim/lua/obsidian/img_paste.lua since I use lazy.nvim) |
It says |
@NicholasZolton
Reason for asking this is because in the |
Mine results in the following:
Personally, I am using How are you copying the image? |
the output i provided above used copying image from Dolphin file manager.
Which means it should work but it still prompts me with the same error saying there is no image data in the clipboard which there is now for the matching pattern provided. |
The |
Only other idea I have is that perhaps your clipboard command is not being recognized in nvim or is failing - maybe the path is different from your shell or there's something weird going on with permissions? Maybe try checking the output of the clipboard command in: for output in assert(io.popen(get_clip_check_command())):lines() do
content[#content + 1] = output
end |
That's what i checked first and it outputs nothing. |
That's quite odd. I know this might seem redundant, but do you mind trying the following in your config? vim.notify(
string.format(
"wl-paste available: %d and xclip available: %d",
vim.fn.executable "wl-paste",
vim.fn.executable "xclip"
)
) just to see if vim itself can recognize the binaries. |
I am having the same issue, when I run the above code I get My session type is showing as I am also using KDE Plasma 6 with spectacle, and the output for
Environment:
|
@NicholasZolton The same output as mentioned by @elianmanzueta. |
I know this is probably overkill, but I'm guessing if you copy something and then run this code you get no output for either command? local xdg_session = os.getenv "XDG_SESSION_TYPE"
local cmd_output = assert(io.popen "wl-paste --list-types"):lines()
local cmd_output2 = assert(io.popen "xclip -selection clipboard -o -t TARGETS"):lines()
-- concat all the lines into a string for each command
local cmd_output_line = ""
for line in cmd_output do
cmd_output_line = cmd_output_line .. ";" .. line
end
local cmd_output_line2 = ""
for line in cmd_output2 do
cmd_output_line2 = cmd_output_line2 .. ";" .. line
end
vim.notify(
string.format(
"wl-paste available: %d, xclip available: %d, OS: %s, cmd_output1: %s, cmd_output2: %s",
vim.fn.executable "wl-paste",
vim.fn.executable "xclip",
xdg_session,
cmd_output_line,
cmd_output_line2
)
) |
Working as it should i'm baffled too at this point lol. |
Yeah at this point I'm really confused lol. Maybe double check that the recognized OS is correct from the obsidian util? local sysname = vim.loop.os_uname().sysname
local release = vim.loop.os_uname().release:lower()
vim.notify(string.format("Sysname: %s, Release: %s", sysname, release)) The error is definitely occurring in that function based on your previous comments, and vim is clearly able to get the output using the correct command line utils, so the only thing left would be this code snippet having an error - if this returns a value we would expect I am completely out of ideas. |
works fine lol
|
This might be a big stretch, but are you sure the tests above were run using the same Lua binary that Neovim is using? For example, if you are using something like Sniprun for the tests could you place the above debug tests at the end of your config and restart Neovim as a whole? I really have no other ideas related to the code itself so the only thing left is to test the base assumptions I suppose 😐. |
I am using LazyVim which has the folder structure of : |
That makes sense, I was hoping there was some quirk with how the files were being run, but it seems like that's not the case either. Hopefully someone else can jump in with an idea, the only thing left (in my opinion) is to step through the code line-by-line with nvim-dap. |
I had the same issue on my side. Removing The latest stable version was released on the 11th of July and since then there have been a couple of commits related to images. I haven't looked into these commits, but most probably the fix is in one of them. |
I did move it to the latest unfortunately still same results. |
🐛 Describe the bug
Whenever using this command it says no image data in the clipboard.
Config
Environment
The text was updated successfully, but these errors were encountered: