SketchyBar/plugins/githubIndicator.sh

16 lines
475 B
Bash
Raw Normal View History

2021-08-09 19:06:10 +02:00
#!/usr/bin/env bash
2021-08-13 15:58:00 +02:00
COUNT=0
2021-08-09 19:06:10 +02:00
COUNT=$(curl https://github.com/users/FelixKratz/contributions | grep $(date '+%Y-%m-%d') | sed -nr 's/.*data-count=\"([^"]+).*/\1/p')
2021-08-13 15:58:00 +02:00
echo $COUNT
2021-08-09 19:06:10 +02:00
if [ $COUNT -gt 0 ]; then
sketchybar -m set $NAME icon_color 0xff48aa2a
sketchybar -m set $NAME label_padding_left 4
sketchybar -m set $NAME label $COUNT
2021-08-09 19:06:10 +02:00
else
sketchybar -m set $NAME icon_color 0xaaffffff
sketchybar -m set $NAME label_padding_left 0
sketchybar -m set $NAME label ""
2021-08-09 19:06:10 +02:00
fi