[bibtex] Add priority filtering to bib-due
Can filter by priority using `-p` option, script will then go down the list and display only paper of this priority or higher. For example priority 3 will display 3,2,1 but not those without; priority 1 will only display 1
This commit is contained in:
parent
b4c8030ce8
commit
e55f3a067d
3 changed files with 44 additions and 5 deletions
|
|
@ -224,11 +224,12 @@ click-right = kill -USR2 %pid%
|
|||
; display information on remaining papers to read for the upcoming week
|
||||
[module/papersdue]
|
||||
type = custom/script
|
||||
exec = bib-due -u $(date --date='fri this week' +%Y-%m-%d) | wc -l
|
||||
exec = $XDG_CONFIG_HOME/polybar/scripts/poly-papersdue
|
||||
exec-if = type bib-due
|
||||
click-left = exist rofi-bib-due normal "opening due papers" && rofi-bib-due -u $(date --date='fri this week' +%Y-%m-%d)
|
||||
format-foreground = ${colors.primary}
|
||||
format-prefix = ""
|
||||
tail = true
|
||||
click-left = exist rofi-bib-due normal "opening due papers" && rofi-bib-due -p1 -u $(date --date='fri this week' +%Y-%m-%d)
|
||||
; format-foreground = ${colors.primary}
|
||||
format-prefix = " "
|
||||
interval = 120
|
||||
|
||||
; display unified available packages for update on arch from repos/aur
|
||||
|
|
|
|||
15
polybar/.config/polybar/scripts/poly-papersdue
Executable file
15
polybar/.config/polybar/scripts/poly-papersdue
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/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
|
||||
Loading…
Add table
Add a link
Reference in a new issue