Cross-platform scripts, widgets, modules, tiles, overrides, and rewrites for:
- Scriptable
- Scripting app
- Egern
- Stash
- Surge
- Shadowrocket
- Loon
- QuantumultX
- Repo wiki doc:
WIKI.md - Web guide page:
/guide
Scriptable/QWeather.jsScriptable/DataGovSG.jsScripting/QWeather/index.tsxScripting/QWeather/widget.tsxScripting/QWeather/shared.tsScripting/DataGovSG/index.tsxScripting/DataGovSG/widget.tsxScripting/DataGovSG/shared.tsScripting/Countdown/index.tsxScripting/Countdown/widget.tsxScripting/Countdown/shared.tsEgern/QWeather.jsEgern/QWeather.yamlEgern/DataGovSG.jsStash/QWeather.jsSurge/QWeather.js
Do not commit personal API keys or private locations into the repo.
Each user should inject their own values through widget parameters, Egern env, or Stash/Surge arguments.
Preferred generic names:
WEATHER_API_KEY: your weather API keyWEATHER_LOCATION: LocationID orlongitude,latitudeWEATHER_API_HOST: defaulthttps://devapi.qweather.com
Backward-compatible QWeather-specific names are also supported:
QWEATHER_KEY: your QWeather API key or tokenQWEATHER_LOCATION: LocationID orlongitude,latitudeQWEATHER_HOST: defaulthttps://devapi.qweather.com
Optional:
QWEATHER_LANG: defaultzhQWEATHER_UNIT:mori, defaultmWEATHER_NAME: custom display name
Example values are provided in .env.example.
This repo now includes a Cloudflare Worker distribution layer for Gins-Scripts.
Files:
wrangler.jsoncsrc/worker.tssrc/lib/catalog.tssrc/pages/...src/layouts/...src/components/...tools/build-distribution.mjspublic/manifest.jsonpublic/{Software}/{Category}/...dist/...
How it works:
pnpm run build:catalogcopies published files intopublic/{Software}/{Category}/..., builds Scripting.scriptingarchives atpublic/Scripting/{Category}/{Project}.scripting, and updatespublic/manifest.jsonpnpm run buildruns the catalog build and then Astro static buildpnpm run r2:syncuploads the generated software/category assets to thegins-scripts-storageR2 bucket- Astro renders the catalog pages into
dist/... - Hono handles the Worker entry, serves canonical URLs plus
/api/manifest, and reads generated software/category asset files from R2 first with static assets as fallback /api/r2/syncstarts the Cloudflare Workflow, which batches every distribution asset into thegins-scripts-r2-syncQueue for parallel R2 writes- canonical URLs follow
/{Software}/{Category}/{Project} src/worker.tsserves canonical pages and raw source aliaseswrangler.jsoncdefines the Worker name asgins-scripts- connect the Worker directly to the GitHub repository in Cloudflare Builds instead of using GitHub Actions
- package management is
pnpm @hono/honois consumed fromjsr
Recommended binding naming:
gins-scripts-assetsgins-scripts-storagegins-scripts-r2-syncgins-scripts-kvgins-scripts-cachegins-scripts-secrets
Deploy:
pnpm install
pnpm run cf:deployCloudflare dashboard settings:
Compatibility date: keep it on the newest date you intentionally supportPlacement:smartBuild command:pnpm run buildDeploy command:pnpm exec wrangler deploy- connect the Worker to the GitHub repo directly from Workers & Pages
Useful routes after deployment:
//Scripting/Scripting/Widget/Scriptable/Widget/Egern/Widget/Egern/Module/Stash/Tile/Surge/Script/manifest.json/api/manifest/Scripting/Widget/Countdown.scripting/Scripting/Widget/Countdown/index.tsx/Scriptable/Widget/QWeather.js/Egern/Module/QWeather.yaml/Scriptable/Widget/QWeather/Scriptable/Widget/DataGovSG/Scripting/Widget/QWeather/index/Scripting/Widget/QWeather/shared/Scripting/Widget/QWeather/widget/Scripting/Widget/DataGovSG/index/Scripting/Widget/DataGovSG/shared/Scripting/Widget/DataGovSG/widget/Scripting/Widget/Countdown/index/Scripting/Widget/Countdown/shared/Scripting/Widget/Countdown/widget/Egern/Widget/QWeather/Egern/Module/QWeather/Egern/Widget/DataGovSG/Stash/Tile/QWeather/Surge/Script/QWeather
Software landing paths are published even when empty:
/QuantumultX/Loon/Shadowrocket
Use widget parameter JSON such as:
{
"WEATHER_API_KEY": "<YOUR_API_KEY>",
"WEATHER_LOCATION": "<LOCATION_ID_OR_LNG_LAT>",
"WEATHER_API_HOST": "https://devapi.qweather.com",
"QWEATHER_LANG": "zh",
"QWEATHER_UNIT": "m",
"WEATHER_NAME": "自定义城市"
}Set the widget env fields in QWeather.yaml.
Pass arguments with the same keys:
WEATHER_API_KEY=<YOUR_API_KEY>&WEATHER_LOCATION=<LOCATION_ID_OR_LNG_LAT>&WEATHER_NAME=自定义城市
- Scriptable version supports small, medium, and large widgets with decorative gradient, hourly sparkline, and optional transparent background image.
- Scripting version uses
Widget.familyplus widget environment values to adapt to full-color and accented rendering. - Egern version uses the JSON widget DSL and supports
systemSmall,systemMedium, andsystemLarge. - Stash Tile and Surge Script are intentionally simpler because those surfaces do not expose the same drawing/layout APIs as iOS widgets.
Set TRANSPARENT_BG_PATH in the script config to a cropped transparent background image if you use a transparent widget workflow.
The widget reads showsWidgetContainerBackground and widgetRenderingMode so the layout stays readable when the system removes or tints the background.
Egern does not expose the same screenshot-crop transparent workflow as Scriptable. This version uses alpha-safe gradients and adaptive colors.
Files:
Scriptable/DataGovSG.jsScripting/DataGovSG/index.tsxScripting/DataGovSG/widget.tsxScripting/DataGovSG/shared.tsEgern/DataGovSG.js
Config:
DATAGOVSG_API_KEYoptional but recommended for production limitsAREAfor area forecast selection, e.g.City,Bedok,WoodlandsTRAFFIC_CAMERA_IDfor Scriptable large widget traffic imageSHOW_TRAFFICastrueorfalseTRANSPARENT_BG_PATHfor Scriptable transparent background image
Use per-user values here too; do not hardcode private keys into the scripts.