Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
silgon committed Aug 23, 2024
0 parents commit 5684291
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Emoji Search Bash (EMS)
This is a small script I decided to make because I needed some emojis (also because I spend most of my time in the shell).



This is inspired on [wofi-emoji](https://github.com/Zeioth/wofi-emoji). Actually, it was me trying to use it and I realized i needed wayland (which I do not want). I read the code and I created this small repo.
26 changes: 26 additions & 0 deletions ems
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
EMOJI_FILE=~/.emojis.txt
function download(){
curl https://raw.githubusercontent.com/muan/emojilib/v3.0.12/dist/emoji-en-US.json \
| jq --raw-output '. | to_entries | .[] | .key + " " + (.value | join(" ") | sub("_"; " "; "g"))' \
> $EMOJI_FILE
}
function f(){
if [ ! -e "$EMOJI_FILE" ]; then
$(download)
fi
cat $EMOJI_FILE | awk "/($1)/ {print \$1}"
}

if [[ "$1" == "-u" ]]; then
echo "updating or downloading files"
download
else
elements=$(f $1)
elements+=("exit")
select i in ${elements[@]}; do
if [ $i == "exit" ]; then break; fi
echo -n $i|xclip -selection clipboard; echo "$i copied to clipboard";
break;
done
fi

0 comments on commit 5684291

Please sign in to comment.