feat(desktop): add mako notifications (task 0025)
Add a mako notification daemon module to the desktop group, enabled by the aggregator. Toasts auto-dismiss into history after five seconds, a do-not-disturb mode ([mode=dnd] invisible=true) suppresses display while still recording to history, and Super+N recalls the last notification via makoctl restore. Colors and the popup font come from Stylix's mako target. The bar-side do-not-disturb toggle and media controls already live in waybar.nix, so this task adds only the daemon.
This commit was merged in pull request #17.
This commit is contained in:
@@ -11,6 +11,7 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
modules.desktop.hyprland.enable = lib.mkDefault true;
|
||||
modules.desktop.login.enable = lib.mkDefault true;
|
||||
modules.desktop.mako.enable = lib.mkDefault true;
|
||||
modules.desktop.rofi.enable = lib.mkDefault true;
|
||||
modules.desktop.terminal.enable = lib.mkDefault true;
|
||||
modules.desktop.theming.enable = lib.mkDefault true;
|
||||
|
||||
44
modules/desktop/mako.nix
Normal file
44
modules/desktop/mako.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
# mako as the notification daemon: toasts, a do-not-disturb mode, and history recall.
|
||||
let
|
||||
cfg = config.modules.desktop.mako;
|
||||
user = config.user.name;
|
||||
|
||||
makoctl = "${pkgs.mako}/bin/makoctl";
|
||||
in
|
||||
{
|
||||
options.modules.desktop.mako.enable = lib.mkEnableOption "the mako notification daemon";
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home-manager.users.${user} = {
|
||||
# Colors and the popup font come from Stylix's mako target, so only
|
||||
# behaviour is set here.
|
||||
services.mako = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
# Toasts auto-dismiss into history rather than lingering.
|
||||
# mako's own default of 0 leaves every notification on screen until acted on.
|
||||
default-timeout = 5000;
|
||||
|
||||
# The do-not-disturb mode.
|
||||
# Invisible hides the toasts but still records them to history.
|
||||
# Missed notifications can therefore be recalled.
|
||||
"mode=dnd".invisible = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Recall the last notification from history, keyboard-only like the rest
|
||||
# of the session.
|
||||
# $mod is defined by the compositor config these binds share.
|
||||
wayland.windowManager.hyprland.settings.bind = [
|
||||
"$mod, N, exec, ${makoctl} restore"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user