diff --git a/init.lua b/init.lua index 74516ec..018e443 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,8 @@ +if os.getenv("TERM") == "xterm-kitty" then + require("scripts.chameleon").setup() + require("scripts.kitty-padding").setup() +end + require("keymaps") require("plugins") require("scripts.obsidian-sync") diff --git a/lua/scripts/chameleon.lua b/lua/scripts/chameleon.lua index ab7a8e0..c3516b0 100644 --- a/lua/scripts/chameleon.lua +++ b/lua/scripts/chameleon.lua @@ -21,7 +21,10 @@ local get_kitty_background = function() end, on_stderr = function(_, d, _) 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, }) @@ -35,8 +38,9 @@ local change_background = function(color, sync) fn.jobstart(command, { on_stderr = function(_, d, _) if #d > 1 then - api.nvim_err_writeln( - "Chameleon.nvim: Error changing background. Make sure kitty remote control is turned on." + vim.notify( + "Chameleon.nvim: Error changing background. Make sure kitty remote control is turned on.", + vim.log.levels.DEBUG ) end end, diff --git a/lua/scripts/kitty-padding.lua b/lua/scripts/kitty-padding.lua index 6961fc7..cc1d24a 100644 --- a/lua/scripts/kitty-padding.lua +++ b/lua/scripts/kitty-padding.lua @@ -14,7 +14,7 @@ local no_padding = function(sync) fn.jobstart(command, { on_stderr = function(_, d, _) 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, }) @@ -29,7 +29,7 @@ local restore_padding = function(sync) fn.jobstart(command, { on_stderr = function(_, d, _) 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, })