Skip to content

Instantly share code, notes, and snippets.

@levihuayuzhang
Last active March 25, 2025 04:57
Show Gist options
  • Save levihuayuzhang/4e239874b37cdf975c2153d33f5a7135 to your computer and use it in GitHub Desktop.
Save levihuayuzhang/4e239874b37cdf975c2153d33f5a7135 to your computer and use it in GitHub Desktop.
Run Chromium/Electron under Wayland natively (conf files apply to Arch Linux, BTW ^_^)

These Flags may only apply to Arch Linux Offical packed packages.

Flags disabled for now

  1. ~/.config/chromium-flags.conf
# --wayland-text-input-version=3 # not sure, if not using kwin or hyprland, should be added
# --disable-features=UseSkiaRenderer # not sure
# --enable-gpu-rasterization # may not needed
# --ozone-platform-hint=auto # fallback option
# --disable-features=WaylandFractionalScaleV1 # may not needed
# --gtk-version=4 # may not work with fcitx5
# --use-gl=egl # may break AMD GPU
  1. ~/.config/code-flags.conf
# --enable-features=WaylandWindowDecorations # may needed under to gnome to show title bar
# --enable-webrtc-pipewire-capturer # when needed
# --enable-features=TouchpadOverscrollHistoryNavigation # not sure
# --ozone-platform-hint=wayland # fallback
# --disable-features=WaylandFractionalScaleV1 # may not needed
# --gtk-version=4 # may not work with fcitx5
# --ignore-gpu-blocklist # not sure

BTW, MS VSCode on Arch Linux may not read these flags under .config directory. (Only work with Arch Linux Official packages (Code - OSS) and visual-studio-code-bin(AUR)).

If choosing use MS VSCode (Proprietary Microsoft-branded), may need to add flags to the .desktop file and which can be created at ~/.local/share/applications/code.desktop.

The window decoration should be fixed with "window.titleBarStyle": "custom".

  1. ~/.config/electron-flags.conf
# --ozone-platform-hint=auto # fallback
  1. Jetbrains's IDEs (Java Swing) could use -Dawt.toolkit.name=WLToolkit to enable wayland support.
  2. for xwayland work in hyprland: hyperland setting as follow
# change monitor to high resolution, the last argument is the scale factor
monitor = , highres, auto, 2

# unscale XWayland
xwayland {
  force_zero_scaling = true
}

# toolkit-specific scale
env = GDK_SCALE,2
env = XCURSOR_SIZE,32

may need to do something in ~/.Xresources and install xorg-xrdb if u want to do factional scaling

Xft.dpi: 144
Xft.autohint: 0
Xft.lcdfilter:  lcddefault
Xft.hintstyle:  hintfull
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb

then run xrdb -query -all or run xrdb ~/.Xresources.

--enable-features=UseOzonePlatform
--ozone-platform=wayland
--enable-wayland-ime
--enable-features=UseOzonePlatform,AcceleratedVideoDecodeLinuxGL,AcceleratedVideoEncoder,VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE,TouchpadOverscrollHistoryNavigation
--ozone-platform=wayland
--enable-wayland-ime
--wayland-text-input-version=3
--ignore-gpu-blocklist
--enable-zero-copy
--enable-features=UseOzonePlatform,WebRTCPipeWireCapturer
--ozone-platform=wayland
--enable-wayland-ime
--wayland-text-input-version=3
--password-store=gnome-libsecret
--enable-features=WaylandWindowDecorations,UseOzonePlatform,WebRTCPipeWireCapturer
--ozone-platform=wayland
--enable-wayland-ime
--wayland-text-input-version=3
--enable-features=UseOzonePlatform
--ozone-platform=wayland
--enable-wayland-ime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment