Skip to main content
Version: 1.5

QR Codes

 ██████╗ ██████╗    ██████╗ ██████╗ ██████╗ ███████╗
██╔═══██╗██╔══██╗  ██╔════╝██╔═══██╗██╔══██╗██╔════╝
██║   ██║██████╔╝  ██║     ██║   ██║██║  ██║█████╗  
██║▄▄ ██║██╔══██╗  ██║     ██║   ██║██║  ██║██╔══╝  
╚██████╔╝██║  ██║  ╚██████╗╚██████╔╝██████╔╝███████╗
╚══▀▀═╝ ╚═╝  ╚═╝   ╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝

The dms qr command generates QR codes from text, stdin, or saved WiFi networks. Codes render directly in the terminal, export as PNG files, or copy straight to the clipboard — making it useful both interactively and from scripts or plugins.

Quick Start

# Render in the terminal
dms qr "https://example.com"

# Save a PNG
dms qr "https://example.com" -o code.png

# Pipe PNG bytes anywhere
dms qr "https://example.com" > code.png

# Share your WiFi
dms qr wifi MyNetwork

Input Sources

SourceCommand
Argumentdms qr "some text"
Stdin (piped)echo -n "data" | dms qr
Stdin (explicit)dms qr -
Saved WiFi networkdms qr wifi <ssid>

Output Destinations

Output is automatic by default: a terminal render when stdout is a TTY, raw PNG bytes when piped. Destinations can be combined freely.

FlagDescription
--output / -oSave a PNG to a file
--stdoutWrite PNG bytes to stdout
--clipboardCopy the PNG image to the clipboard
--copy-textCopy the source text to the clipboard
--renderForce terminal rendering
--no-renderNever render to the terminal

When PNG bytes go to stdout and --render is also set, the terminal render goes to stderr so the streams stay separate:

dms qr "text" --stdout --render > code.png # PNG in file, preview on screen

Encoding Options

FlagDescription
--eccError correction level: L, M, Q, H (default M, or H with --logo)
--qr-versionForce QR symbol version 1-40 (default: auto)

Higher error correction makes the code denser but more damage-resistant. H survives ~30% obstruction, which is why it becomes the default when a logo is overlaid.

Styling Options

PNG

FlagDescription
--module-sizePixels per module, 1-255 (default: auto)
--fgDark module color (#RGB or #RRGGBB)
--bgLight module color (#RGB or #RRGGBB)
--transparentTransparent background (overrides --bg)
--borderBorder width in pixels (default: auto)
--shapeModule shape: square (default) or circle
--logoCenter a PNG/JPEG logo on the code
--logo-scaleMax logo size as 1/N of the code (default: 5)
# Themed, rounded modules with a logo
dms qr "https://danklinux.com" \
--shape circle \
--fg '#1a1b26' --bg '#c0caf5' \
--logo ~/Pictures/logo.png \
-o branded.png
tip

A logo larger than 1/N of the final image is skipped by the renderer. If your logo doesn't appear, raise --module-size or --logo-scale.

note

Circle modules are an aesthetic choice — modern phone scanners read them fine, but some older decoders only handle square modules.

Terminal

FlagDescription
--invertSwap colors (for light terminals)
--quiet-zoneMargin around the code in modules (default: 2)
--fg / --bgOverride the render colors

Terminal rendering paints both polarities explicitly, so codes scan correctly on dark and light terminal themes alike. If a scanner still struggles, try --invert.

WiFi QR Codes

dms qr wifi builds a code that joins a network when scanned.

# Pull the saved password from the running DMS shell
dms qr wifi MyNetwork

# Fully offline with an explicit password
dms qr wifi MyNetwork -p 'hunter2'

# Open network
dms qr wifi CoffeeShop --security nopass
FlagShortDescription
--password-pWiFi password (builds offline, no shell needed)
--securitySecurity type: WPA (default), WEP, nopass
--hiddenMark the network as hidden

Without --password, the saved credentials are fetched from the running DMS shell — the same mechanism the network panel uses. Special characters in SSIDs and passwords are escaped automatically.

All output and styling flags work here too:

dms qr wifi MyNetwork --clipboard --no-render
dms qr wifi MyNetwork -o guest-wifi.png --module-size 16

Scripting & Plugins

Since piped output is raw PNG and errors go to stderr with a non-zero exit code, dms qr composes cleanly:

# QR of the current clipboard contents
dms clipboard paste | dms qr

# Show a file's contents as a code in a notification-sized PNG
dms qr - < token.txt --module-size 8 -o /tmp/token.png

# Feed another tool without touching disk
dms qr "otpauth://totp/..." --stdout | imv -

All Options

FlagShortDescription
--eccError correction: L, M, Q, H (default M, or H with --logo)
--qr-versionForce QR symbol version 1-40 (0 = auto)
--output-oWrite a PNG to this file
--stdoutWrite PNG bytes to stdout
--clipboardCopy the PNG image to the clipboard
--copy-textCopy the source text to the clipboard
--renderForce terminal rendering
--no-renderNever render to the terminal
--invertSwap colors (for light terminals)
--quiet-zoneTerminal margin in modules (default: 2)
--module-sizePNG pixels per module (0 = auto)
--fgDark module color (#RGB or #RRGGBB)
--bgLight module color (#RGB or #RRGGBB)
--transparentTransparent PNG background
--borderPNG border in pixels (-1 = auto)
--shapePNG module shape: square, circle
--logoCenter a PNG/JPEG logo on the PNG output
--logo-scaleMax logo size as 1/N of the code (0 = default of 5)
--help-hShow help