feat: silent errors from setting kitty padding

This commit is contained in:
Youwen Wu 2024-12-30 14:42:29 -08:00
parent 286eb3cc63
commit c631eab667
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
3 changed files with 14 additions and 5 deletions

View file

@ -1,3 +1,8 @@
if os.getenv("TERM") == "xterm-kitty" then
require("scripts.chameleon").setup()
require("scripts.kitty-padding").setup()
end
require("keymaps") require("keymaps")
require("plugins") require("plugins")
require("scripts.obsidian-sync") require("scripts.obsidian-sync")

View file

@ -21,7 +21,10 @@ local get_kitty_background = function()
end, end,
on_stderr = function(_, d, _) on_stderr = function(_, d, _)
if #d > 1 then if #d > 1 then
api.nvim_err_writeln("Chameleon.nvim: Error getting background. Make sure kitty remote control is turned on.") vim.notify(
"Chameleon.nvim: Error getting background. Make sure kitty remote control is turned on.",
vim.log.levels.DEBUG
)
end end
end, end,
}) })
@ -35,8 +38,9 @@ local change_background = function(color, sync)
fn.jobstart(command, { fn.jobstart(command, {
on_stderr = function(_, d, _) on_stderr = function(_, d, _)
if #d > 1 then if #d > 1 then
api.nvim_err_writeln( vim.notify(
"Chameleon.nvim: Error changing background. Make sure kitty remote control is turned on." "Chameleon.nvim: Error changing background. Make sure kitty remote control is turned on.",
vim.log.levels.DEBUG
) )
end end
end, end,

View file

@ -14,7 +14,7 @@ local no_padding = function(sync)
fn.jobstart(command, { fn.jobstart(command, {
on_stderr = function(_, d, _) on_stderr = function(_, d, _)
if #d > 1 then if #d > 1 then
api.nvim_err_writeln("Error setting window padding. Make sure kitty remote control is turned on.") vim.notify("Error setting window padding. Make sure kitty remote control is turned on.", vim.log.levels.DEBUG)
end end
end, end,
}) })
@ -29,7 +29,7 @@ local restore_padding = function(sync)
fn.jobstart(command, { fn.jobstart(command, {
on_stderr = function(_, d, _) on_stderr = function(_, d, _)
if #d > 1 then if #d > 1 then
api.nvim_err_writeln("Error setting window padding. Make sure kitty remote control is turned on.") vim.notify("Error setting window padding. Make sure kitty remote control is turned on.", vim.log.levels.DEBUG)
end end
end, end,
}) })