Skip to content

Adapters

Adapters teach enwiro how your productivity environment deals with switching between work contexts and displaying things like terminal sessions, web pages, and other applications. Enwiro delegates platform-specific work to adapters, which is how it can remain platform-agnostic. Not all uses of enwiro require an adapter.

  • i3wm - Makes i3 workspaces working-directory-aware, similar to how tmux sessions work. Also auto-opens URLs and GUI apps on activation.

  • tmux - Maps environments to tmux sessions with automatic creation and attach/switch behavior.

Install the adapter binary (e.g., cargo install enwiro-adapter-i3wm). Enwiro auto-discovers installed adapters - if only one is installed, it is selected automatically and no configuration is needed.

If you have multiple adapters installed, set which one to use in your enwiro configuration (~/.config/enwiro/enwiro.toml):

adapter = "i3wm"

The value after adapter = is the adapter name - the part after the enwiro-adapter- prefix of the binary.

An adapter is a standalone executable that handles four operations:

  • Identify the active environment - tell enwiro which environment the user is currently in (used by enw wrap)
  • Activate an environment - switch to or create a workspace/session for a given environment (used by enw activate)
  • Run a command - spawn a command in a new window or pane within the environment (used by enw run)
  • Listen for switches - emit events when the user changes workspaces/sessions (used by the daemon for activity tracking)

Some enwiro features work without an adapter. For example, enw wrap can run commands in prepared environments using just the environment name - no window manager integration needed. This is useful on headless servers, in CI, or anywhere you want project-directory-aware command execution without graphical workspace management.

Adapters are fairly minimal - sometimes a simple shell script is enough. If your application isn’t supported yet, see Creating an Adapter for the full protocol specification.