From 1b50c5498c5e7502e89fb86c282956c91eb42c46 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Tue, 19 Dec 2023 13:01:03 +0100 Subject: uni: Make use of Andy’s new async builtin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .local/bin/uni | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to '.local/bin') diff --git a/.local/bin/uni b/.local/bin/uni index 34f2711..66b9950 100755 --- a/.local/bin/uni +++ b/.local/bin/uni @@ -19,11 +19,13 @@ func setup { set DATA $(XDG_DATA_HOME:$HOME/.local/share)/unicode-data test -f $DATA || setup -set i `{ - tee >{cut -d';' -f1 | read -d\n runes} <$DATA - | cut -d';' -f2 - | osel -i +func read_runes { + cut -d';' -f1 $DATA | read -gd\n runes } + +async read_runes +set i `cut -d';' -f2 $DATA | osel -i +wait set rune `printf $runes[$i] if test -t 2 { -- cgit v1.2.3