Tuesday, 2 February 2021

Config Defaults Dunst

 

Geometry

You can choose the size of the notification window that Dunst displays. The configuration is a little strange. Take a look at the default, and break it down.
geometry = "300x5-30+20"
There are two basic parts here. The first one handles the overall dimensions. The second adjusts their position.

300x5 is the raw dimensions. They aren't exactly what you think, though. It's 300 pixels by 5 notifications. That means that the notifications will be a maximum of 300 pixels wide, and Dunst will stack up to 5 of them.

The next two values, -30+20 refer to the placement of the notification pop-up. The first value is the x and the second is the y. If the x value is positive, it will appear on the left side of the screen, and the value will determine how far from the left it will be. A negative value, like the one in the example, will appear on the right side of the screen, and the value will determine how far from the right it will appear.

The y value works the same way as the x but with the top and bottom of the screen. Since, this value is positive, it will be 20 pixels from the top.



Default Styling

There are a few options for setting up the default styling for your notification windows. Below are the defaults as they appear in the configuration. Feel free to change and experiment with them.
# Window Transparency
transparency = 0
# Height of separator between notifications
separator_height = 2
# Vertical padding
padding = 8
# Horizontal padding
horizontal_padding = 8
# Border width.  Set to 0 to disable
frame_width = 3
# Border color
frame_color = "#aaaaaa"
# Border color between notifications frame = same as above
separator_color = frame
If you're wondering about the background and text color, that's lower down.

Text

There are a lot of text options. The most important ones control the font and formatting of your notification message. First, tale a look at the font option. It's straightforward. Specify your font and the size.
font = Monospace 8

Dunst Configured Frame And Font

In formatting the actual output, Dunst uses a markup syntax from Pango. It's essentially HTML style text formatting blended with specific variables. The options are listed in the comments of the config file.
format = "<b>%s</b>\n%b"
In this instance, Dunst will display a summary of notification, denoted by the %s variable in bold. Then, on a new line(\n), it will show the body of the notification message. The full listing of variables appears right above this line in the default configuration.

Styling By Urgency

Lower down in the configuration, you'll find a series of blocks labelled for the urgency of the notification, like [urgency_low]. These let you style your notifications by urgency. This section fills in the gaps from the previous defaults. Each block looks like this:
[urgency_critical]
	background = "#000000"
	foreground = "#c61616"
	frame_color = "#c61616"
	timeout = 0

Dunst Completely Configured

You can set the background of the window and the text color, in the form of the foreground. You can also overwrite the frame color to match. The timeout value refers to how long the notification stays on the screen. The value of 0 means that it'll stay until it's dismissed.

Share:

0 comments:

Post a Comment