From c644cb018f9fdec55f5ac2afb4713a8c7beb757c Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Fri, 24 Oct 2025 12:50:04 +0100 Subject: [PATCH] lorri: better notifications - They disappear automatically in GNOME. - They display an icon indicating the status. - The app name is "Lorri". @moduon MT-1075 --- modules/services/lorri.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/services/lorri.nix b/modules/services/lorri.nix index 4c3b4051a..a2a0f40a0 100644 --- a/modules/services/lorri.nix +++ b/modules/services/lorri.nix @@ -104,16 +104,20 @@ in let jqFile = '' ( - (.Started? | values | "Build starting in \(.nix_file)"), - (.Completed? | values | "Build complete in \(.nix_file)"), - (.Failure? | values | "Build failed in \(.nix_file)") + (.Started? | values | ["Build starting", .nix_file, "emblem-synchronizing"]), + (.Completed? | values | ["Build complete", .nix_file, "checkmark"]), + (.Failure? | values | ["Build failed", .nix_file, "dialog-error"]) ) + | @tsv ''; notifyScript = pkgs.writeShellScript "lorri-notify" '' lorri internal stream-events --kind live \ - | jq --unbuffered '${jqFile}' \ - | xargs -n 1 notify-send "Lorri Build" + | jq --unbuffered -r '${jqFile}' \ + | while IFS=$'\t' read -r status nixFile icon; do + notify-send --app-name "Lorri" --hint=int:transient:1 \ + --icon "$icon" "$status" "$nixFile" + done ''; in toString notifyScript; @@ -125,7 +129,6 @@ in [ bash jq - findutils libnotify cfg.package ]