[cliplumber] Add rot13 feature

This commit is contained in:
lhark 2019-11-21 00:06:23 +00:00
parent 5e45d61634
commit 747f5d1feb

View file

@ -29,7 +29,7 @@ fi
urls="$(echo $clip | grep -o 'https\?://[a-zA-Z0-9~#%&_+=,.?/-]\+')"
# Check the requirements for every option
opts=""
opts="rot13"
check_exists "$TERM_EMU" "mpv" "youtube-dl" &&
opts="$(printf "audio-search\n%s" "$opts")"
check_exists "dragon" &&
@ -67,6 +67,13 @@ case "$choice" in
"audio-search")
"$TERM_EMU" --single-instance mpv --ytdl-format=bestaudio ytdl://ytsearch:"$clip"
;;
"rot13")
if [ -z "$WAYLAND_DISPLAY" ]; then
xsel -b -o | tr 'A-Za-z' 'N-ZA-Mn-za-m' | xsel -b -i
else
wl-copy -n "$(wl-paste | tr 'A-Za-z' 'N-ZA-Mn-za-m')"
fi
;;
*)
printf 'Nope\n'
;;