From 8863f1de5fbbacc16b3e0644239f902fe325e911 Mon Sep 17 00:00:00 2001 From: urosm Date: Wed, 12 Jun 2024 00:49:03 +0200 Subject: [PATCH] .local/bin: update --- .local/bin/status.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.local/bin/status.sh b/.local/bin/status.sh index f35ebe9..fd2ee9d 100755 --- a/.local/bin/status.sh +++ b/.local/bin/status.sh @@ -36,16 +36,18 @@ while true; do # scratchpad swaymsg -t get_tree | jq -Mcj '.nodes[] | select(.name=="__i3").nodes[] | select(.name=="__i3_scratch").floating_nodes | - { - "full_text":length, - "urgent":length, - }, ","' + { + "full_text":length, + "urgent":length, + }, ","' # notifications - makoctl list | jq -Mcj '.data[][0] | - { - "full_text":.summary.data, - "urgent":(.urgency.data==2), - }, ","' + makoctl list | jq -Mcj '.data[] | + if length>0 then { + "full_text":(["(",length,") ",.[0].summary.data]|join("")), + "urgent":(.[0].urgency.data==2), + } else { + "full_text":(["(",length,")"]|join("")), + } end, ","' printf "]," # timeout timeout 1 swaymsg -t subscribe '["input","binding"]' >/dev/null