SketchyBar/plugins/githubIndicator.sh

12 lines
371 B
Bash
Raw Normal View History

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