x11的软件跑在Hyprland上,显示相当模糊。切换成wayland即可解决

针对 Chromium/Electron 应用

如 Chrome、Edge、VS Code、Discord 等

  1. 找到应用的 .desktop 文件

    通常位于:

  2. 创建备份并编辑(这里以chrome为例)

    cp /usr/share/applications/google-chrome.desktop ~/.local/share/applications/
    vim ~/.local/share/applications/google-chrome.desktop
    
  3. 在启动命令后添加 --enable-features=UseOzonePlatform --ozone-platform=wayland

    Exec=/usr/bin/google-chrome-stable --enable-features=UseOzonePlatform --ozone-platform=wayland %U
    

    %U 是参数占位符,保留它以确保 URL 传递正常

  4. 刷新桌面数据库

    update-desktop-database ~/.local/share/applications
    
  5. 重启 Hyprland (可选) 如何重启Hyprland?

适用于 GTK3/Qt5/Qt6 应用

通用方法,在 .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 应用

这个应用有没有跑在wayland上?

使用 hyprctl clients 查看,并注意 xwayland 项。0为wayland,1为x11