System/sources/update-sources.sh

54 lines
2.4 KiB
Bash
Raw Normal View History

2023-05-14 18:54:38 -04:00
#!/usr/bin/env bash
2023-05-15 07:58:38 -04:00
set -exou pipefail
2023-05-14 18:54:38 -04:00
DIRECTORY=$(realpath "$(dirname "$0")")
# Update swayimg
SWAYIMG_VERSION=$(curl https://api.github.com/repos/artemsen/swayimg/tags | jq -r ".[0].name" | tr -d "v")
SWAYIMG_URL="https://github.com/artemsen/swayimg/archive/refs/tags/v$SWAYIMG_VERSION.tar.gz"
2023-05-15 08:05:01 -04:00
SWAYIMG_HASH=$(nix-prefetch fetchurl --url "$SWAYIMG_URL")
2023-05-14 18:54:38 -04:00
jq --null-input \
--arg version "$SWAYIMG_VERSION" \
--arg url "$SWAYIMG_URL" \
--arg hash "$SWAYIMG_HASH" \
'{"version": $version, "url": $url, "hash": $hash}' \
> $DIRECTORY/swayimg.json
2023-05-14 19:12:18 -04:00
echo "swayimg now at $SWAYIMG_VERSION"
2023-06-16 21:38:39 -04:00
# Update autoname
# AUTONAME_BRANCH=$(curl https://api.github.com/repos/hyprland-community/hyprland-autoname-workspaces| jq -r '.default_branch')
# AUTONAME_REV=$(curl https://api.github.com/repos/hyprland-community/hyprland-autoname-workspaces/git/refs/heads/$AUTONAME_BRANCH | \
# jq -r '.object.sha')
# AUTONAME_HASH=$(nix-prefetch fetchFromGitHub --owner hyprland-community --repo hyprland-autoname-workspaces --rev $AUTONAME_REV)
# jq --null-input \
# --arg rev "$AUTONAME_REV" \
# --arg hash "$AUTONAME_HASH" \
# '{"rev": $rev, "hash": $hash}' \
# > $DIRECTORY/autoname.json
# echo "autoname now at $AUTONAME_REV"
2023-06-17 16:29:55 -04:00
# Update pyprland
PYPRLAND_BRANCH=$(curl https://api.github.com/repos/hyprland-community/pyprland | jq -r '.default_branch')
PYPRLAND_REV=$(curl https://api.github.com/repos/hyprland-community/pyprland/git/refs/heads/$PYPRLAND_BRANCH | \
jq -r '.object.sha')
PYPRLAND_HASH=$(nix-prefetch fetchFromGitHub --owner hyprland-community --repo pyprland --rev $PYPRLAND_REV)
2023-06-17 16:29:55 -04:00
jq --null-input \
--arg rev "$PYPRLAND_REV" \
--arg hash "$PYPRLAND_HASH" \
'{"rev": $rev, "hash": $hash}' \
> $DIRECTORY/pyprland.json
echo "pyprland now at $PYPRLAND_REV"
2023-06-16 21:38:39 -04:00
# Update gamescope
GAMESCOPE_BRANCH=$(curl https://api.github.com/repos/ValveSoftware/gamescope | jq -r '.default_branch')
GAMESCOPE_REV=$(curl https://api.github.com/repos/ValveSoftware/gamescope/git/refs/heads/$GAMESCOPE_BRANCH | \
jq -r '.object.sha')
GAMESCOPE_HASH=$(nix-prefetch fetchFromGitHub --owner ValveSoftware --repo gamescope --rev $GAMESCOPE_REV --fetchSubmodules)
2023-06-16 21:38:39 -04:00
jq --null-input \
--arg rev "$GAMESCOPE_REV" \
--arg hash "$GAMESCOPE_HASH" \
'{"rev": $rev, "hash": $hash}' \
> $DIRECTORY/gamescope.json
echo "gamescope now at $GAMESCOPE_REV"