Mange / rofi-emoji

Emoji selector plugin for Rofi
MIT License
555 stars 26 forks source link

Typing with xdotool #35

Closed koiuo closed 2 years ago

koiuo commented 2 years ago

I'd like this project to support typing into currently active window using xdotool

rofi-emoji already offloads extenal tool selection to the clipboard-adapter.sh, however this one is limited to to clipboard tools only.

However xdotool will result in different behaior than any of the currently supported tools.

We can add another command to the clipbard-adapter.sh (the code suggests an extension point)

case "$1" in
  copy)
    ...
    ;;
  type)                        # ← a new command here
    shift
    tool=$(determine_type_tool)
    if [ -n "$tool" ]; then
      handle_type "$tool" "$*"
    else
      show_error "Could not find a supported typing tool installed. Install xdotool."
      exit 1
    fi
    ;;
  *)
    show_error "$0: Unknown command \"$1\""
    exit 1
esac

and the rofi-emoji will decide how will it call the clipboard-adapter.sh.

Another option would be to make this decision in the adapter by reading some environment variable (it'll inherit the environment from rofi-emoji as far as I can see from the code).

WDYT?

Mange commented 2 years ago

Duplicate of #20