Skip to content

Commit 85d897b

Browse files
Sixeightdehesa
authored andcommitted
Add Random Emoji command
1 parent 118d390 commit 85d897b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
3+
# Dependency: This script requires `jq` cli installed: https://stedolan.github.io/jq/
4+
# Install via homebrew: `brew install jq`
5+
6+
# Required parameters:
7+
# @raycast.schemaVersion 1
8+
# @raycast.title Random Emoji
9+
# @raycast.mode silent
10+
# @raycast.packageName Emojis
11+
12+
# Optional parameters:
13+
# @raycast.icon 🎲
14+
15+
# Documentation:
16+
# @raycast.description Copy a random emoji to the clipboard.
17+
# @raycast.author Tomohiro Nishimura
18+
# @raycast.authorURL https://github.com/Sixeight
19+
20+
LANG="en_US.UTF-8"
21+
22+
if ! command -v jq &> /dev/null; then
23+
echo "jq command is required (https://github.com/jqlang/jq).";
24+
exit 1;
25+
fi
26+
27+
mapfile -t EMOJIS < <(curl -s https://raw.githubusercontent.com/github/gemoji/master/db/emoji.json | jq -r '.[] | .emoji')
28+
EMOJI="${EMOJIS[$RANDOM % ${#EMOJIS[@]}]}"
29+
echo -n "$EMOJI" | pbcopy
30+
echo "$EMOJI"

0 commit comments

Comments
 (0)