2023-09-05 18:21:26 +00:00
|
|
|
# config docs:
|
|
|
|
# - `man 5 mako`
|
2023-09-12 04:44:38 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
2023-09-05 18:21:26 +00:00
|
|
|
{
|
|
|
|
sane.programs.mako = {
|
2023-09-11 22:56:54 +00:00
|
|
|
# we control mako as a systemd service, so have dbus not automatically activate it.
|
2024-01-20 11:11:12 +00:00
|
|
|
packageUnwrapped = pkgs.rmDbusServices pkgs.mako;
|
2023-09-05 18:21:26 +00:00
|
|
|
fs.".config/mako/config".symlink.text = ''
|
|
|
|
# notification interaction mapping
|
|
|
|
# "on-touch" defaults to "dismiss", which isn't nice for touchscreens.
|
|
|
|
on-button-left=invoke-default-action
|
|
|
|
on-touch=invoke-default-action
|
|
|
|
on-button-middle=dismiss-group
|
|
|
|
|
|
|
|
max-visible=3
|
2023-09-06 00:57:47 +00:00
|
|
|
# layer:
|
|
|
|
# - overlay: shows notifs above all else, even full-screen windows
|
|
|
|
# - top: shows notifs above windows, but not if they're full-screen
|
|
|
|
# - bottom; background
|
|
|
|
layer=overlay
|
2023-09-05 18:21:26 +00:00
|
|
|
# notifications can be grouped by:
|
|
|
|
# - app-name
|
|
|
|
# - app-icon
|
|
|
|
# - summary
|
|
|
|
# - body
|
|
|
|
# possibly more: urgency, category, desktop-entry, ...
|
|
|
|
# to group by multiple fields, join with `,`
|
|
|
|
group-by=app-name
|
|
|
|
|
|
|
|
# BELOW IS SXMO DEFAULTS, modified very slightly.
|
|
|
|
# TODO: apply theme colors!
|
|
|
|
|
|
|
|
# default-timeout=15000
|
|
|
|
background-color=#ffffff
|
|
|
|
text-color=#000000
|
|
|
|
border-color=#000000
|
|
|
|
# group-by=app-name
|
|
|
|
|
|
|
|
[urgency=low]
|
|
|
|
# default-timeout=10000
|
|
|
|
background-color=#222222
|
|
|
|
text-color=#888888
|
|
|
|
|
|
|
|
[urgency=high]
|
|
|
|
default-timeout=0
|
|
|
|
background-color=#900000
|
|
|
|
text-color=#ffffff
|
|
|
|
background-color=#ff0000
|
|
|
|
'';
|
2023-09-06 00:57:47 +00:00
|
|
|
|
2023-09-12 04:44:38 +00:00
|
|
|
# mako supports activation via dbus (i.e. the daemon will be started on-demand when a
|
|
|
|
# dbus client tries to talk to it): that works out-of-the-box just by putting mako
|
|
|
|
# on environment.packages, but then logs are blackholed.
|
|
|
|
services.mako = {
|
|
|
|
description = "mako desktop notification daemon";
|
2024-02-02 14:21:57 +00:00
|
|
|
wantedBy = [ "graphical-session.target" ];
|
2023-09-12 04:44:38 +00:00
|
|
|
# XXX: should be part of graphical-session.target, but whatever mix of greetd/sway
|
|
|
|
# i'm using means that target's never reached...
|
2023-09-06 00:57:47 +00:00
|
|
|
|
2023-09-12 04:44:38 +00:00
|
|
|
serviceConfig.ExecStart = "${config.sane.programs.mako.package}/bin/mako";
|
|
|
|
serviceConfig.Type = "simple";
|
|
|
|
# mako will predictably fail if launched before the wayland server is fully initialized
|
|
|
|
serviceConfig.Restart = "on-failure";
|
|
|
|
serviceConfig.RestartSec = "10s";
|
|
|
|
};
|
2023-09-06 00:57:47 +00:00
|
|
|
};
|
2023-09-05 18:21:26 +00:00
|
|
|
}
|