1mako(5) 2 3# NAME 4 5mako - configuration file 6 7# DESCRIPTION 8 9The config file is located at *~/.config/mako/config* or at 10*$XDG\_CONFIG\_HOME/mako/config*. Option lines can be specified to configure 11mako like so: 12 13 key=value 14 15Empty lines and lines that begin with # are ignored. 16 17# GLOBAL CONFIGURATION OPTIONS 18 19*max-history*=_n_ 20 Set maximum number of expired notifications to keep in the history 21 buffer to _n_. If the buffer is full, newly expired notifications 22 replace the oldest ones. If 0, history is disabled. 23 24 Default: 5 25 26*sort*=_+/-time_ | _+/-priority_ 27 Sorts incoming notifications by time and/or priority in ascending(+) 28 or descending(-) order. 29 30 Default: -time 31 32# BINDING OPTIONS 33 34Bindings allow to perform an action when an event is triggered. Supported 35values are _none_, _dismiss_, _dismiss-all_, _dismiss-group_, 36_invoke-default-action_ and _exec <command>_. 37 38*on-button-left*=_action_ 39 Default: invoke-default-action 40 41*on-button-middle*=_action_ 42 Default: none 43 44*on-button-right*=_action_ 45 Default: dismiss 46 47*on-touch*=_action_ 48 Default: dismiss 49 50*on-notify* = _action_ 51 Default: none 52 53When _exec_ is used, the command will be executed in a POSIX shell. The 54shell variable _id_ will be set to the notification ID. For example, the 55following option will display an interactive action menu on middle click: 56 57``` 58on-button-middle=exec makoctl menu -n "$id" dmenu -p 'Select action: ' 59``` 60 61The following option will play a sound when a new notification is opened: 62 63``` 64on-notify=exec mpv /usr/local/share/sounds/freedesktop/stereo/message.oga 65``` 66 67# STYLE OPTIONS 68 69*font*=_font_ 70 Set font to _font_, in Pango format. 71 72 Default: monospace 10 73 74*background-color*=_color_ 75 Set background color to _color_. See *COLORS* for more information. 76 77 Default: #285577FF 78 79*text-color*=_color_ 80 Set text color to _color_. See *COLORS* for more information. 81 82 Default: #FFFFFFFF 83 84*width*=_px_ 85 Set width of notification popups. 86 87 Default: 300 88 89*height*=_px_ 90 Set maximum height of notification popups. Notifications whose text takes 91 up less space are shrunk to fit. 92 93 Default: 100 94 95*margin*=_directional_ 96 Set margin of each edge to the size specified by _directional_. See 97 *DIRECTIONAL VALUES* for more information. 98 99 Default: 10 100 101*padding*=_directional_ 102 Set padding on each side to the size specified by _directional_. See 103 *DIRECTIONAL VALUES* for more information. 104 105 Default: 5 106 107*border-size*=_px_ 108 Set popup border size to _px_ pixels. 109 110 Default: 2 111 112*border-color*=_color_ 113 Set popup border color to _color_. See *COLORS* for more information. 114 115 Default: #4C7899FF 116 117*border-radius*=_px_ 118 Set popup corner radius to _px_ pixels. 119 120 Default: 0 121 122*progress-color*=[over|source] _color_ 123 Set popup progress indicator color to _color_. See *COLOR* for more 124 information. To draw the progress indicator on top of the background 125 color, use the *over* attribute. To replace the background color, use 126 the *source* attribute (this can be useful when the notification is 127 semi-transparent). 128 129 Progress can be indicated in a notification by setting a hint, "value" 130 to an integer between 0 and 100 inclusive. 131 132 Default: over #5588AAFF 133 134*icons*=0|1 135 Show icons in notifications. 136 137 Default: 1 138 139*max-icon-size*=_px_ 140 Set maximum icon size to _px_ pixels. 141 142 Default: 64 143 144*icon-path*=_path_\[:_path_...\] 145 Paths to search for icons when a notification specifies a name instead 146 of a full path. Colon-delimited. This approximates the search algorithm 147 used by the XDG Icon Theme Specification, but does not support any of 148 the theme metadata. Therefore, if you want to search parent themes, 149 you'll need to add them to the path manually. 150 151 The path should be the root of the icon theme, the categories and 152 resolutions will be searched for the most appropriate match. 153 154 /usr/local/share/icons/hicolor and /usr/local/share/pixmaps are always searched. 155 156 Default: "" 157 158*icon-location*=_position_ 159 Position of the icon relative to the displayed text. Valid options are 160 _left_, _right_, _top_ and _bottom_. 161 162 Default: left 163 164*markup*=0|1 165 If 1, enable Pango markup. If 0, disable Pango markup. If enabled, Pango 166 markup will be interpreted in your format specifier and in the body of 167 notifications. 168 169 Default: 1 170 171*actions*=0|1 172 Applications may request an action to be associated with activating a 173 notification. Disabling this will cause mako to ignore these requests. 174 175 Default: 1 176 177*history*=0|1 178 If set, mako will save notifications that have reached their timeout 179 into the history buffer instead of immediately deleting them. 180 _max-history_ determines the size of the history buffer. 181 182 Default: 1 183 184*format*=_format_ 185 Set notification format string to _format_. See *FORMAT SPECIFIERS* for 186 more information. To change this for grouped notifications, set it within 187 a _grouped_ criteria. 188 189 Default: <b>%s</b>\\n%b++ 190Default when grouped: (%g) <b>%s</b>\\n%b 191 192*text-alignment*=left|center|right 193 Set notification text alignment. 194 195 Default: left 196 197*default-timeout*=_timeout_ 198 Set the default timeout to _timeout_ in milliseconds. To disable the 199 timeout, set it to zero. 200 201 Default: 0 202 203*ignore-timeout*=0|1 204 If set, mako will ignore the expire timeout sent by notifications and use 205 the one provided by _default-timeout_ instead. 206 207 Default: 0 208 209*group-by*=_field[,field,...]_ 210 A comma-separated list of criteria fields that will be compared to other 211 visible notifications to determine if this one should form a group with 212 them. All listed criteria must be exactly equal for two notifications to 213 group. 214 215 Default: none 216 217*max-visible*=_n_ 218 Set maximum number of visible notifications to _n_. Older notifications will 219 be hidden. If -1, all notifications are visible. 220 221 Default: 5 222 223*output*=_name_ 224 Show notifications on the specified output. If empty, notifications will 225 appear on the focused output. 226 227 Requires the compositor to support the Wayland protocol 228 xdg-output-unstable-v1 version 2. 229 230 Default: "" 231 232*layer*=_layer_ 233 Arrange mako at the specified layer, relative to normal windows. Supported 234 values are _background_, _bottom_, _top_, and _overlay_. Using _overlay_ 235 will cause notifications to be displayed above fullscreen windows, though 236 this may also occur at _top_ depending on your compositor. 237 238 Default: top 239 240*anchor*=_position_ 241 Show notifications at the specified position on the output. Supported values 242 are _top-right_, _top-center_, _top-left_, _bottom-right_, _bottom-center_, 243 _bottom-left_, _center-right_, _center-left_ and _center_. 244 245 Default: top-right 246 247# CRITERIA 248 249In addition to the set of options at the top of the file, the config file may 250contain zero or more sections, each containing any combination of the 251*BINDING OPTIONS* and *STYLE OPTIONS*. The sections, called criteria, are 252defined with an INI-like square bracket syntax. The brackets may contain any 253number of fields, like so: 254 255 \[field=value field2=value2 ...\] 256 257When a notification is received, it will be compared to the fields defined in 258each criteria. If all of the fields match, the style options within will be 259applied to the notification. Fields not included in the criteria are not 260considered during the match. A notification may match any number of criteria. 261This matching occurs in the order the criteria are defined in the config file, 262meaning that if multiple criteria match a notification, the last occurrence of 263any given style option will "win". 264 265The following fields are available in criteria: 266 267- _app-name_ (string) 268- _app-icon_ (string) 269- _summary_ (string) 270 - An exact match on the summary of the notification. 271 - This field conflicts with _summary~_. 272- _summary~_ (string) 273 - A POSIX extended regular expression match on the summary of the 274 notification. 275 - This field conflicts with _summary_. 276- _body_ (string) 277 - An exact match on the body of the notification. 278 - This field conflicts with _body~_. 279- _body~_ (string) 280 - A POSIX extended regular expression match on the body of the 281 notification. 282 - This field conflicts with _body_. 283- _urgency_ (one of "low", "normal", "critical") 284- _category_ (string) 285- _desktop-entry_ (string) 286- _actionable_ (boolean) 287- _expiring_ (boolean) 288- _mode_ (string) 289 - Only apply style options in this section if the provided mode is 290 currently enabled. For more information about modes, see the _MODES_ 291 section. 292 293The following fields are also available to match on a second pass based on 294where previous style options decided to place each notification: 295 296- _grouped_ (boolean) 297 - Whether the notification is grouped with any others (its group-index is 298 not -1). 299- _group-index_ (int) 300 - The notification's index within its group, or -1 if it is not grouped. 301- _hidden_ (boolean) 302 - _hidden_ is special, it defines the style for the placeholder shown when 303 the number of notifications or groups exceeds _max-visible_. 304- _output_ (string) 305 - Which output the notification was sorted onto. See the output style 306 option for possible values. 307- _anchor_ (string) 308 - Which position on the output the notification was assigned to. See the 309 anchor style option for possible values. 310 311There are only two passes performed on each notification, so the second-pass 312critera are not allowed to reposition the notification. 313 314If a field's value contains special characters, they may be escaped with a 315backslash, or quoted: 316 317 \[app-name="Google Chrome"\] 318 319 \[app-name=Google\\ Chrome\] 320 321Quotes within quotes may also be escaped, and a literal backslash may be 322specified as \\\\. No spaces are allowed around the equal sign. Escaping equal 323signs within values is unnecessary. 324 325Additionally, boolean values may be specified using any of true/false, 0/1, or 326as bare words: 327 328 \[actionable=true\] \[actionable=1\] \[actionable\] 329 330 \[actionable=false\] \[actionable=0\] \[!actionable\] 331 332There are three criteria always present at the front of the list: 333- An empty criteria which matches all notifications and contains the defaults 334 for all style options, overwritten with any configured in the global section. 335- \[grouped\], which sets the default *format* for grouped notifications and 336 sets them *invisible*. 337- \[group-index=0\], which makes the first member of each group visible again. 338 339These options can be overridden by simply defining the criteria yourself and 340overriding them. 341 342There are some rules restricting what can be configured depending on what is 343being matched by a given criteria: 344 345- Criteria matching _grouped_ or _group-index_ are not allowed to change the 346 _anchor_, _output_, or _group-by_, as this would invalidate the grouping. 347 Grouping is only performed once rather than recursively, to avoid the 348 potential for infinite loops. 349 350# CRITERIA-ONLY STYLE OPTIONS 351 352Some style options are not useful in the global context and therefore have no 353associated command-line option. 354 355*invisible*=0|1 356 Whether this notification should be invisible even if it is above the 357 _max-visible_ cutoff. This is used primarily for hiding members of groups. 358 If you want to make more than the first group member visible, turn this 359 option off within a _group-index_ criteria. 360 361 Default: 0 362 363# COLORS 364 365Colors can be specified as _#RRGGBB_ or _#RRGGBBAA_. 366 367# DIRECTIONAL VALUES 368 369Some options set values that affect all four edges of a notification. These 370options can be specified in several different ways, depending on how much 371control over each edge is desired: 372 373- A single value will apply to all four edges. 374- Two values will set vertical and horizontal edges separately. 375- Three will set top, horizontal, and bottom edges separately. 376- Four will give each edge a separate value. 377 378When specifying multiple values, they should be comma-separated. For example, 379this would set the top margin to 10, left and right to 20, and bottom to five: 380 381``` 382margin = 10,20,5 383``` 384 385# FORMAT SPECIFIERS 386 387Format specification works similarly to *printf*(3), but with a different set of 388specifiers. 389 390*%%* Literal "%" 391 392*\\\\* Literal "\\" 393 394*\\n* New Line 395 396## For notifications 397 398*%a* Application name 399 400*%s* Notification summary 401 402*%b* Notification body 403 404*%g* Number of notifications in the current group 405 406## For the hidden notifications placeholder 407 408*%h* Number of hidden notifications 409 410*%t* Total number of notifications 411 412# MODES 413 414mako supports applying style options conditionally via modes. A configuration 415section with a _mode_ criteria will only be applied if the current mode 416matches. **makoctl**(1) can be used to change the current mode. 417 418The default mode is named "default". 419 420For example, to hide all notifications if the mode "do-not-disturb" is 421enabled: 422 423``` 424[mode=do-not-disturb] 425invisible=1 426``` 427 428_makoctl set-mode do-not-disturb_ will hide all notifications, 429_makoctl set-mode default_ will show them again. 430 431# AUTHORS 432 433Maintained by Simon Ser <contact@emersion.fr>, who is assisted by other 434open-source contributors. For more information about mako development, see 435https://github.com/emersion/mako. 436 437# SEE ALSO 438 439*mako*(1) *makoctl*(1) 440