[Feature]: 在原生Wayland上启动洛雪音乐
解决方案检查
- [X] 我已阅读常见问题(https://github.com/lyswhut/lx-music-desktop/blob/master/FAQ.md),但没有找到解决方案
- [X] 我已搜索issue列表(https://github.com/lyswhut/lx-music-desktop/issues?utf8=✓&q=),但没有发现类似的问题
问题描述
在原生Wayland上使用洛雪音乐而不是XWayland
描述你想要的解决方案
类似于Vscode的解决方案。
描述你考虑过的替代方案
No response
附加信息
曾尝试使用Vscode的解决方案,但是出现了如下报错
-> % lx-music-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland %U
23:29:45.630 › App starting...
init
23:29:46.073 › Checking for update
23:29:46.075 › Checking for update...
23:29:46.077 › Error: Error: ENOENT: no such file or directory, open '/opt/lx-music-desktop/resources/app-update.yml'
23:29:46.078 › Error in auto-updater.
Unhandled Rejection at: Promise Promise {
<rejected> [Error: ENOENT: no such file or directory, open '/opt/lx-music-desktop/resources/app-update.yml'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/opt/lx-music-desktop/resources/app-update.yml'
}
}
reason: [Error: ENOENT: no such file or directory, open '/opt/lx-music-desktop/resources/app-update.yml'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/opt/lx-music-desktop/resources/app-update.yml'
}
23:29:46.081 › Error: ENOENT: no such file or directory, open '/opt/lx-music-desktop/resources/app-update.yml'
选项是可以的,但是我在Ubuntu 20.04上启动会失败:
/usr/share/applications$ lx-music-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland
18:16:28.727 › App starting...
[8252:0123/181628.731859:FATAL:ozone_platform_wayland.cc(173)] Failed to initialize Wayland platform
追踪与中断点陷阱 (核心已转储)
去Electron那边搜了下Wayland,可以看到这功能还有很多问题,而且我对Wayland不熟悉,或者是我的测试系统不支持这个功能?
我现在使用的是Sway和ArchLinux。Ubuntu需要使用gnome 41,才会有Wayland支持。或者临时使用Sway或者wayfire。
这是我找到一些安装指南
PS: 我使用Wayland主要是因为电脑性能不太好,再就是看了这篇博客《Wayland 初体验》
Ubuntu 20.04默认没有开启wayland,去开启一下就行了:https://linuxconfig.org/how-to-enable-disable-wayland-on-ubuntu-20-04-desktop
不过需要electron 17才能用,现在electron 13以上的版本bug挺多的,我暂时没打算升上去, 我用electron 17试了下,主界面没啥问题,但是桌面歌词无法使用拖动来移动位置,并且置顶无效,锁定歌词后无法鼠标穿透:

来试试 lx-music 这个包,使用的最新的 electron. 应该可以在 wayland 使用
考虑新的运行参数: --ozone-platform-hint=auto --enable-wayland-ime . 第二个参数启用Wayland输入法支持.
在Archlinux和KDE(Wayland)环境上测试通过, 使用lx-music-desktop-bin