From 8410187b2973ce4167a3ff5f77b65d48802c9b5c Mon Sep 17 00:00:00 2001 From: Kernc Date: Wed, 5 Feb 2025 08:20:57 +0100 Subject: [PATCH] ENH: EFCK_TYPEOUT_CMD env variable for overriding xdotool Fixes https://github.com/efck-chat-keyboard/efck/issues/22 --- efck/output.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/efck/output.py b/efck/output.py index c261793..7652946 100644 --- a/efck/output.py +++ b/efck/output.py @@ -1,5 +1,6 @@ import logging import os +import shlex import shutil import subprocess from tempfile import NamedTemporaryFile @@ -10,8 +11,12 @@ logger = logging.getLogger(__name__) +EFCK_TYPEOUT_CMD = os.environ.get('EFCK_TYPEOUT_CMD', None) + + def type_chars(text: str, force_clipboard): TYPEOUT_COMMANDS = ( + (EFCK_TYPEOUT_CMD, [*shlex.split(EFCK_TYPEOUT_CMD or ''), text]), (IS_X11, ['xdotool', 'type', text]), (IS_X11 or IS_WAYLAND, ['ydotool', 'type', '--next-delay', '0', '--key-delay', '0', text]), (IS_X11 or IS_WAYLAND, ['wtype', text]),