SketchyBar/plugins/githubIndicator.sh

12 lines
377 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
2021-10-21 22:27:28 +00:00
sketchybar -m --set $NAME icon.color=0xff48aa2a label.padding_left=4 label="$COUNT"
2021-08-09 17:06:10 +00:00
else
2021-10-21 22:27:28 +00:00
sketchybar -m --set $NAME icon.color=0xaaffffff label.padding_left=0 label=""
2021-08-09 17:06:10 +00:00
fi