all repos — dotfiles @ 11db1ea701480e9966dc687296cbfbc5b05f32de

linux dotfiles

config/i3blocks/newsboat (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
#!/bin/sh
icon=$(echo -en "<span font='Font Awesome 5 Free'>\uf09e</span>")
count=$(cat $HOME/.config/newsboat/unread)

[ $count = $(echo -e '\uf2f1') ] || count=$(newsboat -x 'print-unread' | cut -d ' ' -f1)

case $BLOCK_BUTTON in
    1) setsid st -e newsboat &&
        count=$(newsboat -x 'print-unread' | cut -d ' ' -f1) ;;
esac

if [ $count -gt 0 ];
then
    echo "<span color='#00FF00'>$icon $count</span>"
elif [ $count = $(echo -e '\uf2f1') ]
then
    count=$(echo -en "<span font='Font Awesome 5 Free 8'>\uf2f1</span>")
    echo "<span color='#666666'>$icon $count</span>"
fi