Initial commit: IceGlass NHL game tracker

macOS menu bar app providing NHL game situational awareness with
league-wide scoreboard, dynamic polling, notifications with team
logos, and configurable display options.
This commit is contained in:
2026-04-13 21:44:08 -04:00
commit 8f8f8b2755
158 changed files with 2752 additions and 0 deletions
+95
View File
@@ -0,0 +1,95 @@
#!/bin/bash
#
# download_team_logos.sh
# Downloads NHL team logos (SVG) from the NHL assets CDN.
#
# Usage: ./Scripts/download_team_logos.sh [season]
# season: e.g. 20252026 (defaults to current season)
#
# SVGs are saved to Assets.xcassets imagesets for UI use.
# PNGs (80x80) are saved to TeamLogos/ for notification attachments.
#
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
ASSETS_DIR="$PROJECT_DIR/IceGlass/Assets.xcassets"
LOGOS_DIR="$PROJECT_DIR/IceGlass/TeamLogos"
# Determine season
if [ -n "$1" ]; then
SEASON="$1"
else
MONTH=$(date +%m)
YEAR=$(date +%Y)
if [ "$MONTH" -lt 7 ]; then
SEASON="$((YEAR - 1))$YEAR"
else
SEASON="$YEAR$((YEAR + 1))"
fi
fi
echo "Downloading NHL team logos for season $SEASON"
TEAMS=(
ANA BOS BUF CAR CBJ CGY CHI COL DAL DET
EDM FLA LAK MIN MTL NJD NSH NYI NYR OTT
PHI PIT SEA SJS STL TBL TOR UTA VAN VGK
WPG WSH
)
# Create logos directory for notification attachments
mkdir -p "$LOGOS_DIR"
for TEAM in "${TEAMS[@]}"; do
IMAGESET_DIR="$ASSETS_DIR/TeamLogo_${TEAM}.imageset"
mkdir -p "$IMAGESET_DIR"
SVG_URL="https://assets.nhle.com/logos/nhl/svg/${TEAM}_light.svg"
SVG_FILE="$IMAGESET_DIR/${TEAM}_light.svg"
LOGO_PNG="$LOGOS_DIR/${TEAM}.png"
echo " Downloading $TEAM..."
curl -s -o "$SVG_FILE" "${SVG_URL}?season=${SEASON}"
# Convert SVG to PNG (200px wide, aspect-ratio preserved) for notification attachments
if command -v rsvg-convert &>/dev/null; then
rsvg-convert -w 200 -h 200 --keep-aspect-ratio --background-color=transparent "$SVG_FILE" -o "$LOGO_PNG" 2>/dev/null
else
python3 -c "
try:
import cairosvg
cairosvg.svg2png(url='$SVG_FILE', write_to='$LOGO_PNG', output_width=200)
except ImportError:
pass
" 2>/dev/null || true
fi
# Write Contents.json for the imageset (SVG only, no PNG)
cat > "$IMAGESET_DIR/Contents.json" << EOJSON
{
"images" : [
{
"filename" : "${TEAM}_light.svg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"template-rendering-intent" : "original"
}
}
EOJSON
done
echo ""
echo "Done! Downloaded ${#TEAMS[@]} team logos to:"
echo " Asset catalogs: $ASSETS_DIR/TeamLogo_*.imageset/ (SVG)"
echo " Notifications: $LOGOS_DIR/ (PNG 80x80)"
echo ""
echo "Season: $SEASON"
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh
## IMPORTANT ##
# Add the following files to Input Files configuraiton of the build phase
# $(TARGET_BUILD_DIR)/$(INFOPLIST_PATH)
# $(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)/Contents/Info.plist
git=$(sh /etc/profile; which git)
number_of_commits=$("$git" rev-list HEAD --count)
git_release_version=$("$git" describe --tags --always --abbrev=0)
target_plist="$TARGET_BUILD_DIR/$INFOPLIST_PATH"
dsym_plist="$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME/Contents/Info.plist"
git_commit=`"$git" rev-parse --short HEAD`
bundle_version=`/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "$target_plist"`
build_date=`date +%F`
build="v$bundle_version-$git_commit b$number_of_commits $build_date"
#echo "version=$bundle_version-$git_commit build $number_of_commits"
"$git" tag "$bundle_version"
for plist in "$target_plist" "$dsym_plist"; do
if [ -f "$plist" ]; then
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $number_of_commits" "$plist"
# /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${version}" "$plist"
# /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${git_release_version#*v}" "$plist"
# Add build date for AppInfoKit
/usr/libexec/PlistBuddy -c "Set :BuildDate $build_date" "$plist" 2>/dev/null || \
/usr/libexec/PlistBuddy -c "Add :BuildDate string $build_date" "$plist"
fi
done