Files
battery-tracker-app/sbin
iterminate 65596eee2b Add PWA support — installable as home screen app
Adds Web App Manifest, a minimal Service Worker, and Apple/Android meta
tags so the app can be added to a phone home screen and opens full-screen
in standalone mode (no browser chrome).

- static/manifest.json: name, short_name, display=standalone, icons
- static/sw.js: minimal SW served at /sw.js (root scope) via new Flask route
- static/icon-192.png, icon-512.png: generated by sbin/gen_icons.py (stdlib only)
- base.html: manifest link, theme-color, apple-mobile-web-app-* tags, SW registration
2026-04-13 04:28:11 -05:00
..

sbin — Support Scripts

install-service.sh

Generates a systemd user-level service file and enables it. No root required.

Prerequisites: The app's .venv must exist and have Flask installed.

bash sbin/install-service.sh

You will be prompted for a host (default 127.0.0.1) and port (default 5000). The script writes ~/.config/systemd/user/battery-tracker.service and enables it.

Start the service:

systemctl --user start battery-tracker
systemctl --user status battery-tracker

View live logs:

journalctl --user -u battery-tracker -f

Make it start on login (requires lingering to be enabled for your user):

loginctl enable-linger "$USER"

Uninstall:

systemctl --user disable --now battery-tracker
rm ~/.config/systemd/user/battery-tracker.service
systemctl --user daemon-reload

Re-run to update (e.g. if you moved the app directory):

bash sbin/install-service.sh
systemctl --user restart battery-tracker