Open maxcurrent420 opened 1 month ago
I wasn't aware this needs an X Server running on linux. Since pynput is used in linguflex only for keyboard input handling (specifically to listen for the Escape key press and abort TTS in that case) it's probably best to switch to another keyboard handler.
In lingu.py replace:
from pynput import keyboard
with
import keyboard
Then replace
self.listener = keyboard.Listener(on_press=self.on_press)
self.listener.start()
with
keyboard.on_press_key("esc", self.on_press)
And finally replace
def on_press(self, key):
"""
Function called when a key is pressed.
If Escape key is pressed, a message is printed.
"""
if key == keyboard.Key.esc:
events.trigger("escape_key_pressed", "ui")
return True
with
def on_press(self, key):
events.trigger("escape_key_pressed", "ui")
This should solve the problems.
I committed the changes into the repo, the changed file is now here:
https://github.com/KoljaB/Linguflex/blob/main/lingu/core/lingu.py
Installed on Linux and after having to install a number of dependencies left out of the requirements.txt I got this error on startup:
Now, I don't know why I need an x server going, but more importantly how do I set it as an environment variable, assuming I get one on here? I just assumed once I installed it and got the llm going it would open a browser tab :D