mirror of
https://github.com/CoolnsX/hyprdots.git
synced 2025-12-20 07:15:23 +05:30
pgsql is more strict, increase the hackiness up to 11
This commit is contained in:
36
hypr/bemoji
Executable file
36
hypr/bemoji
Executable file
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
|
||||
menu() {
|
||||
bemenu --fn 'Cascadia Mono 15' -i -c -W "0.${2:-4}" -B 3 -l 20 -p "$1" --bdr="#$GLOBAL_ACCENT" --tf="#$GLOBAL_ACCENT" --hf="#$GLOBAL_ACCENT"
|
||||
}
|
||||
|
||||
notify() {
|
||||
notify-send "$1" -h "string:x-canonical-private-synchronous:${0##*/}" -i "$2" -u "${3:-normal}"
|
||||
}
|
||||
|
||||
download_emoji_file(){
|
||||
notify "Downloading Emoji Database..." "downloader"
|
||||
if curl -sL "https://unicode.org/Public/emoji/latest/emoji-test.txt" | sed -nE 's|.*fully-qualified.*# (.*)|\1|p' > "$1"; then
|
||||
notify "Emoji Database Downloaded" "downloader"
|
||||
else
|
||||
notify "Something Went wrong" "downloader" "critical"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
emoji_file="${XDG_CACHE_DIR:-$HOME/.cache}/emoji"
|
||||
|
||||
# check emoji file
|
||||
[ -f "$emoji_file" ] || download_emoji_file "$emoji_file"
|
||||
|
||||
# copy and write emoji to input
|
||||
emoji=$(menu "EMOJI : " < "$emoji_file" | cut -d' ' -f1 | tr -d '\n')
|
||||
|
||||
# validation
|
||||
[ -z "$emoji" ] && notify "No Emoji Selected" "" "critical" && exit 1
|
||||
|
||||
# copy to clipboard
|
||||
printf "%s" "$emoji" | wl-copy && notify "Copied: $emoji" "lol"
|
||||
|
||||
# enter in text
|
||||
wtype -d 10 "$emoji"
|
||||
Reference in New Issue
Block a user