aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/plumber-dmenu
blob: 31e200dc6cfcc32bc5519fa7aba064fe1b964831 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh -eu
options="\
First Letter Word
Single Line
Slug
Title Case
Lower Case
Lorem Title
Lorem Paragraph
Thesaurus
KJV Verse Lookup
"
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