x11的软件跑在Hyprland上,显示相当模糊。切换成wayland即可解决
如 Chrome、Edge、VS Code、Discord 等
找到应用的 .desktop 文件
通常位于:
/usr/share/applications/ 系统级(一般都在这里)~/.local/share/applications/ 用户级创建备份并编辑(这里以chrome为例)
cp /usr/share/applications/google-chrome.desktop ~/.local/share/applications/
vim ~/.local/share/applications/google-chrome.desktop
在启动命令后添加 --enable-features=UseOzonePlatform --ozone-platform=wayland
Exec=/usr/bin/google-chrome-stable --enable-features=UseOzonePlatform --ozone-platform=wayland %U
%U 是参数占位符,保留它以确保 URL 传递正常
刷新桌面数据库
update-desktop-database ~/.local/share/applications
重启 Hyprland (可选) 如何重启Hyprland?
通用方法,在 .bashrc 或 .zshrc 中添加下面配置
export QT_QPA_PLATFORM=wayland # Qt 应用
export GDK_BACKEND=wayland # GTK 应用
export SDL_VIDEODRIVER=wayland # SDL 应用(如游戏)
export CLUTTER_BACKEND=wayland # Clutter 应用
export ECORE_EVAS_ENGINE=wayland # Enlightenment 应用
export ELM_ENGINE=wayland # Elementary 应用
使用 hyprctl clients 查看,并注意 xwayland 项。0为wayland,1为x11