From c5d101ab2c9db3b1a001cb56953cb90b24f8fdcf Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 19 Jun 2023 10:09:47 +0200 Subject: Added notify --- status | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'status') diff --git a/status b/status index 10b43f9..abd9bad 100755 --- a/status +++ b/status @@ -26,14 +26,16 @@ else battery="No battery" fi -#network=$(nmcli device status | head -n 2 | tail -n 1 | awk '{print "Network: " $4}') # NetworkManager has a dreadful command line interface # It makes cry every time # pls help -network="Network: $(nmcli device status | head -n 2 | tail -n 1 | sed 's/ *$//' | sed 's/.* //')" +nwline="$(nmcli device status | head -n 2 | tail -n 1)" +nwclean="$(echo "$nwline" | sed 's/ *$//' | sed 's/.* //')" +network="Network: $nwclean" -events=$(sdep-list past | wc -l) +noticount=$(notify show | wc -l) printf "$network$sep$volume$sep$battery$sep$date$sep$time" -[ "$events" != "0" ] && printf "$sep$events TODO task(s)" +[ "$noticount" = "1" ] && printf "$sep$(notify show)" +[ "$noticount" -gt "1" ] && printf "${sep}Unread notifications: $noticount" printf "\n" -- cgit v1.3