Step Tracker RPC is a Rust project with two binaries:
rpc: console process that polls your API and updates Discord Rich Presencegui: desktop controller for editing config and starting/stoppingrpc
The Rich Presence rotates between enabled activities:
- Steps
- Water
- Sleep
src/bin/rpc.rs: polling, formatting, Discord RPC updates, OBS text file writessrc/bin/gui.rs: desktop UI, tray integration,.envmanagement, process control forrpcsrc/models.rs: shared API DTOs.github/workflows/ci.yml: cross-OS CI test workflow
- Rust stable toolchain
- Discord desktop app running locally
- API token for your step tracker backend
For GUI builds on Linux, native packages are required (GTK/AppIndicator/XDo/OpenSSL dev packages).
rpc only:
- No extra native desktop packages are required beyond Rust toolchain/runtime.
gui on Linux:
- Requires native GUI/linker dependencies in addition to Rust.
Ubuntu/Debian package set (matches CI):
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libglib2.0-dev \
libgtk-3-dev \
libayatana-appindicator3-dev \
libxdo-dev \
libssl-devFedora package set (matches CI):
sudo dnf install -y \
git \
rust \
cargo \
pkgconf-pkg-config \
glib2-devel \
gtk3-devel \
libappindicator-gtk3-devel \
libxdo-devel \
openssl-develNotes:
libxdo-*resolves linker errors likeunable to find library -lxdo.openssl*-develresolvesopenssl-sysdiscovery/build errors.- macOS/Windows usually do not need extra package-manager installs for this project beyond standard Rust toolchains.
Run console RPC:
cargo run --bin rpcRun GUI:
cargo run --features gui --bin guiBuild release binaries:
cargo build --release --bin rpc
cargo build --release --features gui --bin guirpc loads environment variables with dotenv (from the process working directory).
gui reads/writes a .env at:
- Project dirs path:
com/ThisisLogan/StepTrackerRPC/.env(OS-specific config directory) - Fallback: current working directory
.env
You can edit and save values directly in the GUI.
Required:
API_URLAPI_TOKEN
Feature toggles (default true):
ENABLE_STEPSENABLE_WATERENABLE_SLEEP
Discord app config:
STEPS_DISCORD_CLIENT_IDSTEPS_DISCORD_LARGE_IMAGE_KEYWATER_DISCORD_CLIENT_IDWATER_DISCORD_LARGE_IMAGE_KEYSLEEP_DISCORD_CLIENT_IDSLEEP_DISCORD_LARGE_IMAGE_KEY
Optional OBS/text output files:
OBS_STEPS_FILEOBS_WATER_FILEOBS_SLEEP_FILE
Optional GUI/tray behavior:
GUI_DISABLE_TRAY=trueto force no-tray mode
rpc calls:
GET {API_URL}/api/steps/summary?token={API_TOKEN}GET {API_URL}/api/water/summary?token={API_TOKEN}GET {API_URL}/api/sleep/summary?token={API_TOKEN}&date={YYYY-MM-DD}
Response models are defined in src/models.rs:
StepsSummaryResponseWaterSummaryResponseSleepResponseErrorResponse
- Creates one Discord RPC client per enabled activity.
- Cycles display in order: Steps -> Water -> Sleep (skips disabled entries).
- Sleeps for 30 seconds after each activity update attempt.
- Reconnects Discord RPC clients on connection/panic signals.
- If all activities are disabled, it idles and sleeps.
If configured, the process writes plain text files:
- Steps: today/monthly/yearly (abbreviated numbers)
- Water: today/monthly/yearly display strings from API
- Sleep: today value formatted as
xh ym
Parent directories are created automatically.
- Load/save
.env - Start/stop
rpcchild process - Show process logs in-app
- Tray icon/menu (best effort)
- Close window hides to tray when tray is available
- If tray is unavailable, close exits and stops RPC cleanly
Current tests include:
src/bin/rpc.rsformat_sleep_minutesformat_number
src/bin/gui.rs- bool parsing
- env value encoding
- env read/write round-trip
- no-tray GUI startup smoke test
Run tests locally:
cargo test --bin rpc
cargo test --features gui --bin guiGitHub Actions workflow .github/workflows/ci.yml runs a single matrix card:
ubuntu-latestmacos-latestwindows-latestfedora-latest(via Docker on Ubuntu runner)
Each entry runs:
cargo check --bin rpccargo test --bin rpccargo test --features gui --bin gui
Linux entries install required system packages before GUI tests.
See LICENSE.