dotfiles/polybar/.config/polybar/scripts/poly-papersdue
Marty Oehme 050bac9c55 [polybar] Add pomo timer as git submodule
Using [jsspencer/pomo](https://github.com/jsspencer/pomo) as the timer
of choice. It is simple, it works well, and it uses a very elegant way
of tracking the time.

I can think about implementing my own version later, but this will
handily suffice for now.

Polybar script will now limit the pomo timer to a single 'running'
instance containing the notification function, by putting its running
instance PID in a lockfile and killing it before restarting or changing
the timer.

Added running and paused tomato icons; as well as break coffee icon.
Removed display of seconds, unless the last minute of a timer is
running.
2020-05-25 15:25:45 +00:00

15 lines
518 B
Bash
Executable file

#!/usr/bin/env sh
while true; do
all="$(bib-due -u 'fri this week' -p3 | wc -l)"
required="$(bib-due -u 'fri this week' -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