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' ;;