omarchy-grok-usage/install.sh
Ebeneezer 4df21f20a0 feat: SuperGrok weekly collector for stock Omarchy agents panel
Writes grok.json for omarchy.agents. Yields when official
omarchy-agent-usage-grok exists. No bar plugin, no packaged-bin name.
2026-08-20 15:31:55 -07:00

27 lines
1 KiB
Bash
Executable file

#!/usr/bin/env bash
# Install the household Grok usage collector for the current user.
# Does not touch /usr/share/omarchy and does not install a bar plugin.
set -euo pipefail
root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
src="$root/src/omarchy_grok_usage.py"
bin_dir="${XDG_BIN_HOME:-$HOME/.local/bin}"
unit_dir="${XDG_CONFIG_HOME:-$HOME/.config}/systemd/user"
if [[ ! -f "$src" ]]; then
echo "missing collector source: $src" >&2
exit 1
fi
mkdir -p "$bin_dir" "$unit_dir"
install -m 0755 "$src" "$bin_dir/omarchy-grok-usage"
install -m 0644 "$root/systemd/omarchy-grok-usage.service" "$unit_dir/omarchy-grok-usage.service"
install -m 0644 "$root/systemd/omarchy-grok-usage.timer" "$unit_dir/omarchy-grok-usage.timer"
systemctl --user daemon-reload
systemctl --user enable --now omarchy-grok-usage.timer
systemctl --user start omarchy-grok-usage.service
echo "Installed $bin_dir/omarchy-grok-usage"
echo "Timer: systemctl --user status omarchy-grok-usage.timer"
echo "If an official omarchy-agent-usage-grok later ships, this timer becomes a no-op."