From 28db7c76e26c312918959384e02e433f8858de49 Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Wed, 8 Apr 2026 13:24:01 +0900 Subject: * MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automated-commit-by: dots Signed-off-by: Robert Günzler --- bin/ntfm | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 bin/ntfm (limited to 'bin/ntfm') diff --git a/bin/ntfm b/bin/ntfm new file mode 100755 index 0000000..dd7344f --- /dev/null +++ b/bin/ntfm @@ -0,0 +1,38 @@ +#!/bin/bash +set -eu + +# shellcheck disable=2034 +description="notification manager" + +FUZL_PROMPT=ntfm +. libfuzl.sh + +main() { + local nid + + nid=$(makoctl list | + awk '/Notification/{match($0,/[0-9]+/); print substr($0,RSTART,RLENGTH) "\t" substr($0,RSTART+RLENGTH+1)}' | + fuzl_menu $FUZL_MENU_FILTER --with-nth=2 --accept-nth=1 --no-run-if-empty) + [ -n "$nid" ] || return + + fuzl_action_add menu "󰮫" "open menu" + fuzl_action_add dismiss "󰅗" "dimiss" + fuzl_action_menu "$nid" +} + +# +# actions +# + +ntfm_menu() { + local nid=${1:?} + exec makoctl menu -n "$nid" -- fuzzel -d +} + +ntfm_dismiss() { + local nid=${1:?} + exec makoctl dismiss -n "$nid" +} + + +main -- cgit 1.4.1