#!/bin/bash source "/usr/lib/sp-functions" source "${conf_dir}/config" cb_count=$(copyq count) cb_count="${clipboard_length}" wofilist="" for i in $(seq $cb_count);do cb_line="$( copyq read $((${i}-1)) | tr '\n' ' ' )" if [[ "${cb_line}" == "" ]];then cb_line=$( copyq read ? "$((${i}-1))" | head -n 1 ) fi wofilist="${wofilist}${setnl}${i}. ${cb_line}" setnl="\n" done selected=$( echo -e "${wofilist}" | wofi -i --dmenu -k /dev/null | cut -d. -f1) copyq select "$(( ${selected}-1)) "