mako Notification Daemon

repository·master·Indexed 25 days ago

https://github.com/emersion/mako

A lightweight notification daemon for Wayland, optimized for Sway and implementing the FreeDesktop Notifications Specification. Includes the makoctl utility for runtime control and supports configuration via CLI flags or a configuration file.

Tokens
1.6K
Snippets
2
Records
6
Agent score
35%

What's inside mako

  1. Build mako from source

    master

    To build mako, you must first install the required dependencies and then use the meson build system.

    Dependencies:

    • meson (build-time)
    • wayland
    • pango
    • cairo
    • systemd, elogind, or basu (for sd-bus library)
    • dbus (runtime, user-session support required)
    • gdk-pixbuf (optional, for icon support)
    • scdoc (optional, for man pages)

    Build steps:

    1. Setup the build directory with meson.
    2. Compile using ninja.
    3. Run the resulting binary.
    meson setup build
    ninja -C build
    build/mako
  2. Run mako notification daemon

    master

    mako is designed to run automatically via D-Bus activation when a notification is emitted. This allows for delayed startup and faster system boot times.

    If you have multiple notification daemons and want to ensure mako is used, you can start it explicitly:

    • Sway users: Add exec mako to your Sway configuration file.
    • Non-systemd users: You may need to manually start a dbus user session using: dbus-daemon --session --address=unix:path=$XDG_RUNTIME_DIR/bus.
  3. Reference mako CLI flags

    master

    The following command-line options are available for the mako daemon:

    -h, --help                          Show help message and quit.
      -c, --config <path>                 Path to config file.
          --font <font>                   Font family and size.
          --background-color <color>      Background color.
          --text-color <color>            Text color.
          --width <px>                    Notification width.
          --height <px>                   Max notification height.
          --outer-margin <px>[,<px>...]   Outer margin values, comma separated. Up to four values, with the same meaning as in CSS.
          --margin <px>[,<px>...]         Margin values, comma separated. Up to four values, with the same meaning as in CSS.
          --padding <px>[,<px>...]        Padding values, comma separated. Up to four values, with the same meaning as in CSS.
          --border-size <px>              Border size.
          --border-color <color>          Border color.
          --border-radius <px>[,<px>...]  Corner radius, comma separated. Up to four values, with the same meaning as in CSS.
          --progress-color <color>        Progress indicator color.
          --icons <0|1>                   Show icons in notifications.
          --icon-path <path>[:<path>...]  Icon search path, colon delimited.
          --max-icon-size <px>            Set max size of icons.
          --icon-border-radius <px>       Icon's corner radius.
          --markup <0|1>                  Enable/disable markup.
          --actions <0|1>                 Enable/disable application action execution.
          --format <format>               Format string.
          --hidden-format <format>        Format string.
          --max-visible <n>               Max number of visible notifications.
          --max-history <n>               Max size of history buffer.
          --history <0|1>                 Add expired notifications to history.
          --sort <sort_criteria>          Sorts incoming notifications by time and/or priority in ascending(+) or descending(-) order.
          --default-timeout <timeout>     Default timeout in milliseconds.
          --ignore-timeout <0|1>          Enable/disable notification timeout.
          --output <name>                 Show notifications on this output.
          --layer <layer>                 Arrange notifications at this layer.
          --anchor <position>             Position on output to put notifications.
  4. Run the mako daemon with CLI options

    master
    The mako executable is a daemon that manages and renders notifications on Wayland. You can start it from the command line and provide various configuration overrides via flags. Colors should be specified in #RRGGBB or #RRGGBBAA format.