mirror of
https://codeberg.org/hyperreal/bin
synced 2024-11-01 16:43:08 +01:00
Add rofistarred
This commit is contained in:
parent
8c1e1e3afc
commit
de8f892b7b
18
rofistarred
18
rofistarred
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user