Initial commit

This commit is contained in:
MeaTLoTioN 2023-09-21 15:19:50 +01:00
parent 4690072f2b
commit 97a02aa86e
3 changed files with 49 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
emojis.txt

20
dmenuunicode Executable file
View File

@ -0,0 +1,20 @@
#!/bin/sh
# Give dmenu list of all unicode characters to copy.
# Shows the selected character in dunst if running.
# Must have xclip installed to even show menu.
xclip -h >/dev/null || exit
emojifile="/home/christian/.config/i3/scripts/emojis.txt"
chosen=$(grep -v "#" $emojifile | dmenu -i -l 20 -fn 'Noto Color Emoji Mono-18')
[ "$chosen" != "" ] || exit
c=$(echo "$chosen" | sed "s/ .*//")
echo "$c" | tr -d '\n' | xclip -selection clipboard
notify-send "'$c' copied to clipboard." &
s=$(echo "$chosen" | sed "s/.*; //" | awk '{print $1}')
echo "$s" | tr -d '\n' | xclip
notify-send "'$s' copied to primary." &

28
populate_emojis.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
# Function to add an emoji and its description to the file
function add_emoji {
echo -e "$1 $2" >> emojis.txt
echo -n .
}
# Create or clear the emojis.txt file
> emojis.txt
EMOJI_VERSION="latest"
echo "Retrieving version: $EMOJI_VERSION"
# Process the emojis and descriptions and call the add_emoji function
curl -s "https://unicode.org/Public/emoji/$EMOJI_VERSION/emoji-test.txt" | while read -r line; do
if [[ $line != "#"* ]]; then
if [[ $line == *"#"* ]]; then
unicode=$(echo "$line" | cut -d "#" -f 1 | awk '{$1=$1;print}'|sed 's/ ; fully-qualified//g'|tr '\n' ' '|sed 's/\b\([a-zA-Z0-9]\)/U+\1/g');
emoji=$(echo "$line" | cut -d "#" -f 2 | awk '{$1=$1;print}');
description=$(echo "$line" | cut -d "#" -f 3 | awk '{$1=$1;print}');
add_emoji "$emoji" "$description" "$unicode"
fi
fi
done
echo -e "\nEmojis file created successfully!"