[Feature Request] add a bell to the notification
fent opened this issue · 2 comments
fent commented
Sometimes I look away from my terminal and look at other apps. During that time, a notification could have happened. It would be convenient to know when that happens in case it needs my attention, such as when a test/build is finished.
The shell bell can be a nice way to achieve this. By having nvim-notify run tput bel
, we can get that effect
rcarriga commented
You can do this by using the on_open
in your setup
on_open = function()
vim.loop.spawn("tput", { args = { "bel" } })
end,
fent commented
Not sure why the above didn't work, but the following did
on_open = function()
if vim.fn.executable("tput") == 0 then
return
end
local dummy_bufnr = vim.api.nvim_create_buf(false, true)
vim.api.nvim_buf_call(dummy_bufnr, function()
vim.cmd.edit("term://tput bel")
vim.defer_fn(function()
vim.api.nvim_buf_delete(dummy_bufnr, { force = true })
end, 500)
end)
end,
It starts a terminal with the tput bel
command, then closes it in 500ms. There may be a better lua way to start the terminal than calling :edit