Herdr plugin that adds one action: third774.last-workspace.toggle.
Use it to jump back to the workspace you were just using. Focus workspace A, move to workspace B, run the action, and Herdr focuses A. Run it again and Herdr focuses B.
The plugin tracks stable Herdr workspace IDs instead of workspace numbers, so it keeps working when workspace ordering changes.
Requires Herdr >= 0.7.0. The current manifest builds from source with Cargo, so you also need a local Rust toolchain.
herdr plugin install third774/herdr-last-workspaceHerdr clones the repo, runs the manifest build step, and registers the plugin action. Manage it with:
herdr plugin list
herdr plugin action list --plugin third774.last-workspace
herdr plugin uninstall third774.last-workspaceAdd a [[keys.command]] entry to your Herdr config, usually ~/.config/herdr/config.toml:
[[keys.command]]
key = "prefix+tab"
type = "plugin_action"
command = "third774.last-workspace.toggle"
description = "last workspace"Reload Herdr config after editing:
herdr server reload-configThen press your Herdr prefix (default ctrl+b) followed by the bound key.
The first run usually records the current workspace and does not move focus because there is no previous workspace yet.
After you have focused at least two workspaces, running third774.last-workspace.toggle focuses the previously focused workspace. The next workspace.focused event updates the history, so repeated toggles switch between the same two workspaces.
Normal no-op cases exit cleanly without showing Herdr error toasts:
- No previous workspace has been recorded yet.
- The previous workspace was closed.
- Herdr does not report a focused workspace.
The plugin listens for Herdr's workspace.focused and workspace.closed events.
On focus events, it stores the current and previous workspace IDs under Herdr's plugin state directory. On closed events, it removes a remembered workspace if that workspace was closed. When the toggle action runs, it calls back into Herdr with:
$HERDR_BIN_PATH workspace list
$HERDR_BIN_PATH workspace focus <workspace_id>State is stored as state.json with a state.lock file under HERDR_PLUGIN_STATE_DIR.
cargo build --release
herdr plugin link /path/to/herdr-last-workspaceRun the checks used for development:
cargo fmt --check
cargo test
cargo clippy --all-targets -- -D warningsList registered actions:
herdr plugin action list --plugin third774.last-workspaceCheck plugin logs:
herdr plugin log list --plugin third774.last-workspaceIf the action is missing, reinstall or relink the plugin and confirm the build step completed successfully.