Skip to content

USB safe-eject via Mac Trash drag (mirror standard Mac UX) #3

Description

@bryanwintermute

Background

The standard Mac UX for ejecting a removable volume is "drag the volume icon to the Trash." Currently, USB sticks appear as sub-folders of the Unix volume (not as standalone Mac volumes), so the drag-to-Trash UX doesn't apply — and dragging the sub-folder to Trash would fail with a kernel EBUSY (the host path is a mountpoint, can't be rename()d).

Three pieces required in concert

  1. Refactor outside-world role to mount USB sticks at /run/chimebox-usb/<dev> and put symlinks at outside-world/USB-*. Mac's rename-into-Trash then succeeds (it's renaming a symlink, not a mountpoint).
  2. New host-side inotify watcher on outside-world/Trash/ that detects USB-* arrivals; after a 2s grace period (undo window) it umounts the corresponding device and removes the symlink.
  3. Custom disk-shaped icons for USB sub-folders so the kid intuits "this looks like a disk, drag-to-Trash means eject" (the standard Mac volume eject mental model).

Without (3), the kid won't drag because she fears losing her photos (just looks like a normal folder labeled "delete").

Until then

Use #2 (hotkey path).

Discovered

2026-05-14 in conversation about USB safety.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    polishUX or codebase polish; not blockingresearchSpike to investigate before committing to an approach

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions