diff --git a/programs/xmonad/xmobar/src/xmobar.hs b/programs/xmonad/xmobar/src/xmobar.hs
index a003ee7..30a1d5a 100644
--- a/programs/xmonad/xmobar/src/xmobar.hs
+++ b/programs/xmonad/xmobar/src/xmobar.hs
@@ -52,7 +52,7 @@ config n = defaultConfig
, alignSep = "}{"
, template = "%XMonadLog%"
<> "} %date% %cpu% | %memory% * %swap% | %wlxd03745e1e87bwi%"
- <> "{ Vol: %volume% %kbd% %time%"
+ <> "{ Emails: %emails% Vol: %volume% %kbd% %time%"
}
myCommands :: [Runnable]
@@ -86,6 +86,7 @@ myCommands =
]
(10 `seconds`)
, Run $ Com "/bin/bash" ["-c", "~/.config/xmobar/scripts/get_volume.sh"] "volume" 1
+ , Run $ Com "/bin/bash" ["-c", "~/scripts/him.sh unread-count"] "emails" 60
, Run XMonadLog
]
where
diff --git a/scripts/him.sh b/scripts/him.sh
index f8fa7bc..1bdf13c 100755
--- a/scripts/him.sh
+++ b/scripts/him.sh
@@ -1,22 +1,31 @@
#!/bin/bash
+bin=~/repos/himalaya/target/release
case $1 in
"" | "list")
- bin=~/repos/himalaya/target/release
for acc in $(NO_COLOR=1 $bin/himalaya accounts | grep imap | awk '{ print $1 }')
do
echo "account: $acc"
- $bin/himalaya -a "$acc" list
+ $bin/himalaya -a "$acc" list -w 120 | grep '✷'
echo "---"
done
;;
+ "unread-count")
+ a=0
+ for acc in $(NO_COLOR=1 $bin/himalaya accounts | grep imap | awk '{ print $1 }')
+ do
+ a=$((a+$($bin/himalaya -a "$acc" list | grep '✷' | wc -l)))
+ done
+ echo $a
+ ;;
+
"watch")
while true
do
printf '\033[2J'
$0 list
- sleep 10
+ sleep 60
done
;;
esac