Files
venus/dbus-windy-station/install_gui_v2.sh
dev 9756538f16 Initial commit: Venus OS boat addons monorepo
Organizes 11 projects for Cerbo GX/Venus OS into a single repository:
- axiom-nmea: Raymarine LightHouse protocol decoder
- dbus-generator-ramp: Generator current ramp controller
- dbus-lightning: Blitzortung lightning monitor
- dbus-meteoblue-forecast: Meteoblue weather forecast
- dbus-no-foreign-land: noforeignland.com tracking
- dbus-tides: Tide prediction from depth + harmonics
- dbus-vrm-history: VRM cloud history proxy
- dbus-windy-station: Windy.com weather upload
- mfd-custom-app: MFD app deployment package
- venus-html5-app: Custom Victron HTML5 app fork
- watermaker: Watermaker PLC control UI

Adds root README, .gitignore, project template, and per-project
.gitignore files. Sensitive config files excluded via .gitignore
with .example templates provided.

Made-with: Cursor
2026-03-16 17:04:16 +00:00

130 lines
3.5 KiB
Bash

#!/bin/bash
#
# Install GUI v2 plugin for Windy Station
#
# Uses the Venus OS gui-v2 plugin system (requires Venus OS v3.70~45+).
# The plugin appears under Settings -> Integrations -> UI Plugins -> Windy Station.
#
# Unlike the v1 GUI installer, this does NOT patch any system files and
# survives firmware updates automatically.
#
# Usage:
# ./install_gui_v2.sh # Install GUI v2 plugin
# ./install_gui_v2.sh --remove # Remove GUI v2 plugin
#
set -e
INSTALL_DIR="/data/dbus-windy-station"
APP_NAME="dbus-windy-station"
PLUGIN_NAME="WindyStation"
APP_DIR="/data/apps/available/$APP_NAME"
ENABLED_DIR="/data/apps/enabled"
COMPILER="$INSTALL_DIR/compile_gui_v2_plugin.py"
QML_SOURCE="gui-v2-source/${PLUGIN_NAME}_PageSettings.qml"
MIN_GUI_VERSION="v1.2.13"
install_plugin() {
echo "=================================================="
echo "Installing Windy Station GUI v2 plugin..."
echo "=================================================="
if [ ! -f "$INSTALL_DIR/windy_station.py" ]; then
echo "ERROR: Main service not installed. Run install.sh first."
exit 1
fi
if [ ! -f "$COMPILER" ]; then
echo "ERROR: Plugin compiler not found at $COMPILER"
exit 1
fi
if [ ! -f "$INSTALL_DIR/$QML_SOURCE" ]; then
echo "ERROR: QML source not found: $INSTALL_DIR/$QML_SOURCE"
exit 1
fi
echo "1. Creating app directory structure..."
mkdir -p "$APP_DIR/gui-v2-source"
mkdir -p "$APP_DIR/gui-v2"
echo "2. Copying QML source and compiler..."
cp "$INSTALL_DIR/$QML_SOURCE" "$APP_DIR/gui-v2-source/"
cp "$COMPILER" "$APP_DIR/gui-v2-source/"
echo "3. Compiling plugin descriptor..."
cd "$APP_DIR/gui-v2-source"
python3 compile_gui_v2_plugin.py \
--name "$PLUGIN_NAME" \
--min-required-version "$MIN_GUI_VERSION" \
--settings "${PLUGIN_NAME}_PageSettings.qml"
if [ ! -f "${PLUGIN_NAME}.json" ]; then
echo "ERROR: Plugin compilation failed - ${PLUGIN_NAME}.json not generated"
exit 1
fi
echo "4. Installing plugin descriptor..."
cp "${PLUGIN_NAME}.json" "$APP_DIR/gui-v2/"
echo "5. Enabling app..."
mkdir -p "$ENABLED_DIR"
if [ -L "$ENABLED_DIR/$APP_NAME" ]; then
rm "$ENABLED_DIR/$APP_NAME"
fi
ln -s "$APP_DIR" "$ENABLED_DIR/$APP_NAME"
echo "6. Restarting GUI..."
if [ -d /service/start-gui ]; then
svc -t /service/start-gui
sleep 2
fi
echo ""
echo "=================================================="
echo "GUI v2 plugin installed!"
echo "=================================================="
echo ""
echo "Navigate to: Settings -> Integrations -> UI Plugins -> Windy Station"
echo ""
}
remove_plugin() {
echo "=================================================="
echo "Removing Windy Station GUI v2 plugin..."
echo "=================================================="
if [ -L "$ENABLED_DIR/$APP_NAME" ]; then
rm "$ENABLED_DIR/$APP_NAME"
echo "1. Removed app symlink"
else
echo "1. App symlink not found (already removed)"
fi
if [ -d "$APP_DIR" ]; then
rm -rf "$APP_DIR"
echo "2. Removed app directory"
else
echo "2. App directory not found (already removed)"
fi
echo "3. Restarting GUI..."
if [ -d /service/start-gui ]; then
svc -t /service/start-gui
sleep 2
fi
echo ""
echo "GUI v2 plugin removed."
echo ""
}
case "$1" in
--remove)
remove_plugin
;;
*)
install_plugin
;;
esac