I was unhappy, personally, with the usage of window:toast_notification
inside of wezterm configs,
however not long ago, I stumbled across an absolutely lovely gist called toastify wezterm.
This however, came with new issues: Toastify Wezterm requires toastify. To work around this issue, I have created libnotify wezterm
, aka notify.lua
.
This module (Which, currently only has one function, pfft...) uses notify-send
(Installed on most distros by libnotify
) to send the notification. Please attribute credit to the original author of toastify wezterm!
A notification module for WezTerm using notify-send.
This module provides functionality to send notifications using the 'notify-send' command, which is available on most Linux distributions that implement the org.freedesktop.Notifications specification.
send (summary, body, expire, options)
Send a notification using 'notify-send'.
- summary : string The summary ('title') of the notification
- body : string|nil The body of the notification
- expire : number|nil The duration, in milliseconds, for the notification to appear on screen. Some implementations may ignore this.
- options : table|nil A table containing additional options. View notify-send manpage for more details.
local notify = require('notify')
notify.send("Hello", "World", 5000, {urgency = "normal"})
-- Pull WEZAPI
local wezterm = require 'wezterm'
local act = wezterm.action
-- Pull notify
local notify = require('notify')
wezterm.on('reload_kb', function(window, pane)
wezterm.reload_configuration()
notify.send("Config reloaded!", "Configuration has been reloaded.", 5000, {
urgency = "normal",
category = "device",
expire = 5000,
app_name = "Wezterm",
hint = "string:desktop-entry:org.wezfurlong.wezterm"
})
end)