automate/020_lightdm-nwg-greeter.sh

78 lines
2.4 KiB
Bash
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
set -euo pipefail
# -------------------------------------------------
# 1⃣ CONFIGURATION
# -------------------------------------------------
REPO="nwg-piotr/lightdm-nwg-greeter"
USER="nwg-piotr"
PROJECT="lightdm-nwg-greeter"
# -------------------------------------------------
# 2⃣ FETCH JSON ONLY ONCE
# -------------------------------------------------
raw_json=$(lastversion --format json "$REPO")
# -------------------------------------------------
# 3⃣ ONESHOT extraction of everything we need
# -------------------------------------------------
eval $(jq -r '
{
author: .author.login, # "nwg-piotr"
install_name: .install_name, # "lightdm-nwg-greeter"
version: .tag_name | sub("^v"; ""), # "0.1.1"
license: .license.name, # "mit"
homepage: .html_url, # release page URL
rss_feed: (.html_url + ".atom"),
description: (.body // ""),
long_desc: (.body // "")
}
"USER=\(.author)
PROJECT=\(.install_name)
| VERSION=\(.version)
LICENSE=\(.license)
RELEASE_URL=\(.homepage)
RSS_FEED=\(.rss_feed)
DESCRIPTION=\(.description)
LONG_DESCRIPTION=\(.long_desc)"
' <<<"$raw_json")
# -------------------------------------------------
# 4⃣ Use the variables downstream (example: print them)
# -------------------------------------------------
echo "Package version : $VERSION"
echo "License : $LICENSE"
echo "Homepage (release) : $RELEASE_URL"
echo "RSS feed : $RSS_FEED"
echo "Short description : $DESCRIPTION"
echo "Long description : $LONG_DESCRIPTION"
# Set github user and project name
USER="nwg-piotr"
PROJECT="lightdm-nwg-greeter"
LICENSE="mit"
SECTION="admin"
HOMEPAGE=
BUILD_HOME="/var/tmp/build_${PROJECT}"
#VERSION="2.1.0"
PACKAGE="${
VERSION=
DEBEMAIL="${DEBMAIL}"
DEBFULLNAME="${DEBFULLNAME}"
DESCRIPTION=
LONG_DESCRIPTION=
RSS_FEED="https://github.com/${USER}/${PROJECT}/releases.atom"
# xdg-open ${RSS_FEED}
echo ${RSS_FEED}
# A simple LightDM greeter, using Python and GTK, that doesn't require an X11 server,
# https://github.com/cage-kiosk/cage/wiki/
sudo apt install -y cage
# pygobject - https://pygobject.gnome.org/getting_started.html#ubuntu-getting-started
sudo apt install -y python3-gi python3-gi-cairo gir1.2-gtk-4.0