dotfiles/polybar/.config/polybar/scripts/poly-papersdue

16 lines
568 B
Bash
Executable File

#!/usr/bin/env sh
while true; do
all="$(bib-due -u "$(date --date='fri this week' +%Y-%m-%d)" | wc -l)"
required="$(bib-due -u "$(date --date='fri this week' +%Y-%m-%d)" -p1 | wc -l)"
# add polybar formatting to color required readings red
# https://github.com/polybar/polybar/wiki/Formatting#format-tags
# TODO use xresources
colorreq=$(xrdb -query | grep -e '\*color1:' | cut -f2)
colorall=$(xrdb -query | grep -e '\*foreground:' | cut -f2)
printf "%s%s%s(%s)\n" "%{F${colorall:-#000}}" "$all" "%{F${colorreq:-#d00}}" "$required"
sleep 120
done