system/scripts/him.sh

41 lines
756 B
Bash
Raw Normal View History

#!/bin/bash
bin=~/repos/himalaya/target/release/himalaya
case $1 in
"" | "list")
for acc in $(NO_COLOR=1 $bin accounts | grep imap | awk '{ print $1 }')
do
echo "account: $acc"
$bin -a "$acc" list -s 10 -w 120 | grep '✷'
echo "---"
done
;;
2022-04-25 09:57:09 +03:00
"unread-count")
a=0
for acc in $(NO_COLOR=1 $bin accounts | grep imap | awk '{ print $1 }')
do
a=$((a+$($bin -a "$acc" search unseen | grep '✷' | wc -l)))
done
echo $a
;;
2022-04-25 09:57:09 +03:00
"watch")
while true
do
printf '\033[2J'
$0 list
sleep 60
2022-04-25 09:57:09 +03:00
done
;;
"mark-read")
for id in $(NO_COLOR=1 $bin -a $2 search unseen | grep '✷'| awk '{ print $1 }')
do
$bin -a $2 flag add $id seen
done
esac