summaryrefslogtreecommitdiff
path: root/ar/.local/bin/emojiupdate
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-06-28 19:03:01 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-06-28 19:03:01 +0900
commitcbd1d349a511da7a861540a5d6ea954d4d06871b (patch)
tree92b932d351a9474e7fd0f12c6c973274daaaa0d9 /ar/.local/bin/emojiupdate
parent74cb5de14fc06fe97b6fc306f6176f7d6b467b6b (diff)
updates
Diffstat (limited to 'ar/.local/bin/emojiupdate')
-rwxr-xr-xar/.local/bin/emojiupdate38
1 files changed, 11 insertions, 27 deletions
diff --git a/ar/.local/bin/emojiupdate b/ar/.local/bin/emojiupdate
index 861c9b0..7185a4d 100755
--- a/ar/.local/bin/emojiupdate
+++ b/ar/.local/bin/emojiupdate
@@ -1,34 +1,18 @@
#!/bin/sh
-##
-## For fontawesome icons update, run the command block in terminal.
-##
-# curl -sSL -o icons_raw.json "https://raw.githubusercontent.com/FortAwesome/Font-Awesome/master/metadata/icons.json" &&
-# jq -r 'to_entries[] | select(.value.unicode) | .value.unicode + " " + .key' "icons_raw.json" |
-# while read -r hex name; do
-# hex_uc=$(printf '%s' "$hex" | tr '[:lower:]' '[:upper:]')
-# if [ "${#hex_uc}" -le 4 ]; then
-# unicode="\\u$hex_uc"
-# else
-# unicode="\\U$(printf '%08X' "0x$hex_uc")"
-# fi
-#
-# printf "%b %s; %s\n" "$unicode" "$name" "$hex"
-# done > "${XDG_DOTFILES_DIR:-$HOME/.dotfiles}/global/.local/share/thesiah/chars/icons"
-
# Define input and output files
-URL="https://unicode.org/Public/emoji/latest/emoji-test.txt"
-INPUT_FILE="${XDG_DOTFILES_DIR:-${HOME}/.dotfiles}/global/.local/share/thesiah/chars/emoji_raw"
-TEMP_FILE="${XDG_DOTFILES_DIR:-${HOME}/.dotfiles}/global/.local/share/thesiah/chars/emoji_temp"
-OUTPUT_FILE="${XDG_DOTFILES_DIR:-${HOME}/.dotfiles}/global/.local/share/thesiah/chars/emoji"
+url="https://unicode.org/Public/emoji/latest/emoji-test.txt"
+input_file="${XDG_DOTFILES_DIR:-${HOME}/.dotfiles}/global/.local/share/thesiah/chars/emoji_raw"
+temp_file="${XDG_DOTFILES_DIR:-${HOME}/.dotfiles}/global/.local/share/thesiah/chars/emoji_temp"
+output_file="${XDG_DOTFILES_DIR:-${HOME}/.dotfiles}/global/.local/share/thesiah/chars/emoji"
# Create the directory for output files if it doesn't exist
-mkdir -p "$(dirname "$INPUT_FILE")"
+mkdir -p "$(dirname "$input_file")"
# Download the emoji file
echo "Downloading emoji-test.txt from Unicode..."
-if curl -o "$INPUT_FILE" -L "$URL"; then
- echo "Download complete! File saved to: $INPUT_FILE"
+if curl -o "$input_file" -L "$url"; then
+ echo "Download complete! File saved to: $input_file"
else
echo "Failed to download emoji"
exit 1
@@ -49,7 +33,7 @@ awk '
# Print valid lines
{ print }
-' "$INPUT_FILE" >"$TEMP_FILE"
+' "$input_file" >"$temp_file"
# Second stage: Extract emoji and description
awk -F'#' '
@@ -75,7 +59,7 @@ awk -F'#' '
print emoji, description
}
}
-' "$TEMP_FILE" >"$OUTPUT_FILE"
+' "$temp_file" >"$output_file"
-rm -rf "$INPUT_FILE" "$TEMP_FILE"
-echo "Processing complete! File saved to: $OUTPUT_FILE"
+rm -rf "$input_file" "$temp_file"
+echo "Processing complete! File saved to: $output_file"