diff options
-rwxr-xr-x | .local/bin/status/sb-clock | 27 | ||||
-rwxr-xr-x | .local/bin/status/sb-mailbox | 20 | ||||
-rwxr-xr-x | .local/bin/status/sb-mpd | 14 |
3 files changed, 47 insertions, 14 deletions
diff --git a/.local/bin/status/sb-clock b/.local/bin/status/sb-clock index 97207d1..3dc8af4 100755 --- a/.local/bin/status/sb-clock +++ b/.local/bin/status/sb-clock @@ -3,19 +3,19 @@ clock=$(date '+%I') case "$clock" in - "00") icon="🕛" ;; - "01") icon="🕐" ;; - "02") icon="🕑" ;; - "03") icon="🕒" ;; - "04") icon="🕓" ;; - "05") icon="🕔" ;; - "06") icon="🕕" ;; - "07") icon="🕖" ;; - "08") icon="🕗" ;; - "09") icon="🕘" ;; - "10") icon="🕙" ;; - "11") icon="🕚" ;; - "12") icon="🕛" ;; + "00") icon="" ;; + "01") icon="" ;; + "02") icon="" ;; + "03") icon="" ;; + "04") icon="" ;; + "05") icon="" ;; + "06") icon="" ;; + "07") icon="" ;; + "08") icon="" ;; + "09") icon="" ;; + "10") icon="" ;; + "11") icon="" ;; + "12") icon="" ;; esac case $BLOCK_BUTTON in @@ -26,4 +26,3 @@ case $BLOCK_BUTTON in esac date "+$icon %H:%M" - diff --git a/.local/bin/status/sb-mailbox b/.local/bin/status/sb-mailbox new file mode 100755 index 0000000..ed41b03 --- /dev/null +++ b/.local/bin/status/sb-mailbox @@ -0,0 +1,20 @@ +#!/bin/sh + +# Displays number of unread mail and an loading icon if updating. +# When clicked, brings up `neomutt`. + +case $BLOCK_BUTTON in + 1) setsid -f "$TERMINAL" -e neomutt ;; + 2) setsid -f mw -Y >/dev/null ;; + 3) notify-send "📬 Mail module" "\- Shows unread mail +- Shows 🔃 if syncing mail +- Left click opens neomutt +- Middle click syncs mail" ;; + 6) "$TERMINAL" -e "$EDITOR" "$0" ;; +esac + +unread="$(ls "${MAIL:-/var/mail/jozan}"/bousset.rudy@gmail.com/INBOX/new/ | wc -l 2>/dev/null)" + +pidof mbsync >/dev/null 2>&1 && icon="" +[ "$icon" = "" ] && icon="" +[ "$unread" -eq 0 ] || echo "$icon " $unread diff --git a/.local/bin/status/sb-mpd b/.local/bin/status/sb-mpd new file mode 100755 index 0000000..b2d2a98 --- /dev/null +++ b/.local/bin/status/sb-mpd @@ -0,0 +1,14 @@ +#!/bin/sh + +mp=$(mpc status) +icon=$(echo "$mp" | sed -n 2p | sed -E 's/(^|\])[^[]*($|\[)//g') +case $icon in + "playing") icon="契" ;; + "paused") icon="" ;; + *) return ;; +esac +printf "%s %s" "$icon" "$(echo "$mp" | head -n1)" + +# while : ; do + # mpc idle >/dev/null +# done |