flakes/modules/user/dunst.nix

72 lines
2 KiB
Nix
Raw Permalink Normal View History

2021-11-15 20:35:31 +07:00
{ config, pkgs, ... }:
let
historyScript = pkgs.writeShellScript "dunst_history.sh" ''
echo "$(${pkgs.coreutils}/bin/date +%s):$DUNST_TIMESTAMP:$DUNST_APP_NAME:$DUNST_URGENCY:$DUNST_SUMMARY:$DUNST_BODY" >> ${config.xdg.dataHome}/dunst/history
2021-11-15 20:35:31 +07:00
'';
in {
systemd.user.tmpfiles.rules = [ "d ${config.xdg.dataHome}/dunst - - - -" ];
services.dunst = {
enable = true;
settings = {
global = {
monitor = 0;
follow = "mouse";
2025-03-17 00:22:43 +11:00
width = "(100, 450)";
2021-11-15 20:35:31 +07:00
origin = "top-right";
2025-03-17 00:22:43 +11:00
offset = "24x50";
2021-11-15 20:35:31 +07:00
notification_limit = 0;
indicate_hidden = true;
shrink = true;
separator_height = 0;
padding = 16;
horizontal_padding = 24;
2021-11-15 20:35:31 +07:00
frame_width = 0;
sort = false;
2021-11-15 20:35:31 +07:00
idle_threshold = 60;
font = "Open Sans 9";
line_height = 4;
markup = "full";
format = "<b>%s</b>\\n%b";
alignment = "left";
show_age_threshold = 60;
word_wrap = true;
ignore_newline = false;
stack_duplicates = false;
hide_duplicate_count = true;
show_indicators = false;
icon_position = "left";
2025-03-17 00:22:43 +11:00
max_icon_size = 40;
sticky_history = true;
2021-11-15 20:35:31 +07:00
history_length = 100;
browser = "${pkgs.firefox}/bin/firefox -new-tab";
always_run_script = true;
title = "Dunst";
class = "Dunst";
2021-11-18 22:59:43 +07:00
corner_radius = 15;
2021-11-15 20:35:31 +07:00
script = historyScript.outPath;
};
urgency_low = {
background = config.catppuccin.hexcolors.crust;
2025-03-17 00:06:11 +11:00
foreground = config.catppuccin.hexcolors.text;
2021-11-15 20:35:31 +07:00
timeout = 3;
};
urgency_normal = {
background = config.catppuccin.hexcolors.crust;
2025-03-17 00:06:11 +11:00
foreground = config.catppuccin.hexcolors.text;
2021-11-15 20:35:31 +07:00
timeout = 5;
};
urgency_critical = {
background = config.catppuccin.hexcolors.crust;
2025-03-17 00:06:11 +11:00
foreground = config.catppuccin.hexcolors.text;
frame_color = config.catppuccin.hexcolors.red;
timeout = 0;
};
};
};
}