Imported from prdlk/dotfiles master (efdd827). Drops the niri, Hyprland/Omarchy, macOS, and Blume docs-site layers; docs/ is plain Markdown.
18 lines
351 B
Bash
Executable File
18 lines
351 B
Bash
Executable File
#!/bin/sh
|
|
# Fetch a URL as markdown, copy to clipboard, preview with mdfried.
|
|
url=$1
|
|
if [ -z "$url" ]; then
|
|
echo "usage: mdcp <url>" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if command -v wl-copy >/dev/null 2>&1; then
|
|
copy=wl-copy paste=wl-paste
|
|
else
|
|
echo "mdcp: no clipboard tool (wl-copy) found" >&2
|
|
exit 1
|
|
fi
|
|
|
|
curl.md "$url" | "$copy"
|
|
"$paste" | mdfried
|