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