[App Sharing] 语音输入法开源项目LexiSharp-Linux
Tofloor
poster avatar
gwures
deepin
9 hours ago
Author

发现了一款借助ASR进行语音输入的开源项目,https://github.com/flyhunterl/LexiSharp-Linux

使用官方release版本,在deepin系统中大概率会出现一下问题:

  • Wayland 自动粘贴无效:确认 wl-clipboardpython-evdev 已安装,并确保当前用户对 /dev/uinput 具有写权限(将用户加入 input 组后重新登录)。

1.针对粘贴无效:

如果执行了“将用户加入 input 组”的操作后自动粘贴仍然无效,通常是因为系统默认的 /dev/uinput 设备权限配置比较严格(默认为 root:root 且仅 root 可写),导致即使进了组也无法写入,或者内核模块未加载。

请在终端中依次执行以下 3 步 深度修复操作,这能解决 99% 的 Wayland 自动粘贴问题:

第一步:强制加载 uinput 模块

有些系统默认不加载这个内核模块,导致设备文件不存在或不可用。

Bash

sudo modprobe uinput
echo "uinput" | sudo tee /etc/modules-load.d/uinput.conf

第二步:配置 udev 规则(核心步骤)

这一步将强制把 /dev/uinput 的权限开放给 input 组,并赋予读写权限。

请直接复制下面这整段命令在终端运行:

Bash

# 1. 创建 udev 规则文件
echo 'KERNEL=="uinput", MODE="0660", GROUP="input", OPTIONS+="static_node=uinput"' | sudo tee /etc/udev/rules.d/99-lexisharp-uinput.rules

# 2. 重新加载规则
sudo udevadm control --reload-rules
sudo udevadm trigger

# 3. 再次确认当前用户已在 input 组 (如果之前没加成功)
sudo usermod -aG input $USER

第三步:重启生效

配置系统底层权限后,必须重启电脑(或者注销当前用户重新登录)才能让用户组权限真正生效。

Bash

# 建议立即重启
sudo reboot

重启后的验证方法

重启回来后,打开终端输入以下命令查看权限:

Bash

ls -l /dev/uinput
  • 成功标志:您应该看到类似 crw-rw---- 1 root input ... 的输出(重点是所属组变成了 input,且有 rw 权限)。
  • 此时再运行 LexiSharp,自动粘贴功能应该就能在 Wayland 下正常工作了。

安装程序运行所必需的 Python 库

sudo apt install python3-requests python3-numpy python3-evdev python3-pynput

  1. 先用 apt 安装系统源里有的库(更稳定)

sudo apt install python3-requests python3-numpy python3-evdev python3-pynput

  1. 再用 pip 安装系统源里没有的专用库(如阿里大模型、语音引擎等)

pip3 install dashscope pyperclip evdev dbus-next onnxruntime sherpa-onnx --break-system-packages
sudo apt-get install -f -y

sudo apt install wl-clipboard xclip xsel

config.json文件中需改:(/home/user/.lexisharp-linux)

"arecord_device": "default", (声卡问题)

"dbus_timeout_ms": 500,"paste_delay_ms": 600,type_delay_ms": 100,(避免自动复制时出现字符错乱,可调大,不一定能解决问题!!

"input_method": "clipboard","dbus_fallback_to_clipboard": false,(如果debus用不了的话)

"start_hotkey": "ctrl+alt+z"(防止热键冲突)

Reply Favorite View the author
All Replies
gwures
deepin
7 hours ago
#1
It has been deleted!
gwures
deepin
6 hours ago
#2

以上修改,参考了Gemini3与豆包。欢迎大佬提供更好的方法。

Reply View the author
gwures
deepin
6 hours ago
#3
It has been deleted!