Insert emojis without persisting clipboard entries
Keep the first emoji result selected whenever results exist, including after search filtering, so Enter inserts immediately. Route emoji insertion through a hidden helper that serves a transient sensitive clipboard entry long enough for Shift+Insert, then stops that clipboard owner. Mark transient emoji inserts so clipboard history skips only that event while continuing to record normal terminal copies.
This commit is contained in:
@@ -4,8 +4,26 @@ set -o pipefail
|
||||
|
||||
STATE_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/omarchy"
|
||||
IMAGE_DIR="$STATE_DIR/clipboard-images"
|
||||
EMOJI_IGNORE_FILE="${XDG_RUNTIME_DIR:-${TMPDIR:-/tmp}}/omarchy-emoji-insert-ignore"
|
||||
mkdir -p "$IMAGE_DIR"
|
||||
|
||||
should_ignore_next_copy() {
|
||||
local marker_mtime=0
|
||||
|
||||
[[ -f $EMOJI_IGNORE_FILE ]] || return 1
|
||||
|
||||
marker_mtime=$(stat -c %Y "$EMOJI_IGNORE_FILE" 2>/dev/null || printf '0')
|
||||
if (( $(date +%s) - marker_mtime > 5 )); then
|
||||
rm -f "$EMOJI_IGNORE_FILE"
|
||||
return 1
|
||||
fi
|
||||
|
||||
rm -f "$EMOJI_IGNORE_FILE"
|
||||
return 0
|
||||
}
|
||||
|
||||
should_ignore_next_copy && exit 0
|
||||
|
||||
types=$(wl-paste --list-types 2>/dev/null || true)
|
||||
|
||||
emit_image() {
|
||||
|
||||
Reference in New Issue
Block a user