---
name: switch-desk
description: Switch the shared monitor, keyboard and mouse to another computer. Use when the user says things like "switch to my mac", "switch to windows", "go to the pc", "move the desk to my work laptop".
argument-hint: <target>
model: haiku
allowed-tools: PowerShell(SwitchDesk.exe --switch *), PowerShell(SwitchDesk.exe --list), Bash(/Applications/SwitchDesk.app/Contents/MacOS/SwitchDesk --switch *), Bash(/Applications/SwitchDesk.app/Contents/MacOS/SwitchDesk --list), Bash(~/Applications/SwitchDesk.app/Contents/MacOS/SwitchDesk --switch *), Bash(~/Applications/SwitchDesk.app/Contents/MacOS/SwitchDesk --list)
---

# Switch desk

The SwitchDesk app on this computer knows the targets the desk can be handed to
and resolves what the user called it (an id, a name or an alias set up in the
app). Pass the user's words for the computer, nothing more: "my mac", "the pc",
"work laptop". Run exactly one command, with no other tool calls before it, typed
exactly as written below with only `<target>` changed: only this form is pre-approved.

**On Windows** (PowerShell tool). Keep the quotes and the `| Out-String`, which
makes the command wait and return its output:

```
SwitchDesk.exe --switch "<target>" | Out-String
```

**On macOS** (Bash tool), with the app in Applications:

```
/Applications/SwitchDesk.app/Contents/MacOS/SwitchDesk --switch "<target>"
```

If that answers `no such file or directory`, the app is in the Applications folder of
the user's home instead; run the same command with `~/Applications/SwitchDesk.app`.
That is not a retry: nothing was switched.

Then:

- Exit code 0: reply with one short line saying where the desk went.
- Exit code 2 (`Unknown target`, or `Ambiguous target` when the words match more
  than one): the output lists the known targets, or the ones that matched, one per
  line as `id  Name  (aliases: …)`. Ask the user which one they mean, then run the
  command once more with that id.
- Any other failure: reply with the error output. Do not retry: the screen and
  keyboard may already have moved.

To list targets without switching, the same command with `--list` instead of
`--switch "<target>"` is also pre-approved.
