33 lines
614 B
Bash
Executable file
33 lines
614 B
Bash
Executable file
#!/bin/bash
|
|
bin=~/repos/himalaya/target/release
|
|
|
|
case $1 in
|
|
"" | "list")
|
|
for acc in $(NO_COLOR=1 $bin/himalaya accounts | grep imap | awk '{ print $1 }')
|
|
do
|
|
echo "account: $acc"
|
|
$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 60
|
|
done
|
|
;;
|
|
esac
|
|
|
|
|