Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improve command handling for _typer and _clipper #45

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

chkg2a
Copy link

@chkg2a chkg2a commented Mar 13, 2025

BEMOJI_CLIP_CMD="wl-copy" # which clipboard tool to use
BEMOJI_TYPE_CMD="wtype" # which typing tool to use (ydotool will NOT work)

These two environment variables were misleading. As inside the code. It was looking for the whole command. Otherwise it was failing. The change below was made.

BEMOJI_CLIP_CMD="xclip -selection clipboard" # you need to supply the full command otherwise it won't work
BEMOJI_TYPE_CMD="xdotool type --delay 30" # which typing tool to use, input the full command

@chkg2a
Copy link
Author

chkg2a commented Mar 14, 2025

Modified _typer and _clipper to better handle the BEMOJI_TYPE_CMD and BEMOJI_CLIP_CMD variables.

  • If the variable contains multiple words, it is executed as a full command using ${VAR[@]}.
  • If it contains a single-word command (wtype, xdotool, wl-copy, xclip, or xsel), the script checks its availability before execution.
  • Preserves the fallback mechanism for Wayland/X11 clipboard and typing tools.
  • Ensures better compatibility and avoids unnecessary execution of undefined or unavailable commands.

@chkg2a chkg2a changed the title docs: updated misleading README feat: improve command handling for _typer and _clipper Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant