5ef38dc46f
- deps guards before -h|--help in docker-health/ps, network-scan, usb-server, media-mp3/mp4 (--dry-run pre-scan kept); system-firewall gains usage()/--help; autostart/usb-automount get flags.sh + template - install.sh: normalize N-M range syntax in --steps - bin/pos: INTERACTIVE_CMDS += docker-compose docker-vbox network-hotspot - common.sh: canonical XDG-aware CONFIG_DIR + DIM color var; notify.sh stderr fallback; ent_plugin_* registry renames (runtime plugin API kept) - docker-compose SCALE_DIR/CONFIG_ENV env seams; ffmpeg in PACKAGES; scrcpy.sh exec bit - docs: health is console-only (--send/--markdown removed), POS.md file refs for config/tree/entertainment, DEV.md no-guard exception, docmap/ filetable regenerated (make gen), hand-maintained line rows bumped - add scripts/lint-conventions.sh gate + Makefile lint target; record all VERIFIED outcomes in MAINTENANCE.md; AGENT_TODO Done entry (2026-08-14) - gates: make gen/check/lint all green (0 FAIL, 0 WARN); bash -n sweep clean; restricted-PATH dep tests + step-matrix dry-runs verified
63 lines
1.8 KiB
Bash
Executable File
63 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
# POS: entertainment status — Show enabled plugins and scheduler state
|
|
|
|
source "$(dirname "$0")/../lib/common.sh" 2>/dev/null || source "$(dirname "$0")/common.sh"
|
|
source "$(dirname "$0")/../lib/entertainment-lib.sh" 2>/dev/null || source "$(dirname "$0")/entertainment-lib.sh"
|
|
|
|
usage() {
|
|
cat <<EOF
|
|
Usage: pos entertainment status
|
|
|
|
Show the enabled plugins (from ENABLED in $CONFIG_FILE),
|
|
the detected scheduler, and the schedule for each plugin.
|
|
|
|
Enable plugins with: pos entertainment enable <plugin> [interval]
|
|
EOF
|
|
exit 0
|
|
}
|
|
|
|
case "${1:-}" in
|
|
-h|--help) usage ;;
|
|
esac
|
|
|
|
raw="$(config_value ENABLED)"
|
|
echo "Config: $CONFIG_FILE"
|
|
|
|
parse_enabled "$raw"
|
|
echo "Enabled plugins:"
|
|
if [ ${#ENABLED_ENTRIES[@]} -eq 0 ]; then
|
|
echo " (none — enable one with: pos entertainment enable <plugin> [interval])"
|
|
fi
|
|
for entry in "${ENABLED_ENTRIES[@]}"; do
|
|
plugin="${entry%%,*}"; interval="${entry##*,}"
|
|
[ "$interval" = "$plugin" ] && interval="$DEFAULT_INTERVAL"
|
|
printf ' %-12s %-16s last run: %s\n' "$plugin" "$(ut_interval_label "$interval")" "$(last_run_str "$plugin")"
|
|
done
|
|
|
|
not_enabled=()
|
|
for name in $(list_plugins "$(ent_plugin_dir)"); do
|
|
found=0
|
|
for entry in "${ENABLED_ENTRIES[@]}"; do
|
|
[ "${entry%%,*}" = "$name" ] && found=1 && break
|
|
done
|
|
[ "$found" -eq 0 ] && not_enabled+=("$name")
|
|
done
|
|
if [ ${#not_enabled[@]} -gt 0 ]; then
|
|
echo
|
|
echo "Installed but not enabled:"
|
|
for name in "${not_enabled[@]}"; do
|
|
printf ' %s\n' "$name"
|
|
done
|
|
fi
|
|
|
|
echo
|
|
if systemctl --user show-environment >/dev/null 2>&1; then
|
|
echo "Scheduler: systemd user timers"
|
|
echo "Timers (systemd --user):"
|
|
systemctl --user list-timers --no-pager 'pos-entertainment-*.timer' 2>/dev/null || \
|
|
echo " (no timers)"
|
|
else
|
|
echo "Scheduler: none available (no systemd user manager)"
|
|
fi
|