Display Configuration

The display section allows you to customize the visual aspects of notifications.

Property nameDescriptionTypeDefault value
paddingSpacing from the banner's edge to inner contentu8 or [u8; 1..4] or Spacing0
marginSpacing from the banner's edge to inner contentu8 or [u8; 1..4] or Spacing0
imageImage propertiesImage-
iconsIcons propertiesIcons-
borderBorder propertiesBorder-
textText properties (alias for title and body)Text-
titleTitle text propertiesText-
bodyBody text propertiesText-
markupEnables HTML markupbooltrue
timeoutBanner timeoutu16 or Timeout0
layoutCustom layout pathPath"default"
themeTheme nameString-

Padding & Margin

In this application, padding and margin control spacing in different ways:

  • Padding: The space between an element's content (like text or an image) and its edges. It reduces the area available for the content inside the element.
  • Margin: The space between an element's outer edges and other surrounding elements. It separates elements from each other.

Declaring Padding and Margin Properties

CSS-like

If you familiar with CSS, you know that the padding or the margin can be applied in single row, in the TOML config file you can do it using array:

# Applies vertical and horizontal paddings respectively
padding = [0, 5]

# Applies top, horizontal and bottom paddings respectively
margin = [3, 2, 5]

# Applies top, right, bottom, left paddings respectively
padding = [1, 2, 3, 4]

# For all-directional padding or margin
padding = 10
margin = 5

Explicit

If you prefer a more detailed approach, you can use an explicit syntax with Spacing table:

KeyShort descriptionType
topSpacing from topu8
rightSpacing from rightu8
bottomSpacing from bottomu8
leftSpacing from leftu8
verticalSpacing from top and bottom togetheru8
horizontalSpacing from left and right togetheru8
# Sets only top padding
padding = { top = 3 }

# Sets only top and right padding
padding = { top = 5, right = 6 }

# Instead of
# padding = { top = 5, right = 6, bottom = 5 }
# You can write
padding = { vertical = 5, right = 6 }

# Conflicting values will result in an error due to ambiguity:
# padding = { top = 5, vertical = 6 } --- ERROR

# You can apply the same way for margin
margin = { top = 5, horizontal = 10 }

# For all-directional padding or margin
padding = 10
margin = 5

Warning:

  • horizontal is incompatible with left or right keys
  • vertical is incompatible with top or bottom keys

If content (like an image or text) isn't displaying correctly in a banner, check the padding or margin. Excessive padding or margin can reduce the space for content, causing it to overflow or not fit properly.

Image

Typically, the notification includes an image or icon, which is displayed on the left side of the banner.

Here's a table of Image properties:

Property nameDescriptionTypeDefault value
max_sizeSets the max size for image and resizes it when width or height of image exceeds this valueu1664
roundingValue used to round image cornersu160
marginSpacing around image. If there is no space for image, the image will be squished.u8 or [u8; 1..4] or Spacing0
resizing_methodResizing method for image when it exceeds max_size. Possible values: "gaussian", "nearest", "triandle", "catmull-rom", "lanczos3"String"gaussian"
[display.image]
max_size = 32
rounding = 10

Icons

If application doesn't provide any image but app-icon, then it will be treated as image.

The Icons table:

Property nameDescriptionTypeDefault value
themeIcon theme like Adwaita, Papirus...Strng"Adwaita"
sizeConcrete sizes of the icon. Will be picked the first one which found in system resources. Ordering matters - searches from first to last.[u16; 1..][64, 32]
[display.icons]
theme = "Papirus"
size = [64, 32, 16]

Note: Since app-icon threated as image, the image properties will be applied to icon, even the max_size.

Border

You can customize the notification banner with border styles, including border size and border radius:

  • Border size: The width of the border around the banner, which also reduces the inner space.
  • Border radius: How rounded the corners of the banner are.

The Border table:

KeyShort descriptionTypeDefault value
sizeWidth of stroke which is outlines around the banneru80
radiusBorder radius for corner roundingu80
[display.border]
size = 2
radius = 12
margin = { right = 15 }

Note: If the border size is larger than the radius, the inner corners won’t be rounded.

Text

The application has title and body properties, both treated as Text. A new text property can be used for both the title and body at once. Use text when the same value applies to both, or set them separately if needed.

The Text table:

KeyShort descriptionTypeDefault value
wrapSets possibility to line breaking when text overflows a linebooltrue
ellipsize_atEllipsizes a text if it's totally overflows an area. Possible values: "end" and "middle". "end" - put ellipsis at end of word, "middle" - cut word at some middle of word and puts ellipsisString"end"
styleFont style. Possible values: "regular", "bold", "italic", "bold italic"String"regular"
marginText spacing from edges of remaining areaSpacing0
justificationText justification. Possible values: "left", "right", "center", "space-between"String"left"
line_spacingGap between wrapped text lines in pxu80
font_sizeFont size in pxu812
[display.text]
justification = "left"
wrap = false
ellipsize_at = "middle"
font_size = 18

[display.title]
style = "bold"

Property priority:

  1. Use title or body first.
  2. If missing, use the text property.
  3. If still missing, default values apply.

Markup

Enables text styling through HTML tags.

For the body, the markup property is applied, allowing the use of HTML-like tags, such as:

  • <b> - bold style
  • <i> - italic style
  • <u> - underline style
  • <a href="https://google.com"> - a hyperlink
  • <img src="path/to/image" alt="image description"> - an image embedded in the text

You can disable the markup property by setting it to false.

markup = false

Timeout

The time in milliseconds after which the notification banner will automatically close due to expiration, starting from when it is created.

Additionally, there is an extended timeout configuration based on the urgency of the banners, defined in the Timeout table.

The Timeout table:

KeyShort descriptionType
defaultSet default timeout for all urgencyu16
lowOverride timeout value for 'low' urgency bannersu16
normalOverride timeout value for 'normal' urgency bannersu16
criticalOverride timeout value for 'critical' urgency bannersu16
timeout = 5000

# or

[display.timeout]
default = 5000
critical = 0

Note: The value 0 means will never expired.