aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/plumber-dmenu
blob: 262d099d0691c39825410250f8c54566bdfbf2ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh -eu
options="\
text->camelize
text->date8601
word->dictionary
text->first-letter-words
verse->kjv
lorem->paragraph
lorem->title
case->lower
text->single-line
text->slugize
case->title
"
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