aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/plumber-dmenu
blob: 9779223d56f9c0449fd3f3154feb7d782755c700 (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 ⠀:::⠀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