在切换到GNOME的Wayland会话后,可能需要对不同的程序和系统配置进行一些调整以确保最佳的用户体验。以下是在这种环境下可能需要注意或重新设置的一些方面。
1. 添加各种平台框架的wayland参数
添加如下内容到~/.pam_environment
并重启系统。
# Wayland compatibility
QT_QPA_PLATFORM DEFAULT=wayland
# the following one causes gnome-control-center fail to show
#CLUTTER_BACKEND DEFAULT=wayland
SDL_VIDEODRIVER DEFAULT=wayland
MOZ_ENABLE_WAYLAND DEFAULT=1
MOZ_WEBRENDER DEFAULT=1
XDG_SESSION_TYPE DEFAULT=wayland
XDG_CURRENT_DESKTOP DEFAULT=sway
# QT-related theming
QT_QPA_PLATFORMTHEME DEFAULT=qt5ct
# FCITX input-related
#GLFW_IM_MODULE DEFAULT=ibus
GLFW_IM_MODULE DEFAULT=fcitx
GTK_IM_MODULE DEFAULT=fcitx
INPUT_METHOD DEFAULT=fcitx
XMODIFIERS DEFAULT=@im=fcitx
IMSETTINGS_MODULE DEFAULT=fcitx
QT_IM_MODULE DEFAULT=fcitx
注意这里禁用了CLUTTER_BACKEND
,开启它会导致系统设置无法打开。
2. 中文输入法
fcitx4+搜狗无法正常使用,我直接切换到了fcitx5+rime。
3. 常用的软件
除了chrome浏览器的flags需要手动设置以外,其他的应用可以使用这个脚本来更新。
可以将该脚本复制到/usr/bin/
,然后在/etc/apt/apt.conf.d
下创建文件99-wayland-update
,内容如下:
DPkg::Post-Invoke {"/usr/bin/update_wayland.py";};
则该脚本将在ubuntu apt upgrade以后,自动修改需要更新的软件的desktop文件。
Chrome浏览器
wayland
打开chrome://flags/
,搜索Preferred Ozone platform,设置为wayland。
中文输入法
修改/usr/share/applications/google-chrome.desktop
的Exec行,添加--gtk-version=4
例如:
Exec=/usr/bin/google-chrome-stable %U --gtk-version=4
该方法可适用于多个应用,
修改基于electron的应用的参数
修改/usr/share/applications/slack.desktop
,添加如下到Exec=/usr/bin/slack %U
后面。
--ozone-platform=wayland --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer
该方法可适用于多个应用。
vscode需要设置为--enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland
。
4. 获取发送通知的应用信息
有时顶部通知不会显示应用的信息,通过如下方法可以获得发送通知的应用信息。该命令可以实时显示当前接收到的新通知。
dbus-monitor "interface='org.freedesktop.Notifications'" | \ grep --line-buffered "member=Notify\|string"
5. 去掉频繁的蓝牙通知
对于过多的蓝牙通知,可以通过禁用Blueman的ConnectionNotifier,battery
插件来管理。
6. 其他配置备份
在进行重要的系统更改时,建议备份一些gnome的配置文件,例如:
mv ~/.config/dconf/user ~/.config/dconf/user.bak
mv ~/.config/gnome-control-center ~/.config/gnome-control-center.bak
mv ~/.config/gnome-session ~/.config/gnome-session.bak
7. gnome工作区的快捷键修改
使用dconf-editor
来修改org/gnome/desktop/wm/keybindings/
来修改快捷键
move-to-workspace-down将窗口移动到下一个动作区:<Shift><Super>Page_Down
等。
8. 目前fcitx中文输入法仍无法使用的应用
vscode, typora,
Reference
https://askubuntu.com/questions/906708/how-to-find-out-which-application-is-sending-notifications/1134278#1134278
https://github.com/Ulauncher/Ulauncher/wiki/Hotkey-In-Wayland
https://www.omgubuntu.co.uk/2022/10/fix-firefox-blurry-wayland-fonts-ubuntu
https://github.com/fcitx/fcitx5/issues/263#issuecomment-855215782
https://github.com/blueman-project/blueman/issues/1556#issuecomment-863507029
Comments