dotfiles/.i3blocks/claws-mail
2021-09-09 01:46:43 +02:00

31 lines
420 B
Bash
Executable file

#!/bin/bash
if ! pgrep -xf "^claws-mail .*" &>/dev/null
then
swaymsg -q -- exec claws-mail --online
fi
stats=($(claws-mail --status))
status="$?"
new=${stats[0]}
unread=${stats[1]}
if [[ "$button" -eq 1 ]]
then
swaymsg -q -- workspace 🖂
fi
if [[ "$unread" -eq 0 ]]
then
color="#747369"
icon="📪"
elif [[ "$new" -eq 0 ]]
then
color="#FFCC66"
icon="📫"
else
color="#F2777A"
icon="📬"
fi
echo "$icon"