dotfiles/.i3blocks/claws-mail

32 lines
420 B
Plaintext
Raw Permalink Normal View History

2021-08-12 20:26:12 +02:00
#!/bin/bash
2021-09-09 01:46:43 +02:00
if ! pgrep -xf "^claws-mail .*" &>/dev/null
then
swaymsg -q -- exec claws-mail --online
fi
2021-08-12 20:26:12 +02:00
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"