aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/plumber-dmenu
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/plumber-dmenu')
-rwxr-xr-x.local/bin/plumber-dmenu42
1 files changed, 26 insertions, 16 deletions
diff --git a/.local/bin/plumber-dmenu b/.local/bin/plumber-dmenu
index 262d099..ea141c2 100755
--- a/.local/bin/plumber-dmenu
+++ b/.local/bin/plumber-dmenu
@@ -1,22 +1,32 @@
#!/bin/sh -eu
+
options="\
-text->camelize
-text->date8601
-word->dictionary
-text->first-letter-words
-verse->kjv
+case->lower
+case->title
+case->titleize
+case->upper
lorem->paragraph
lorem->title
-case->lower
-text->single-line
+reverse->letters
+reverse->words
+text->camelize
+text->date8601
+text->jumbleize
+text->letterize
+text->singleline
text->slugize
-case->title
+text->urlize
+verse->kjv
+word->dictionary
"
-printf "%s" "$options" \
- | dmenu -i -b -p ⠀:::⠀plumber⠀::: \
- | 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