-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5684291
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |