From 3787a37197ebbcc95cdb7a8175090000bb56e881 Mon Sep 17 00:00:00 2001 From: niten Date: Mon, 22 May 2023 12:48:43 -0700 Subject: [PATCH] Update dependency on notifier --- deps.edn | 5 +++-- flake.lock | 14 +++++++------- src/tattler/core.clj | 11 ++++++----- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/deps.edn b/deps.edn index 66fdb7e..c26ae7f 100644 --- a/deps.edn +++ b/deps.edn @@ -5,8 +5,9 @@ org.clojure/tools.cli {:mvn/version "1.0.214"} metosin/malli { :mvn/version "0.11.0" } org.fudo/notifier { - :git/url "https://git.fudo.org/fudo-public/notifier.git" - :git/sha "bda18253fc5f736a3bec36ac9f36ff49e03538e0" + :local/root "/nix/store/qqfnbwp1vg3r0ni2sj096pas67drx45l-org.fudo-notifier-0.1.jar" + ; :git/url "https://git.fudo.org/fudo-public/notifier.git" + ; :git/sha "bda18253fc5f736a3bec36ac9f36ff49e03538e0" } org.fudo/fudo-clojure { :git/url "https://git.fudo.org/fudo-public/fudo-clojure.git" diff --git a/flake.lock b/flake.lock index e5e16dc..729231f 100644 --- a/flake.lock +++ b/flake.lock @@ -271,11 +271,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1684398685, - "narHash": "sha256-TRE62m91iZ5ArVMgA+uj22Yda8JoQuuhc9uwZ+NoX+0=", + "lastModified": 1684580438, + "narHash": "sha256-LUPswmDn6fXP3lEBJFA2Id8PkcYDgzUilevWackYVvQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "628d4bb6e9f4f0c30cfd9b23d3c1cdcec9d3cb5c", + "rev": "7dc71aef32e8faf065cb171700792cf8a65c152d", "type": "github" }, "original": { @@ -308,11 +308,11 @@ "utils": "utils_5" }, "locked": { - "lastModified": 1684439408, - "narHash": "sha256-bwDKPzgkjYj7nYgdvKSy3QmbL/fbVQI1A4LxA6JL7Gw=", + "lastModified": 1684784801, + "narHash": "sha256-7d8blW6tVHMTdgAQB2Dh470XsvWbD5gICwgXrS/90Xg=", "ref": "refs/heads/master", - "rev": "8a26333322a180bf62e7aed01e6d19d748c225d7", - "revCount": 8, + "rev": "6ff2823f55812d527ce6fd022caf78a438afb371", + "revCount": 9, "type": "git", "url": "https://git.fudo.org/fudo-public/notifier.git" }, diff --git a/src/tattler/core.clj b/src/tattler/core.clj index a12d30d..05d8991 100644 --- a/src/tattler/core.clj +++ b/src/tattler/core.clj @@ -29,17 +29,18 @@ topic :topic logger :logger urgency-threshold :urgency-threshold}] - (let [note-chan (mqtt/subscribe! mqtt-client topic)] + (let [note-chan (mqtt/subscribe! mqtt-client topic) + bus (notify/connect-session-bus)] (go-loop [note-msg (= (:urgency note) urgency-threshold) (do (log/info! logger (format "notification: %s" (:summary note))) - (notify/send-notification! mqtt-client - (-> note - (assoc :app app) - (update :urgency codify-urgency)))) + (notify/send-notification! bus + (-> note + (assoc :app app) + (update :urgency codify-urgency)))) (log/info! logger (format "ignoring low-urgency message (%s < %s): %s" (:urgency note) urgency-threshold