From 50e838cf7351033bee65e743d8d7eecefeec3d50 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 6 Feb 2025 16:37:41 +0100 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=93=96=20Make=20README=20slightly=20m?= =?UTF-8?q?ore=20professional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 307a6b7..ca121b2 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ Put both together to completely ignore the recent emoji feature of the program bemoji -p -P0 ``` -Like this, you'll be hiding any recent personal emoji and no one will know that you always type 👄🍆💦. +Like this, you'll be hiding any recent personal emoji and keep any new ones you use out of your history. To limit the number of your recently used emoji that are shown without hiding them completely simply increase the number to however many you wish to display. For example, to display only the top 4 recently used emoji: From 65efc27dfc43ffada4627e1a8ad0c07262b9735d Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 6 Feb 2025 16:52:32 +0100 Subject: [PATCH 2/3] =?UTF-8?q?=F0=9F=90=9B=20Fix=20passthrough=20of=20emo?= =?UTF-8?q?ji=20to=20custom=20type=20cmd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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` --- bemoji | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bemoji b/bemoji index 50b9898..481af8f 100755 --- a/bemoji +++ b/bemoji @@ -244,13 +244,14 @@ _clipper() { # Set default typing util _typer() { + totype=$(cat -) + if [ -n "$BEMOJI_TYPE_CMD" ]; then # shellcheck disable=SC2068 - ${BEMOJI_TYPE_CMD[@]} + ${BEMOJI_TYPE_CMD[@]} "$totype" return fi - totype=$(cat -) if [ -n "$WAYLAND_DISPLAY" ] && command -v wtype >/dev/null 2>&1; then wtype -s 30 "$totype" elif [ -n "$DISPLAY" ] && command -v xdotool >/dev/null 2>&1; then From 1b5e9c1284ede59d771bfd43780cc8f6f7446f38 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 6 Feb 2025 16:55:45 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=A6=8A=20Ensure=20function=20variable?= =?UTF-8?q?s=20are=20declared=20local?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bemoji | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bemoji b/bemoji index 481af8f..7a648e1 100755 --- a/bemoji +++ b/bemoji @@ -180,6 +180,7 @@ dl_nerd_symbols() { } gather_emojis() { + local result if [ -n "$BEMOJI_CUSTOM_LIST" ] && [ -f "$BEMOJI_CUSTOM_LIST" ]; then result=$(cat "$BEMOJI_CUSTOM_LIST") elif [ -n "$BEMOJI_CUSTOM_LIST" ] && curl -fsSI "$BEMOJI_CUSTOM_LIST" >/dev/null 2>&1; then @@ -197,12 +198,12 @@ gather_emojis() { } get_most_recent() { - limit=${1} - recent_file="$bm_history_file" + local limit=${1} + local recent_file="$bm_history_file" if [ ! -f "$recent_file" ]; then touch "$recent_file" fi - # TODO improve this messy line + # TODO: improve this messy line local result result=$(sed -e '/^$/d' "$recent_file" | sort | @@ -244,6 +245,7 @@ _clipper() { # Set default typing util _typer() { + local totype totype=$(cat -) if [ -n "$BEMOJI_TYPE_CMD" ]; then