tmailbar: new bar to display messages - scripts - various script and utils
(HTM) git clone git://z3bra.org/scripts
(DIR) Log
(DIR) Files
(DIR) Refs
---
(DIR) commit 726fd4eeadd4b0ab4a9c48d72643315e6aa4c64d
(DIR) parent 38d06afe7d688d5746958735d24f282f0348c02f
(HTM) Author: z3bra <willyatmailoodotorg>
Date: Wed, 23 Sep 2015 00:29:00 +0200
mailbar: new bar to display messages
Diffstat:
A mailbar | 45 +++++++++++++++++++++++++++++++
M yawee | 4 +---
2 files changed, 46 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/mailbar b/mailbar
t@@ -0,0 +1,45 @@
+#!/bin/sh
+
+MAILDIR=$HOME/var/mail
+MAILBOX='inbox crux lobsters'
+
+C1=%{F#ffffffff}
+C2=%{F#ff666666}
+F1='-windows-codingfonttobi1-medium-r-normal--12-90-96-96-c-70-iso8859-1'
+F2='-misc-stlarch-medium-r-normal--10-100-75-75-c-80-iso10646-1'
+
+mailcount() {
+ case $1 in
+ crux) CHAR=''; DIR=$MAILDIR/lists/$1/new ;;
+ inbox) CHAR=''; DIR=$MAILDIR/$1/new ;;
+ lobsters) CHAR=''; DIR=$MAILDIR/lists/$1/new ;;
+ *) return ;;
+ esac
+
+ COUNT=$(fcount $DIR)
+
+ printf '%s%s%s %s%d%s\n' "$C1" "%{A:$1:}" "$CHAR" "$C2" "$COUNT" "%{A}"
+}
+
+formatbar() {
+ BAR=' %{c}'
+ for MB in $MAILBOX; do
+ BAR="$BAR $(mailcount $MB) "
+ done
+ echo "$BAR"
+}
+
+showtitles() {
+ while read BOX; do
+ find $MAILDIR -type d -name $BOX \
+ | xargs -I% grep -r '^Subject: ' %/new \
+ | cut -d\ -f2- \
+ | ifne xmessage -center -file - &
+ compton-trans -n xmessage -O 0.8
+ done
+}
+
+while :; do
+ formatbar
+ sleep 5
+done | lemonbar -d -B"#00000000" -f"$F1" -f"$F2" -g128x32+1312 | showtitles
(DIR) diff --git a/yawee b/yawee
t@@ -17,9 +17,7 @@ while IFS=: read ev wid; do
;;
# mapping requests
- 19) wattr o $wid \
- && chwb -s 2 -c 0x323232 $wid \
- || vroum $wid ;;
+ 19) wattr o $wid || vroum $wid ;;
# focus next window when deleting focused window
18) wattr $(pfw) || vroum prev 2>/dev/null