desktop-notify.nvim
desktop-notify.nvim copied to clipboard
Support setting timeout
From notify-send --help:
Usage:
notify-send [OPTION…] <SUMMARY> [BODY] - create a notification
Help Options:
-?, --help Show help options
Application Options:
-u, --urgency=LEVEL Specifies the urgency level (low, normal, critical).
-t, --expire-time=TIME Specifies the timeout in milliseconds at which to expire the notification.
-a, --app-name=APP_NAME Specifies the app name for the icon
-i, --icon=ICON[,ICON...] Specifies an icon filename or stock icon to display.
-c, --category=TYPE[,TYPE...] Specifies the notification category.
-h, --hint=TYPE:NAME:VALUE Specifies basic extra data to pass. Valid types are int, double, string and byte.
-v, --version Version of the package.
For example:
return require('desktop-notify').notify("test", vim.log.levels.ERROR, { timeout = 10000 })
Although notify-send calls it expire-time, in my opinion timeout is preferable in order to keep the API compatible with rcarriga/nvim-notify.
As an extension to this suggestion, it would be nice to be able to set the other options accepted by notify-send like icon, category, hint, etc.
I concur, for instance I would like to set the icon to a neovim one.