🐛 Fix passthrough of emoji to custom type cmd

Custom type commands now also receive the emoji to be typed just like
the default type commands.

If your type program relies on getting an emoji on stdin, then it is
much easier to invoke bemoji with echo. An example with cat:

`bemoji -e | cat`
This commit is contained in:
Marty Oehme 2025-02-06 16:52:32 +01:00
parent 50e838cf73
commit 65efc27dfc
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

5
bemoji
View file

@ -244,13 +244,14 @@ _clipper() {
# Set default typing util # Set default typing util
_typer() { _typer() {
totype=$(cat -)
if [ -n "$BEMOJI_TYPE_CMD" ]; then if [ -n "$BEMOJI_TYPE_CMD" ]; then
# shellcheck disable=SC2068 # shellcheck disable=SC2068
${BEMOJI_TYPE_CMD[@]} ${BEMOJI_TYPE_CMD[@]} "$totype"
return return
fi fi
totype=$(cat -)
if [ -n "$WAYLAND_DISPLAY" ] && command -v wtype >/dev/null 2>&1; then if [ -n "$WAYLAND_DISPLAY" ] && command -v wtype >/dev/null 2>&1; then
wtype -s 30 "$totype" wtype -s 30 "$totype"
elif [ -n "$DISPLAY" ] && command -v xdotool >/dev/null 2>&1; then elif [ -n "$DISPLAY" ] && command -v xdotool >/dev/null 2>&1; then