#!/bin/sh

# use first argument or stdin as input
encoded=$(printf '%s' "${1:-$(cat -)}" | base64)
printf '\033]52;c;%s\a' "$encoded" >/dev/tty
