summaryrefslogtreecommitdiff
path: root/.local/bin/fcode
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/fcode')
-rwxr-xr-x.local/bin/fcode7
1 files changed, 3 insertions, 4 deletions
diff --git a/.local/bin/fcode b/.local/bin/fcode
index 073bec4..2c8041d 100755
--- a/.local/bin/fcode
+++ b/.local/bin/fcode
@@ -4,9 +4,8 @@
# place your charecter files in plain text in ~/.local/share/chars/*
if [ "$OPENFLAG" = 0 ]; then
- notify-send fzf-unicode "$*"
chosen="$(printf '%s\n' "$@" | cut -d\ -f1 | tr -d '\n')"
- echo "$chosen" | xclip -selection clipboard
+ printf "%s" "$chosen" | xclip -selection clipboard
notify-send "'$chosen' copied to clipboard."
exit
fi
@@ -16,10 +15,10 @@ fi
mkdir -pv "$FZF_HISTDIR"
export FZF_HIST="$FZF_HISTDIR/unicode_history"
-cut -d ';' -f1 ~/.local/share/chars/* |
+cat ~/.local/share/chars/* |
fzf -m --history="$FZF_HIST" \
--header="Copy Emojis to Clipboard" --header-first \
--preview 'printf "%s\n" {+} | cut -d\ -f1 | tr -d "\n"' \
--preview-window=nohidden,up,1 \
--bind 'ctrl-/:change-preview-window(down|up)' \
- --bind 'enter:execute(echo {q} >> $FZF_HIST; OPENFLAG=0 fzf-unicode {+})'
+ --bind "enter:execute(echo {q} >> \"$FZF_HIST\"; OPENFLAG=0 \"$0\" {+})"