Sinks & shell
Every successful capture fans out to one or more sinks. Disk and clipboard are built in; a shell command is the power-user "send it anywhere" option.
#Built-in sinks
[sinks]
clipboard = true # image lands on the macOS clipboard
disk = true # image saved under save_folderCombined with [general].copy_on_capture, you have fine-grained
control over which captures hit the clipboard.
#Shell sink
The shell sink runs an arbitrary command after every capture, with the
file path substituted for $1:
[sinks]
shell = "scp $1 user@host:/var/www/img/"Mechanics:
- The command is invoked as
/bin/sh -c "<your command>" -- <path>, so positional$1works idiomatically. - The child is spawned detached (
stdin/stdout/stderr→/dev/null) so a slow uploader can never stall the capture pipeline. - Empty / whitespace-only
shellis a no-op.
#Examples
#Upload to S3 with rclone
[sinks]
shell = "rclone copy $1 s3:my-bucket/screenshots/"#scp to a personal web server
[sinks]
shell = "scp $1 mhorner@home.example.com:/var/www/img/"#Slack via the Slack CLI
[sinks]
shell = "slack file upload --channels '#design' $1"#A custom uploader returning a URL
Write a tiny shell script that uploads and copies the resulting URL back to your clipboard:
#!/usr/bin/env bash
# /usr/local/bin/upload-shot
set -euo pipefail
URL=$(curl -fsSL --upload-file "$1" https://yourservice/upload/)
printf '%s' "$URL" | pbcopy[sinks]
shell = "/usr/local/bin/upload-shot $1"#Per-mode shell overrides
Want region captures to land on S3 while videos go to your team's Slack? Each capture mode can have its own shell command that overrides the global one:
[sinks]
shell = "rclone copy $1 cloud:misc/"
shell_region = "" # falls back to shell
shell_window = "scp $1 user@host:/var/www/img/"
shell_fullscreen = "" # falls back to shell
shell_video = "scp $1 home.example.com:/var/www/recordings/"
shell_gif = "/usr/local/bin/upload-shot $1"Empty (or whitespace-only) overrides fall back to the global shell.
Set the global to "" if you want a mode-specific command to be
the only shell sink that fires.
#Why no built-in cloud uploader?
Building a "share to URL" feature would mean shipping a hosted service or binding to specific cloud providers. The shell sink is more flexible and keeps the binary entirely network-free in its default configuration. Open Little Snitch — it'll never light up.