dots


dots / config / .local / bin
xxwhirlpool  ·  2026-03-25

lowerd

 1#!/usr/bin/env bash
 2#
 3# usage:
 4#   - `echo "EXAMPLE" | lowerd`
 5#   - `lowerd "EXAMPLE"`
 6#   - `lowerd -i`
 7
 8default() {
 9	tr '[:upper:]' '[:lower:]' | tr -d "\n" | tee >(xclip -selection clipboard) && echo -e "\n"
10}
11
12takearg() {
13	echo "$@" | default
14}
15
16stdinpaste() {
17	gum write --header="paste text here" | tr '[:upper:]' '[:lower:]' | tr -d "\n" | batcat --paging=never | tee >(xclip -selection clipboard) && echo -e "\n"
18}
19
20case "$1" in
21	"") default ;;
22	"-i") stdinpaste ;;
23	*) takearg "$@" ;;
24esac