This commit is contained in:
Hadi 2024-03-20 22:44:32 +01:00
parent e97e2705b5
commit ce2e0c2fa8

View File

@ -4,10 +4,10 @@ let
nerdfont-fzf = pkgs.writeShellScriptBin "nerdfont-fzf" '' nerdfont-fzf = pkgs.writeShellScriptBin "nerdfont-fzf" ''
# Dependencies: jq, fzf, wl-copy, wget # Dependencies: jq, fzf, wl-copy, wget
icons=$(jq -r 'to_entries[] | "\(.key):\(.value.char)"' "${homedir}/.config/nerdfont_glyphnames.json" | awk -F: '{print "\033[95m"$2"\033[0m "$1}') icons=$(jq -r 'to_entries[] | "\(.key):\(.value.char)"' "${homedir}/.config/nerdfont_glyphnames.json" | awk -F: '{print "\033[95m "$2" \033[0m "$1}')
fzf_result=$(echo "$icons" | fzf --ansi | awk '{print $1}') || exit 1 fzf_result=$(echo "$icons" | fzf --ansi | awk '{print $1}' || exit 1)
echo "Copied to clipboard: \033[95m$fzf_result\033[0m" echo "Copied to clipboard: $fzf_result"
printf "$fzf_result" | wl-copy printf "$fzf_result" | wl-copy
''; '';