aboutsummaryrefslogtreecommitdiff
path: root/i3blocks
diff options
context:
space:
mode:
Diffstat (limited to 'i3blocks')
-rwxr-xr-xi3blocks/i3battery.sh4
-rwxr-xr-xi3blocks/i3mailbox.sh5
-rwxr-xr-xi3blocks/i3moon.sh16
3 files changed, 14 insertions, 11 deletions
diff --git a/i3blocks/i3battery.sh b/i3blocks/i3battery.sh
index 1278eeb..51dfa37 100755
--- a/i3blocks/i3battery.sh
+++ b/i3blocks/i3battery.sh
@@ -12,8 +12,8 @@ case $BLOCK_BUTTON in
esac
status=$(cat /sys/class/power_supply/"$1"/status)
-capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit
-remaining=$(acpi | cut -d' ' -f5 | cut -d':' -f-2)
+capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit 0
+[ -f "/bin/acpi" ] && remaining="$(acpi | cut -d' ' -f5 | cut -d':' -f-2)" || remaining="missing acpi"
if [ "$capacity" -ge 80 ]; then
color="#b8bb26"
diff --git a/i3blocks/i3mailbox.sh b/i3blocks/i3mailbox.sh
index 89fb49a..70343c8 100755
--- a/i3blocks/i3mailbox.sh
+++ b/i3blocks/i3mailbox.sh
@@ -13,8 +13,11 @@ case $BLOCK_BUTTON in
- Middle click syncs mail" ;;
esac
+syncIcon=""
+[ -n "$(pgrep mbsync)" ] && syncIcon="🔃"
gmailN="$(du -a ~/.mail/gmail/INBOX/new/* 2>/dev/null | sed -n '$=')"
[ "$gmailN" ] || gmailN="0"
unioviN="$(du -a ~/.mail/uniovi/INBOX/new/* 2>/dev/null | sed -n '$=')"
[ "$unioviN" ] || unioviN="0"
-echo "$(cat /tmp/imapsyncicon) Gmail: $gmailN uniovi: $unioviN"
+#echo "$(cat /tmp/imapsyncicon) Gmail: $gmailN uniovi: $unioviN"
+echo "$syncIcon Gmail: $gmailN uniovi: $unioviN"
diff --git a/i3blocks/i3moon.sh b/i3blocks/i3moon.sh
index e86c4ca..d691e8d 100755
--- a/i3blocks/i3moon.sh
+++ b/i3blocks/i3moon.sh
@@ -3,14 +3,14 @@
# Shows an emoji with the phase of the moon
[ ! -f "/bin/pom" ] && echo "🌜 bsd-games not installed. 🌛" && exit 0
-pom | grep -q "New" && moon=🌚
-pom | grep -q "Waxing Crescent" && moon=🌒
-pom | grep -q "First Quarter" && moon=🌓
-pom | grep -q "Waxing Gibbous" && moon=🌔
-pom | grep -q "Full" && moon=🌝
-pom | grep -q "Waning Gibbous" && moon=🌖
-pom | grep -q "Last Quarter" && moon=🌗
-pom | grep -q "Waning Crescent" && moon=🌘
+pom | fgrep -q "New" && moon=🌚
+pom | fgrep -q "Waxing Crescent" && moon=🌒
+pom | fgrep -q "First Quarter" && moon=🌓
+pom | fgrep -q "Waxing Gibbous" && moon=🌔
+pom | fgrep -q "is Full" && moon=🌝
+pom | fgrep -q "Waning Gibbous" && moon=🌖
+pom | fgrep -q "Last Quarter" && moon=🌗
+pom | fgrep -q "Waning Crescent" && moon=🌘
echo "$moon"