Notifications
Hyprland has simple built-in notification system. Notifications are simple text boxes, with an optional icon, positioned in the top-right corner of the active monitor. They are not meant to handle your system notifications.
Parameters
| Name | Description | Type | Default | Limits |
|---|---|---|---|---|
| text | Text of the notification | str | [[Empty]] | |
| timeout | Timeout/duration in ms | int | [[Required]] | |
| icon | Icon type, see below | str | "none" | |
| color | Notification color. 0 means “default color for icon” | color | 0 | |
| font_size | Size of the font used to display the notification | int | 13 |
Icon
Icon can be one of the following, selected by either Lua name or hyprctl ID:
| Name | Lua name | hyprctl ID | Default color |
|---|---|---|---|
| None | none | -1 | #000000 |
| Warning | warn/warning | 0 | #FFCC66 |
| Info | info | 1 | #80FFFF |
| Hint | hint | 2 | #B3FFCC |
| Error | err/error | 3 | #FF4D4D |
| Confused | confused/question | 4 | #FFCC99 |
| Ok | ok | 5 | #80FF80 |
Creating a notification
Lua
-- Just push a notification
hl.notification.create({ text = "Hello from Lua!", timeout = 15000, icon = "info", font_size = 20 })
-- Assign "HL.Notification" object to "somevar" for later use and push the notification
local somevar = hl.notification.create({ text = "Please store me", timeout = 228638, icon = "hint" })
-- Get a table of all active notifications as "HL.Notification" objects
hl.notification.get()Hyprctl
To create a notification from hyprctl, you can use hyprctl notify command.
It takes the same information as hl.notification.create(), but in a slightly different format.
See more about it here.
Last updated on