mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 17:17:22 +01:00
13 lines
344 B
Nix
13 lines
344 B
Nix
{ writeShellApplication, jq }:
|
|
|
|
writeShellApplication {
|
|
name = "github-notifications";
|
|
runtimeInputs = [ jq ];
|
|
text = ''
|
|
count=$(curl -u Swarsel:"$(cat /run/user/1000/secrets/github_notif)" https://api.github.com/notifications | jq '. | length')
|
|
|
|
if [[ "$count" != "0" ]]; then
|
|
echo "{\"text\":\"$count\"}"
|
|
fi
|
|
'';
|
|
}
|