From 38110ef852373765de0c738aa54587b9ee640389 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Tue, 29 Oct 2019 19:51:58 +0100 Subject: Random changes. --- i3blocks/i3battery.sh | 4 ++-- i3blocks/i3mailbox.sh | 5 ++++- i3blocks/i3moon.sh | 16 ++++++++-------- 3 files changed, 14 insertions(+), 11 deletions(-) (limited to 'i3blocks') 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" -- cgit v1.2.1