summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xi3blocks-mail.sh5
-rwxr-xr-xi3blocks-news.sh3
-rwxr-xr-xi3blocks-packages.sh3
3 files changed, 7 insertions, 4 deletions
diff --git a/i3blocks-mail.sh b/i3blocks-mail.sh
index b370f24..2ec5d14 100755
--- a/i3blocks-mail.sh
+++ b/i3blocks-mail.sh
@@ -1,5 +1,6 @@
#!/bin/sh
icon=󰶋
-unread=$(ls -l ~/.mail/gmail/Inbox/new | wc -l | cut -w -f2)
-[ $unread -gt 0 ] && printf "%s%s\n" $icon $unread && notify-send "$unread unread email(s)"
+unread=$(ls ~/.mail/gmail/Inbox/new/ | wc -l | cut -w -f2)
+[ $unread -gt 0 ] && printf "%s%s" $icon $unread && notify-send "$unread unread email(s)"
+printf "\n"
diff --git a/i3blocks-news.sh b/i3blocks-news.sh
index 9e5e92f..290fb04 100755
--- a/i3blocks-news.sh
+++ b/i3blocks-news.sh
@@ -2,4 +2,5 @@
icon=󰎕
unread=$(newsboat -x print-unread | cut -d' ' -f1)
-[ $unread -gt 0 ] && printf "$icon%s\n" $unread && notify-send "$unread unread article(s)"
+[ $unread -gt 0 ] && printf "%s%s" $icon $unread && notify-send "$unread unread article(s)"
+printf "\n"
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"