aboutsummaryrefslogtreecommitdiff
path: root/lua/plugins/notify.lua
diff options
context:
space:
mode:
authorsrdusr <trevorgray@srdusr.com>2025-09-24 00:14:04 +0200
committersrdusr <trevorgray@srdusr.com>2025-09-24 00:14:04 +0200
commit966d12ac730c83da90d60ab24eae539b2ea69441 (patch)
tree702f5f832796b572d0faee31c0eb15507e91f49a /lua/plugins/notify.lua
parent2a8020a2e9b7ef2ee77ddee14892127a4eb95187 (diff)
downloaddotfiles-966d12ac730c83da90d60ab24eae539b2ea69441.tar.gz
dotfiles-966d12ac730c83da90d60ab24eae539b2ea69441.zip
Update/Overhaul
Diffstat (limited to 'lua/plugins/notify.lua')
-rwxr-xr-x[-rw-r--r--]lua/plugins/notify.lua52
1 files changed, 35 insertions, 17 deletions
diff --git a/lua/plugins/notify.lua b/lua/plugins/notify.lua
index dcb496a..62a8f47 100644..100755
--- a/lua/plugins/notify.lua
+++ b/lua/plugins/notify.lua
@@ -1,18 +1,36 @@
-require('notify').setup({
- background_colour = '#000000',
- icons = {
- ERROR = '',
- WARN = '',
- INFO = '',
- DEBUG = '',
- TRACE = '✎',
- },
-})
+local M = {}
-vim.api.nvim_command('hi default link NotifyERRORBody Normal')
-vim.api.nvim_command('hi default link NotifyWARNBody Normal')
-vim.api.nvim_command('hi default link NotifyINFOBody Normal')
-vim.api.nvim_command('hi default link NotifyDEBUGBody Normal')
-vim.api.nvim_command('hi default link NotifyTRACEBody Normal')
-vim.api.nvim_command('hi default link NotifyLogTime Comment')
-vim.api.nvim_command('hi default link NotifyLogTitle Special')
+function M.setup()
+ local ok, notify = pcall(require, 'notify')
+ if not ok or not notify then
+ return false
+ end
+
+ notify.setup({
+ background_colour = '#000000',
+ icons = {
+ ERROR = '',
+ WARN = '',
+ INFO = '',
+ DEBUG = '',
+ TRACE = '✎',
+ }
+ })
+
+ -- Set highlight groups safely
+ local function set_hl(group, link)
+ vim.cmd(('hi default link %s %s'):format(group, link))
+ end
+
+ set_hl('NotifyERRORBody', 'Normal')
+ set_hl('NotifyWARNBody', 'Normal')
+ set_hl('NotifyINFOBody', 'Normal')
+ set_hl('NotifyDEBUGBody', 'Normal')
+ set_hl('NotifyTRACEBody', 'Normal')
+ set_hl('NotifyLogTime', 'Comment')
+ set_hl('NotifyLogTitle', 'Special')
+
+ return true
+end
+
+return M