Add rofistarred

This commit is contained in:
Jeffrey Serio 2023-09-08 07:41:48 -05:00
parent 8c1e1e3afc
commit de8f892b7b

View File

@ -1,6 +1,18 @@
#!/usr/bin/env bash #!/usr/bin/env bash
USERNAME="hyperreal64" # Use with rofi -show "GitHub Starred" -modes "GitHub Starred:/home/jas/bin/rofistarred"
starred_repos=$(curl -s "https://api.github.com/users/${USERNAME}/starred?per_page=1000" | jq '.[] | .full_name' | tr -d '"')
echo "$starred_repos" | rofi -dmenu -p "GitHub Starred" -theme-str 'window { width: 40em; height: 40em; }' | xargs -I{} xdg-open "https://github.com/{}" 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