diff options
author | sils <sils@sils.li> | 2023-09-28 21:08:48 +0200 |
---|---|---|
committer | sils <sils@sils.li> | 2023-09-28 21:08:48 +0200 |
commit | 0f494db49594dc6a1e4403e792a73cea9a44dfe6 (patch) | |
tree | 0890c841619438421e6a71210aa9228ceaaffdd4 /files/nwg-panel/executors/github.sh | |
parent | feat(u/sils/xdg): add element-desktop as handler for element events (diff) | |
download | nix-config-0f494db49594dc6a1e4403e792a73cea9a44dfe6.zip |
feat(files/nwg-panel): add nwg-panel config
Diffstat (limited to 'files/nwg-panel/executors/github.sh')
-rwxr-xr-x | files/nwg-panel/executors/github.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/files/nwg-panel/executors/github.sh b/files/nwg-panel/executors/github.sh new file mode 100755 index 0000000..a0f4bd3 --- /dev/null +++ b/files/nwg-panel/executors/github.sh @@ -0,0 +1,14 @@ +#!/nix/store/vqvj60h076bhqj6977caz0pfxs6543nb-bash-5.2-p15/bin/bash + +# Based on the 'Github notifications' example from Waybar's Wiki +# Depends on jq Command-line JSON processor +# Obtain a notifications token at https://github.com/settings/tokens +# save it to a file as below. + +token=`cat ${HOME}/.config/github/notifications.token` +count=`curl -u nwg-piotr:${token} https://api.github.com/notifications -s | jq '. | length'` + +if [[ "$count" != "0" ]]; then + echo /home/piotr/.config/nwg-panel/icons_light/github.svg + echo $count +fi |