diff options
Diffstat (limited to '.local/bin/plumber-dmenu')
-rwxr-xr-x | .local/bin/plumber-dmenu | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/.local/bin/plumber-dmenu b/.local/bin/plumber-dmenu index bdfe28e..ea141c2 100755 --- a/.local/bin/plumber-dmenu +++ b/.local/bin/plumber-dmenu @@ -1,15 +1,32 @@ #!/bin/sh -eu -options="First letter of each word in sentence -Single line of text -Thesaurus -KJV Verse Lookup -Title Case + +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 " -printf "%s" "$options" \ - | dmenu -i -b -p Plumb \ - | 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 + +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 |