-
Notifications
You must be signed in to change notification settings - Fork 897
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
Showing
1 changed file
with
30 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,30 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Dependency: This script requires `jq` cli installed: https://stedolan.github.io/jq/ | ||
# Install via homebrew: `brew install jq` | ||
|
||
# Required parameters: | ||
# @raycast.schemaVersion 1 | ||
# @raycast.title Random Emoji | ||
# @raycast.mode silent | ||
# @raycast.packageName Emojis | ||
|
||
# Optional parameters: | ||
# @raycast.icon 🎲 | ||
|
||
# Documentation: | ||
# @raycast.description Copy a random emoji to the clipboard. | ||
# @raycast.author Tomohiro Nishimura | ||
# @raycast.authorURL https://github.com/Sixeight | ||
|
||
LANG="en_US.UTF-8" | ||
|
||
if ! command -v jq &> /dev/null; then | ||
echo "jq command is required (https://github.com/jqlang/jq)."; | ||
exit 1; | ||
fi | ||
|
||
mapfile -t EMOJIS < <(curl -s https://raw.githubusercontent.com/github/gemoji/master/db/emoji.json | jq -r '.[] | .emoji') | ||
EMOJI="${EMOJIS[$RANDOM % ${#EMOJIS[@]}]}" | ||
echo -n "$EMOJI" | pbcopy | ||
echo "$EMOJI" |