#!/bin/sh
# Private weather helper. The session owns refresh timing and reaps each job.
set -eu
root=${INKHUB_REMARKABLE_ROOT:-/home/root/inkhub-dev}
export LIBRA2_WEATHER_LAYOUT="$root/weather.conf"
export LIBRA2_WEATHER_HOME="$root/preferences/home.conf"
export LIBRA2_WEATHER_CURL="$root/bin/remarkable-weather-curl"
export LIBRA2_WEATHER_STATE="${LIBRA2_WEATHER_STATE:-$root/cache/weather/manual}"
export LIBRA2_WEATHER_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
# The session polls completion. Never signal the stock launcher or the app
# lifecycle's SIGUSR1 handler after publishing a forecast.
export POWER_LAUNCHER_PROCESS=inkhub-weather-no-signal
exec "$root/bin/libra2-weather" "$@"
