Add emojiprint func

This commit is contained in:
Jes Olson 2022-10-06 11:33:14 -05:00
parent 3f0547dc04
commit 62116f1b6f

8
shmoji
View file

@ -29,6 +29,10 @@ emojicheck() {
[ -f "$emojifile" ] || die "emojis not found. try 'shmoji download'"
}
emojiprint() {
printf "%s" "$1" | cut -d " " -f 1 | tr -d '\n'
}
case "$cmd" in
download)
depends curl
@ -41,7 +45,7 @@ case "$cmd" in
emojicheck
depends bemenu wtype
emoji=$(cat "$emojifile" | bemenu -c -W 0.2 -l 20)
printf "%s" "$emoji" | cut -d " " -f 1 | tr -d '\n' | wtype -
emojiprint "$emoji" | wtype -
;;
rofi)
emojicheck
@ -54,7 +58,7 @@ case "$cmd" in
emojicheck
depends fzf
emoji=$(cat "$emojifile" | fzf)
printf "%s" "$emoji" | cut -d " " -f 1 | tr -d '\n'
emojiprint "$emoji"
;;
*)
printf "%s\n" "usage: shmoji [download | bemenu | rofi | fzf]"