How do I get inverse search window focusing working on Wayland (sway)? #3202
-
Hello, I'm using vimtex with okular as my viewer on Wayland (in particular, swaywm). Inverse search works well except for that it does not focus on the Neovim window. Does anyone have any idea how I can make this work, even if it's a bit hacky? This is my failed attempt at a good-enough solution: swaymsg '[title="Neovim"]' focus will focus on an instance of Neovim, so I thought that by setting the Okular editor command as nvim --headless -c "VimtexInverseSearch %l '%f'" && swaymsg '[title="Neovim"]' focus would work. However, this just breaks the Okular editor feature, and therefore inverse search. I also tried this with zathura, qpdfview and sioyek, to no avail. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Great, glad to hear that. I'm still on X11 (I have a setup that has served me well for a decade or more, so why change a winning recipe?).
I'm sorry to say that I don't think I will be able to help much. I more or less don't know anything about Wayland and sway.
Did you try using only that in the Okular setting? Does that work? Another thing you could try is to use vim.api.nvim_create_autocmd("User", {
desc = "",
pattern = "VimtexEventViewReverse",
group = vim.api.nvim_create_augroup("init_vimtex", {}),
callback = function()
vim.system { "swaymsg", '[title="Neovim"]', "focus" }
end,
}) I'm not 100 % sure which environment that runs in and whether |
Beta Was this translation helpful? Give feedback.
Great, glad to hear that. I'm still on X11 (I have a setup that has served me well for a decade or more, so why change a winning recipe?).
I'm sorry to say that I don't think I will be able to help much. I more or less don't know anything about Wayland and sway.
Did you try using only that in the Okular setting? Does that …