From 3b08c19e02f3791755679f9827ae03cd099625ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Sun, 21 Aug 2022 01:03:24 +0200 Subject: [PATCH] feat(unicodmenu): uniq and correct order --- packages/scripts/unicodmenu.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/scripts/unicodmenu.nix b/packages/scripts/unicodmenu.nix index 40cb7e2..092f700 100644 --- a/packages/scripts/unicodmenu.nix +++ b/packages/scripts/unicodmenu.nix @@ -76,8 +76,14 @@ in # ref https://github.com/LukeSmithxyz/voidrice/blob/9fe6802122f6e0392c7fe20eefd30437771d7f8e/.local/bin/dmenuunicode writers.writeDashBin "unicodmenu" '' history_file=$HOME/.cache/unicodmenu - PATH=${lib.makeBinPath [coreutils dmenu gnused libnotify xclip xdotool]} - chosen=$(cat "$history_file" ${kaomoji-file} ${unicode-file} | dmenu -p unicode -i -l 10 | tee --append "$history_file" | sed "s/ .*//") + PATH=${lib.makeBinPath [coreutils dmenu gawk gnused libnotify xclip xdotool]} + + all_characters() { + tac "$history_file" + cat ${kaomoji-file} ${unicode-file} + } + + chosen=$(all_characters | awk '!seen[$0]++' | dmenu -p unicode -i -l 10 | tee --append "$history_file" | sed "s/ .*//") [ "$chosen" != "" ] || exit