From 10a945e2e432d88cbb78fcb22d2c39f6f8035a8d Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Wed, 10 Apr 2024 13:57:03 +0700 Subject: [PATCH] start ydotool if not running (for non systemd distros) --- .config/ags/modules/onscreenkeyboard/onscreenkeyboard.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/ags/modules/onscreenkeyboard/onscreenkeyboard.js b/.config/ags/modules/onscreenkeyboard/onscreenkeyboard.js index 023830a6e..bed74fa6a 100644 --- a/.config/ags/modules/onscreenkeyboard/onscreenkeyboard.js +++ b/.config/ags/modules/onscreenkeyboard/onscreenkeyboard.js @@ -12,6 +12,11 @@ import { setupCursorHoverGrab } from '../.widgetutils/cursorhover.js'; const keyboardLayout = oskLayouts[userOptions.onScreenKeyboard.layout] ? userOptions.onScreenKeyboard.layout : DEFAULT_OSK_LAYOUT; const keyboardJson = oskLayouts[keyboardLayout]; +async function startYdotoolIfNeeded() { + const running = exec('pidof ydotool') + if(!running) execAsync(['ydotoold']).catch(print); +} + function releaseAllKeys() { const keycodes = Array.from(Array(249).keys()); execAsync([`ydotool`, `key`, ...keycodes.map(keycode => `${keycode}:0`)])