feat: keep Clipbin recording in the tray
Add native Linux SNI and Windows notification-area trays, single-instance reopening, background startup and login entries. Preserve recording and discovery after close, with clean Quit and reachable no-tray fallbacks. Track capture-source audio delivery independently of silent output tracks and warn without stopping video. Give clip metadata its own row and shape labels at final bounds to avoid GPUI 0.2.2 truncation cache and text-run bugs. Validated with strict workspace checks, 57 tests, Windows core/OBS/probe cross-clippy, all ten capture scenarios, tray/session/clips/playback rigs and narrow/wide screenshots. Document runtime validation gaps.
This commit is contained in:
@@ -42,6 +42,10 @@ cleanup() {
|
||||
wait 2>/dev/null || true
|
||||
# The D-Bus-activated document portal mounts a FUSE filesystem here.
|
||||
fusermount3 -u "${XDG_RUNTIME_DIR}/doc" 2>/dev/null || true
|
||||
if [[ -n "${CLIPBIN_RIG_KEEP_LOGS:-}" ]]; then
|
||||
mkdir -p "${CLIPBIN_RIG_KEEP_LOGS}"
|
||||
cp "${rig_dir}"/*.log "${CLIPBIN_RIG_KEEP_LOGS}/" 2>/dev/null || true
|
||||
fi
|
||||
rm -rf "${rig_dir}"
|
||||
}
|
||||
trap cleanup EXIT
|
||||
@@ -70,6 +74,7 @@ pipewire > "${rig_dir}/pipewire.log" 2>&1 & pids+=($!)
|
||||
wait_for pipewire '[[ -S "${XDG_RUNTIME_DIR}/pipewire-0" ]]'
|
||||
wireplumber > "${rig_dir}/wireplumber.log" 2>&1 & pids+=($!)
|
||||
pipewire-pulse > "${rig_dir}/pipewire-pulse.log" 2>&1 & pids+=($!)
|
||||
echo "${pids[-1]}" > "${rig_dir}/pulse.pid"
|
||||
wait_for pipewire-pulse '[[ -S "${XDG_RUNTIME_DIR}/pulse/native" ]]'
|
||||
# No sound card here: route playback to a virtual sink whose monitor OBS
|
||||
# records as desktop audio.
|
||||
@@ -89,11 +94,12 @@ printf '%s\n' \
|
||||
"max_fps=60" \
|
||||
> "${XDG_CONFIG_HOME}/xdg-desktop-portal-wlr/config"
|
||||
|
||||
export SWAYSOCK="${XDG_RUNTIME_DIR}/clipbin-sway.sock"
|
||||
WLR_BACKENDS=headless WLR_LIBINPUT_NO_DEVICES=1 WLR_HEADLESS_OUTPUTS=1 \
|
||||
sway --config "${XDG_CONFIG_HOME}/sway/config" > "${rig_dir}/sway.log" 2>&1 & pids+=($!)
|
||||
wait_for sway 'compgen -G "${XDG_RUNTIME_DIR}/wayland-*" > /dev/null'
|
||||
WAYLAND_DISPLAY="$(basename "$(compgen -G "${XDG_RUNTIME_DIR}/wayland-*" | grep -v lock | head -1)")"
|
||||
SWAYSOCK="$(compgen -G "${XDG_RUNTIME_DIR}/sway-ipc.*" | head -1)"
|
||||
wait_for "sway IPC" '[[ -S "${SWAYSOCK}" ]]'
|
||||
export WAYLAND_DISPLAY SWAYSOCK
|
||||
dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_RUNTIME_DIR XDG_CONFIG_HOME SWAYSOCK
|
||||
/usr/lib/xdg-desktop-portal-wlr > "${rig_dir}/xdpw.log" 2>&1 & pids+=($!)
|
||||
@@ -126,7 +132,5 @@ export CLIPBIN_RIG_DIR="${rig_dir}"
|
||||
echo "rig: ready (${mode}, logs in ${rig_dir})" >&2
|
||||
status=0
|
||||
"$@" || status=$?
|
||||
if [[ -n "${CLIPBIN_RIG_KEEP_LOGS:-}" ]]; then
|
||||
mkdir -p "${CLIPBIN_RIG_KEEP_LOGS}" && cp "${rig_dir}"/*.log "${CLIPBIN_RIG_KEEP_LOGS}/"
|
||||
fi
|
||||
|
||||
exit "${status}"
|
||||
|
||||
Reference in New Issue
Block a user