From 747f5d1feb767be1562d7c6bbef42db12f4c44b5 Mon Sep 17 00:00:00 2001 From: lhark Date: Thu, 21 Nov 2019 00:06:23 +0000 Subject: [PATCH] [cliplumber] Add rot13 feature --- bin/cliplumber | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/cliplumber b/bin/cliplumber index bc4473b..96849c7 100755 --- a/bin/cliplumber +++ b/bin/cliplumber @@ -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' ;;