lib/qr.sh

331 B · 17 lines · bash

1#!/usr/bin/env bash
2
3brt_qr() {
4 local text="${*:-}"
5 if [[ -z "$text" ]]; then
6 brt_error "Usage: brt -qr <text>"
7 exit 1
8 fi
9
10 if command -v qrencode &>/dev/null; then
11 qrencode -t ANSIUTF8 "$text"
12 else
13 brt_warn "qrencode not installed. Text: ${text}"
14 brt_info "Install with: brew install qrencode"
15 fi
16}
17