diff options
author | Adam T. Carpenter <atc@53hor.net> | 2020-05-19 18:51:14 -0400 |
---|---|---|
committer | Adam T. Carpenter <atc@53hor.net> | 2020-05-19 18:51:14 -0400 |
commit | cab073ae08de3da46c6bf7b8c14e53a330b4ed9c (patch) | |
tree | 0f05fed3abe5b3b2c1418718c98345a8ad7b837e /i3blocks-packages.sh | |
parent | 07b492219f65cbd952a5caebeec764b3fd5cd477 (diff) | |
download | scripts-cab073ae08de3da46c6bf7b8c14e53a330b4ed9c.tar.xz scripts-cab073ae08de3da46c6bf7b8c14e53a330b4ed9c.zip |
hiding certain blocks when nothing to report
Diffstat (limited to 'i3blocks-packages.sh')
-rwxr-xr-x | i3blocks-packages.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/i3blocks-packages.sh b/i3blocks-packages.sh index 136a76a..6e5d0e9 100755 --- a/i3blocks-packages.sh +++ b/i3blocks-packages.sh @@ -2,4 +2,5 @@ icon= package_count=$(pkg upgrade -n | tail -1 | cut -s -d':' -f2 | cut -w -f2) -[ $package_count -gt 0 ] && printf "$icon%s\n" $package_count && notify-send "$package_count package upgrade(s) available" +[ -n "$package_count" ] && [ "$package_count" -gt 0 ] && printf "%s%s" $icon $package_count && notify-send "$package_count package upgrade(s) available" +printf "\n" |