mirror of
https://codeberg.org/hyperreal/bin
synced 2024-11-25 10:23:42 +01:00
19 lines
480 B
Bash
Executable File
19 lines
480 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Use with rofi -show "GitHub Starred" -modes "GitHub Starred:/home/jas/bin/rofistarred"
|
|
|
|
USERNAME="hyperreal64"
|
|
STARRED_FILE="${HOME}/.github-starred"
|
|
|
|
if [ ! -f "$STARRED_FILE" ]; then
|
|
curl -s "https://api.github.com/users/${USERNAME}/starred?per_page=1000" | jq '.[] | .full_name' | tr -d '"' | tee "$STARRED_FILE"
|
|
fi
|
|
|
|
starred_repos=$(cat "$STARRED_FILE")
|
|
|
|
if [ "$#" -eq 1 ]; then
|
|
xdg-open "https://github.com/$1"
|
|
else
|
|
echo "$starred_repos"
|
|
fi
|