system/scripts/him.sh

41 lines
740 B
Bash
Raw Normal View History

#!/bin/bash
bin="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
2022-06-21 12:58:28 +03:00
a=$((a+$($bin -a "$acc" search unseen -s 200 | 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")
2022-06-21 12:58:28 +03:00
for id in $(NO_COLOR=1 $bin -a $2 search unseen -s 200 | grep '✷'| awk '{ print $1 }')
do
$bin -a $2 flag add $id seen
done
esac