#!/bin/sh -eu options="\ case->lower case->title case->titleize case->upper lorem->paragraph lorem->title reverse->letters reverse->words text->camelize text->date8601 text->jumbleize text->letterize text->singleline text->slugize text->urlize verse->kjv word->dictionary " selection=$( printf "%s" "$options" | dmenu -i -b -p ⠀:::⠀plumber⠀::: || { [ "$?" = 127 ] && kill -15 "$$" && "$0"; } ) printf "%s\n" "$selection" | while read -r option; do text=$(plumber --option "$option" --text "$(xsel -o)") { notify-send "$text" && printf "%s" "$text" | xsel -ib; } || notify-send "Plumber: Clipboard selection is empty" done