diff options
| author | Robert Günzler <r@gnzler.io> | 2026-04-08 13:24:01 +0900 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2026-04-08 13:24:01 +0900 |
| commit | 28db7c76e26c312918959384e02e433f8858de49 (patch) | |
| tree | cc06c8ffa2444b49cbaf01d45aede08411d23049 /bin/ntfm | |
| parent | b61b58ce2c1371d6f904f108fa7feed3abfbe5c7 (diff) | |
*
Automated-commit-by: dots Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to '')
| -rwxr-xr-x | bin/ntfm | 38 |
1 files changed, 38 insertions, 0 deletions
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 |