aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/plumber-dmenu
blob: bb50a0389d8c3c36783f8d1d955a41effa2bf12d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/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
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