fix(text-injection): check ydotoold daemon before selecting ydotool (#176)

This commit is contained in:
Jatin K Malik
2026-02-11 17:26:21 -08:00
committed by GitHub
parent 5e8336239f
commit 4a72c96b5f
+21 -4
View File
@@ -125,10 +125,27 @@ class TextInjector:
xdotool_available = shutil.which("xdotool") is not None
if ydotool_available:
self.wayland_tool = "ydotool"
logger.info(
f"Using {self.wayland_tool} for Wayland text injection (universal compatibility)"
)
# Verify ydotoold daemon is running before selecting ydotool
try:
subprocess.run(
["ydotool", "type", ""], check=True, stderr=subprocess.PIPE, timeout=2
)
self.wayland_tool = "ydotool"
logger.info(
f"Using {self.wayland_tool} for Wayland text injection (universal compatibility)"
)
except (
subprocess.CalledProcessError,
subprocess.TimeoutExpired,
FileNotFoundError,
):
if wtype_available:
self.wayland_tool = "wtype"
logger.info(
f"Using {self.wayland_tool} for Wayland text injection (ydotoold not running)"
)
else:
logger.warning("ydotool found but ydotoold daemon not running")
elif wtype_available:
self.wayland_tool = "wtype"
logger.info(f"Using {self.wayland_tool} for Wayland text injection")