commit 74be52dc869244bc1aba434d4c8a5e2f3d54e21d
parent 8a370a3647f867e1521f08740b22df4394e417d9
Author: Anders Damsgaard Christensen <adc@geo.au.dk>
Date: Mon, 18 Apr 2016 15:27:28 -0700
add unread mail notification to i3bar, always show keyboard layout, blue fg color for mpd status
Diffstat:
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/bin/i3status-mpc.sh b/bin/i3status-mpc.sh
@@ -1,14 +1,26 @@
#!/bin/bash
+mpdcolor="#666699"
i3status --config ~/.i3/status | (read line && echo $line && read line && echo $line && while :
do
read line
- #dat=""
- dat="$(cat ~/.kbd-layout)"
- if [[ -n $(mpc | grep playing) ]]
+ dat=""
+ if [[ -n $(mpc | grep playing) ]]
then
dat="$(mpc current -f '[%artist%]'): $(mpc current -f '[%title%]')"
fi
- dat="[{ \"full_text\": \"${dat}\" },"
+ newmails=$(find ~/Mail/*/INBOX/new -type f | wc -l)
+ kbdlayout=$(cat ~/.kbd-layout)
+ mailcolor="#859900"
+ if [ "$newmails" -gt 0 ]; then
+ mailcolor="#cb4b16"
+ fi
+
+ dat="["\
+"{\"full_text\":\"${kbdlayout}\"},"\
+"{\"full_text\":\"M: ${newmails}\",\"color\":\"${mailcolor}\"},"\
+"{\"full_text\":\"${dat}\",\"color\":\"${mpdcolor}\"},"
+
+ #dat="[{\"name\":\"mpd\",\"full_text\":\"asdf\"},"
echo "${line/[/$dat}" || exit 1
done)