Initial commit
This commit is contained in:
parent
4690072f2b
commit
97a02aa86e
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
emojis.txt
|
20
dmenuunicode
Executable file
20
dmenuunicode
Executable 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
28
populate_emojis.sh
Executable 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!"
|
||||
|
Loading…
x
Reference in New Issue
Block a user