#!/bin/sh character_list="kvmap_list.txt" sep=":" cd "$(dirname "$0")" || exit 1 selected_string=$(rofi -dmenu -i -sync -p "key" "$@" < "$character_list") selected_symbol=$(printf '%s' "$selected_string" | cut -d "$sep" -f 2-) #trim whitespace #selected_symbol=${selected_symbol// } for selection in clipboard primary; do printf '%s' "$selected_symbol" | tr -d '\n' | xsel --logfile /dev/null -i --"$selection" done # vim: expandtab sw=2 ts=2