From 5940d14ddbdb6f68869f48351083875b11b6abf7 Mon Sep 17 00:00:00 2001 From: Vikas Kushwaha Date: Fri, 7 Feb 2025 18:03:41 +0530 Subject: preview updates --- .local/bin/fcode | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to '.local/bin/fcode') diff --git a/.local/bin/fcode b/.local/bin/fcode index 8da7a17..073bec4 100755 --- a/.local/bin/fcode +++ b/.local/bin/fcode @@ -3,9 +3,6 @@ # fzf-unicode: get a list of emojis or unicode charecters using fzf # place your charecter files in plain text in ~/.local/share/chars/* -FZF_HIST="$HOME/.local/share/fzf/unicode_history" -mkdir -pv ~/.local/share/fzf - if [ "$OPENFLAG" = 0 ]; then notify-send fzf-unicode "$*" chosen="$(printf '%s\n' "$@" | cut -d\ -f1 | tr -d '\n')" @@ -14,6 +11,11 @@ if [ "$OPENFLAG" = 0 ]; then exit fi +[ -z "$FZF_HISTDIR" ] && + export FZF_HISTDIR="${XDG_STATE_HOME:-$HOME/.local/state}/fzf" +mkdir -pv "$FZF_HISTDIR" +export FZF_HIST="$FZF_HISTDIR/unicode_history" + cut -d ';' -f1 ~/.local/share/chars/* | fzf -m --history="$FZF_HIST" \ --header="Copy Emojis to Clipboard" --header-first \ -- cgit v1.2.3