From 998ee399e5501294b4a85fc643bede4a947ff8ab Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Sat, 19 Dec 2020 16:04:51 +0100 Subject: [PATCH] only prints new articles if newsboat is closed --- .local/bin/statusbar/news | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news index 96723ae..56a0939 100755 --- a/.local/bin/statusbar/news +++ b/.local/bin/statusbar/news @@ -1,4 +1,6 @@ #!/bin/bash -num=$( cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print $1}' | sed s/^0$//g)$(cat ~/.config/newsboat/.update 2>/dev/null)") -[ "$num" = "" ] || printf "📰%s" "$num" -printf '\n' +num="$(newsboat -x print-unread | cut -f1 -d ' ' )" +if ! pgrep newsboat > /dev/null ; then + [ "$num" = "" ] || printf "📰%s" "$num" + printf '\n' +fi