solorice/.config/waybar/scripts/github.sh
2023-02-22 22:18:20 +02:00

12 lines
378 B
Bash

#!/bin/bash
token=$(cat "${HOME}"/.config/github/notifications.token)
count=$(curl -u kristoferssolo:"${token}" https://api.github.com/notifications | jq '. | length')
# if [[ "$count" != "0" ]]; then
# echo "{'text':$(count),'tooltip':$(tooltip),'class':$(class)}"
# fi
if [[ "$count" != "0" ]]; then
echo '{"text":'$count',"tooltip":"$tooltip","class":"$class"}'
fi