mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-11-06 03:12:24 +00:00
19 lines
783 B
Bash
Executable file
19 lines
783 B
Bash
Executable file
#!/bin/bash
|
|
token="i3_yxQr4ypsKkcht4AnS" data=$(curl "https://git.xware-gmbh.de/api/graphql" -H "Authorization: Bearer $token" -H "Content-Type: application/json" --request POST -s --data @- << GQL
|
|
{ "query": "
|
|
query {
|
|
xware: namespace(fullPath: \"xware\") {
|
|
projects { nodes { name, httpUrlToRepo } }
|
|
}
|
|
leon: namespace(fullPath: \"leon\") {
|
|
projects { nodes { name, httpUrlToRepo } }
|
|
}
|
|
}"
|
|
}
|
|
GQL
|
|
)
|
|
|
|
a=$(echo "$data" | jq -r '.data.xware.projects.nodes + .data.leon.projects.nodes | map(.name + "::::" + .httpUrlToRepo)[]')
|
|
selection=$(echo "$a" | sed -r 's/^(.*)::::.*$/\1/g' | rofi -dmenu -i -theme "$HOME/scripts/rofi-scripts/default_theme.rasi")
|
|
[ ! "$selection" = "" ] && echo "$a" | sed -r -n "s/^$selection::::(.*)$/\1/pg" | xargs qutebrowser
|
|
|