#!/usr/bin/env sh # zbarcam opens an X11 preview window, so DISPLAY must reach XWayland. # Fall back to :0 (sway's default XWayland display) if it's missing. export DISPLAY="${DISPLAY:-:0}" text="$(zbarcam -q -1 --raw)" printf '%s' "$text" | wl-copy echo "$text" notify-send "$text"