From ccc0247b0d25a7cfc1747ceca369d4386bdfbb21 Mon Sep 17 00:00:00 2001 From: InigoGutierrez Date: Wed, 22 May 2019 10:24:27 +0200 Subject: Renamed mailbox and moon scripts and added click to moon. --- i3blocks/i3mailbox.sh | 20 ++++++++++++++++++++ i3blocks/i3moon.sh | 19 +++++++++++++++++++ i3blocks/mailbox.sh | 20 -------------------- i3blocks/moon.sh | 14 -------------- 4 files changed, 39 insertions(+), 34 deletions(-) create mode 100755 i3blocks/i3mailbox.sh create mode 100755 i3blocks/i3moon.sh delete mode 100755 i3blocks/mailbox.sh delete mode 100755 i3blocks/moon.sh (limited to 'i3blocks') diff --git a/i3blocks/i3mailbox.sh b/i3blocks/i3mailbox.sh new file mode 100755 index 0000000..89fb49a --- /dev/null +++ b/i3blocks/i3mailbox.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# i3blocks mail module. +# Displays number of unread mail and an loading icon if updating. +# When clicked, brings up `neomutt`. + +case $BLOCK_BUTTON in + 1) "$TERMINAL" -e mail.sh ;; + 2) setsid "$HOME/scripts/floats/urxvtFloat.sh" 66 3 syncMail.sh >/dev/null & ;; + 3) pgrep -x dunst >/dev/null && dunstify "📬 Mail module" "\- Shows unread mail +- Shows 🔃 if syncing mail +- Left click opens neomutt +- Middle click syncs mail" ;; +esac + +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" diff --git a/i3blocks/i3moon.sh b/i3blocks/i3moon.sh new file mode 100755 index 0000000..fcb45dc --- /dev/null +++ b/i3blocks/i3moon.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# Shows an emoji with the phase of the moon + +pom | grep -q "New Moon" && moon=🌑 +pom | grep -q "Waxing Crescent" && moon=🌒 +pom | grep -q "First Quarter" && moon=🌓 +pom | grep -q "Waxing Gibbous" && moon=🌔 +pom | grep -q "Full moon" && moon=🌕 +pom | grep -q "Waning Gibbous" && moon=🌖 +pom | grep -q "Last Quarter" && moon=🌗 +pom | grep -q "Waning Crescent" && moon=🌘 + +case $BLOCK_BUTTON in + 1) dunstify "$moon $(pom) $moon";; +esac + +echo "$moon" + diff --git a/i3blocks/mailbox.sh b/i3blocks/mailbox.sh deleted file mode 100755 index 89fb49a..0000000 --- a/i3blocks/mailbox.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# i3blocks mail module. -# Displays number of unread mail and an loading icon if updating. -# When clicked, brings up `neomutt`. - -case $BLOCK_BUTTON in - 1) "$TERMINAL" -e mail.sh ;; - 2) setsid "$HOME/scripts/floats/urxvtFloat.sh" 66 3 syncMail.sh >/dev/null & ;; - 3) pgrep -x dunst >/dev/null && dunstify "📬 Mail module" "\- Shows unread mail -- Shows 🔃 if syncing mail -- Left click opens neomutt -- Middle click syncs mail" ;; -esac - -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" diff --git a/i3blocks/moon.sh b/i3blocks/moon.sh deleted file mode 100755 index a0312f3..0000000 --- a/i3blocks/moon.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# Shows an emoji with the phase of the moon - -pom | grep -q "New Moon" && moon=🌑 -pom | grep -q "Waxing Crescent" && moon=🌒 -pom | grep -q "First Quarter" && moon=🌓 -pom | grep -q "Waxing Gibbous" && moon=🌔 -pom | grep -q "Full moon" && moon=🌕 -pom | grep -q "Waning Gibbous" && moon=🌖 -pom | grep -q "Last Quarter" && moon=🌗 -pom | grep -q "Waning Crescent" && moon=🌘 -echo "$moon" - -- cgit v1.2.1