How sirpdboy/luci-theme-kucat works
1. What this repository is
- This is an OpenWrt LuCI theme/package for the KuCat UI, not a standalone web app.
- Its job is to provide the look-and-feel, layout templates, menu customization, and a small amount of router-side integration for theme settings.
2. Primary runtime boundary
- The main boundary is between the browser-facing LuCI UI and the router-side LuCI/OpenWrt environment.
- Most of the repository is static presentation content served from /www/luci-static/...; only a few pieces touch backend services or boot-time configuration.
3. Static theme asset subsystem
- htdocs/luci-static/kucat/ contains the theme’s front-end assets:
- css/ for the core style and dark theme variants
- js/ for UI behavior
- fonts/, img/, manifest.json, and browserconfig.xml
- background/ documentation and assets related to login/desktop backgrounds
- This is the bulk of the UI surface rendered in the browser.
4. LuCI integration and menu behavior
- htdocs/luci-static/resources/menu-kucat.js is the LuCI-side JavaScript that influences menu presentation/behavior.
- From the README, the theme supports custom menus and a shortcut toolbar; this file is part of the integration layer that makes the theme interact with LuCI’s navigation model.
5. Template rendering subsystem
- ucode/template/themes/kucat/header.ut and footer.ut provide UCode templates for the LuCI page shell.
- These are the server-rendered entry/exit points for newer OpenWrt/LuCI branches, shaping the page structure around the static CSS/JS assets.
6. Backend helper / RPC boundary
- root/usr/libexec/rpcd/luci.kucatget is a router-side executable used by rpcd.
- This suggests the theme or its companion config app can query theme-related state through LuCI’s RPC mechanism rather than embedding logic directly in the browser.
7. Permissions / access control
- root/usr/share/rpcd/acl.d/luci-theme-kucat.json defines the ACLs needed for the rpcd helper.
- Architecturally, this is the authorization boundary that allows LuCI JS or config pages to call the theme helper safely.
8. Boot-time defaults and migration hooks
- root/etc/uci-defaults/30_luci-kuacat and root/etc/uci-defaults/30_luci-kucat are initialization scripts run on installation/first boot.
- These scripts seed or migrate OpenWrt UCI settings so the theme starts with expected defaults.
9. Version compatibility / multi-branch packaging
- The README indicates support for multiple OpenWrt/LuCI generations:
- 18.06 uses the older LuCI stack
- 23.05 / latest uses newer LuCI with UCode support
- The presence of both htdocs/luci-static/... and ucode/template/... shows the repo is structured to serve different LuCI runtime paths depending on the OpenWrt branch.
10. Configuration is split into a companion app
- The README explicitly notes that more advanced theme settings live in a separate package, luci-app-kucat-config.
- So this repository is the theme/runtime base, while the companion app is the configuration UI and settings manager; the theme consumes those settings but doesn’t fully implement that management UI itself.
11. Build and packaging layer
- Makefile and .github/workflows/Build.yml indicate standard OpenWrt-style packaging and CI release automation.
- The repo is intended to be built into an installable IPK that OpenWrt’s package system deploys into the LuCI filesystem layout.
12. Data flow summary
- Build/install places files into the router filesystem.
- LuCI renders headers/footers via UCode templates.
- The browser loads CSS/JS/fonts/images from luci-static.
- Menu/theme-specific behavior may call rpcd helper luci.kucatget through ACL-protected endpoints.
- UCI-default scripts initialize the theme’s persistent configuration.
Main entry points: Makefile Makefile · luci.kucatget RPC helper · style.css Style CSS · header.ut Header template
Components 20
Build & packaging
OpenWrt packaging and CI automation for producing the theme IPK.
Browser theme assets
Static files served to the LuCI browser UI.
- Style CSS · Core theme styling for layout and visuals.
htdocs/luci-static/kucat/css/style.css - Dark CSS · Dark-mode or alternate visual styling.
htdocs/luci-static/kucat/css/dark.css - Style JS · Browser-side behavior for the theme.
htdocs/luci-static/kucat/js/style.js - Footer JS · Additional browser-side behavior loaded near the page end.
htdocs/luci-static/kucat/js/footend.js - Fonts · Theme font assets.
htdocs/luci-static/kucat/fonts/kucat.eot - Images · Theme image assets used by the UI.
htdocs/luci-static/kucat/img - Manifest · Browser install metadata for the theme.
htdocs/luci-static/kucat/manifest.json - Browser config · Windows/legacy browser configuration metadata.
htdocs/luci-static/kucat/browserconfig.xml - Background docs · Documentation for login/desktop background assets.
htdocs/luci-static/kucat/background/README.md
LuCI integration
Theme hooks that shape menus and page structure inside LuCI.
- Menu hook · LuCI-side menu customization and shortcut behavior.
htdocs/luci-static/resources/menu-kucat.js - Header template · Server-rendered page shell entry point.
ucode/template/themes/kucat/header.ut - Footer template · Server-rendered page shell exit point.
ucode/template/themes/kucat/footer.ut
Router backend
Router-side RPC and boot-time configuration hooks.
- Defaults 1 · First-boot or install-time configuration seed/migration script.
root/etc/uci-defaults/30_luci-kuacat - Defaults 2 · First-boot or install-time configuration seed/migration script.
root/etc/uci-defaults/30_luci-kucat - RPC helper · Router-side helper invoked through rpcd for theme-related state.
root/usr/libexec/rpcd/luci.kucatget - RPC ACL · Authorization rules for the theme RPC helper.
root/usr/share/rpcd/acl.d/luci-theme-kucat.json
Connections 23
- Makefile → Header template: packages · Installs the LuCI template files into the image.
- Makefile → Style CSS: packages · Deploys core theme CSS into luci-static.
- Makefile → Style JS: packages · Deploys browser-side theme scripts.
- Makefile → Menu hook: packages · Deploys LuCI navigation customization code.
- Makefile → RPC helper: packages · Installs the rpcd helper into the router filesystem.
- Makefile → RPC ACL: packages · Installs ACL rules for the helper.
- Build CI → Makefile: builds · Automates packaging and release builds.
- Docs → Menu hook: describes · Documents menu and shortcut behavior.
- Docs → RPC helper: describes · Explains router-side integration and settings flow.
- Header template → Style CSS: loads · Brings CSS into the LuCI page shell.
- Header template → Manifest: references · Can surface browser metadata for the theme.
- Header template → Browser config: references · Provides browser-specific metadata.
- Footer template → Style JS: loads · Adds browser behavior at the end of the page.
- Footer template → Footer JS: loads · Includes end-of-page behavior hooks.
- Style JS → Menu hook: coordinates · Shares the LuCI menu behavior layer.
- Menu hook → RPC helper: calls · Queries router-side theme state through rpcd.
- RPC helper → RPC ACL: governed by · Access is constrained by rpcd ACL rules.
- Defaults 1 → RPC helper: initializes · Seeds theme state used by helper-backed features.
- Defaults 2 → RPC helper: initializes · Seeds or migrates theme state on install.
- Background docs → Images: documents · Explains background asset usage.
- Style CSS → Images: uses · References image assets for the theme.
- Style CSS → Fonts: uses · References bundled fonts.
- Dark CSS → Style CSS: extends · Alternative styling variant builds on the core CSS.