From 5c916d69d457101326803eb076a746060e3618cf Mon Sep 17 00:00:00 2001 From: Vikas Kushwaha Date: Thu, 21 Nov 2024 13:30:52 +0530 Subject: Moved from github --- .local/bin/fcode | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 .local/bin/fcode (limited to '.local/bin/fcode') diff --git a/.local/bin/fcode b/.local/bin/fcode new file mode 100755 index 0000000..8da7a17 --- /dev/null +++ b/.local/bin/fcode @@ -0,0 +1,23 @@ +#!/bin/sh + +# 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')" + echo "$chosen" | xclip -selection clipboard + notify-send "'$chosen' copied to clipboard." + exit +fi + +cut -d ';' -f1 ~/.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 {+})' -- cgit v1.2.3