diff options
Diffstat (limited to '.local/bin/uni')
-rwxr-xr-x | .local/bin/uni | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/.local/bin/uni b/.local/bin/uni index 3ed7ec4..73c6e1c 100755 --- a/.local/bin/uni +++ b/.local/bin/uni @@ -13,18 +13,15 @@ setup() -e 's/\<(.)([A-Z]*)/\1\L\2/2g' \ -e '/^[^;]*;</d' \ -e '/Compatibility/d' \ - -e '/Variation Selector/d' + -e '/Variation Selector/d' \ + -e 's/[^;]*/\\\\u&/' } readonly DATA="${XDG_DATA_HOME:-$HOME/.local/share}/unicode-data" [ -f "$DATA" ] || setup opt="$(cut -d';' -f2 "$DATA" | osel)" -rune="$( - awk -vopt="$opt" -F';' \ - '$2 == opt { printf "\\\\u%s\\\\n", $1; exit }' "$DATA" \ - | xargs printf -)" +rune="$(awk -vopt="$opt" -F';' '$2 == opt { print $1 }' "$DATA" | xargs printf)" wl-copy -n "$rune" \ && notify 'Rune Copied' "The rune ‘$rune’ was copied to the clipboard" |