1 Refactor local development flow
javif89 edited this page 2026-06-22 21:45:25 +00:00

Local Development Setup

Prerequisites

  • Nix with flakes enabled
  • direnv

Getting Started

  1. Enter the shell for the project and to direnv allow
  2. Run just reset-db to create & set up the sqlite database at the project root.
  3. Run just install-icons to get the devicons set up in the right directory (you only have to do this once)
  4. (Optional) Create a local waycast.toml in ./xdg/.config/waycast.toml

Running the project

I suggest just run instead of cargo run. cargo run will work, but iced (the UI library), runs very slow in dev builds, so I opted to just run a release build instead. That's what the just run recipe does.

Daemon & UI

The first just run will start the daemon. If you then open a new shell and do just run again, it will send a signal to the daemon to show the UI.

Database

You can use any DB viewer (like datagrip) to inspect the waycast.db sqlite file.

Additional notes

When running from the project directory, waycast detects dev mode by checking for Cargo.toml in the current directory. In dev mode:

  • cache_dir() points to ./xdg/.cache instead of ~/.cache/waycast
  • data_dir() points to ./xdg/.local/share instead of ~/.local/share/waycast
  • Config still reads from the real XDG config path (~/.config/waycast/)

Note: The database path is currently hardcoded to "waycast.db" (relative), so it always uses the file at the workspace root regardless of dev mode. This is a known issue.