1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 18:21:07 +01:00

dunst: add command to list recent notifications

This commit is contained in:
2024-05-08 06:37:17 +02:00
parent 4871d8d0d8
commit 527439cf9d

View File

@@ -4,7 +4,18 @@
...
}: let
inherit (import ../lib) defaultApplications theme;
sgr = code: string: ''\u001b[${code}m${string}\u001b[0m'';
in {
environment.systemPackages = [
(pkgs.writers.writeDashBin "notifications" ''
${pkgs.dunst}/bin/dunstctl history \
| ${pkgs.jq}/bin/jq -r '
.data[]
| map("${sgr "90" ''\(.appname.data)''} ${sgr "1" ''\(.summary.data)''} ${sgr "31" ''\(.body.data | gsub("\n"; " | "))''}")
| join("\n")'
'')
];
home-manager.users.me.services.dunst = {
enable = true;
iconTheme = (theme pkgs).icon;