Skip to content

Instantly share code, notes, and snippets.

@mrintrepide
Last active October 13, 2024 19:45
Show Gist options
  • Save mrintrepide/05c512bdd950a96da72c73807e27df28 to your computer and use it in GitHub Desktop.
Save mrintrepide/05c512bdd950a96da72c73807e27df28 to your computer and use it in GitHub Desktop.
Chromium Wayland - settings for Fedora (KWin Wayland)
# system wide chromium flags
ARCH="$(arch)"
# GRAPHIC_DRIVER=[amd|intel|nvidia|default]
GRAPHIC_DRIVER=default
# WEB_DARKMODE=[on|off]
WEB_DARKMODE=off
# NATIVE_WAYLAND=[on|off]
NATIVE_WAYLAND=on
CHROMIUM_FLAGS=""
if [ "$NATIVE_WAYLAND" == "on" ] ; then
CHROMIUM_FLAGS+=" --ozone-platform=wayland"
CHROMIUM_FLAGS+=" --enable-wayland-ime"
CHROMIUM_FLAGS+=" --wayland-text-input-version=3"
# Bug fixed for v131
CHROMIUM_FLAGS+=" --disable-gpu-memory-buffer-video-frames"
else
# Bug with low GUI frame rate
CHROMIUM_FLAGS+=" --enable-native-gpu-memory-buffers"
# Bug fixed for v131
CHROMIUM_FLAGS+=" --enable-gpu-memory-buffer-video-frames"
fi
CHROMIUM_FLAGS+=" --enable-zero-copy"
CHROMIUM_FLAGS+=" --ignore-gpu-blocklist --disable-gpu-driver-bug-workaround"
CHROMIUM_FLAGS+=" --enable-chrome-browser-cloud-management"
CHROMIUM_FLAGS+=" --enable-gpu-rasterization"
FEATURES=""
case "$GRAPHIC_DRIVER" in
amd)
# Need new mesa with AMD multi planes support, is supported in fedora >= 40 (mesa-24.1.1 or newer)
# see https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26165
CHROMIUM_FLAGS+=" --use-gl=angle --use-angle=vulkan --enable-accelerated-video-decode"
FEATURES+="Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,UseMultiPlaneFormatForHardwareVideo,VaapiVideoEncoder"
;;
nvidia)
# The NVIDIA VaAPI drivers are known to not support Chromium
# see https://crbug.com/1492880. This feature switch is
# provided for developers to test VaAPI drivers on NVIDIA GPUs
CHROMIUM_FLAGS+=" --use-gl=angle --use-angle=gl"
FEATURES+="VaapiVideoDecodeLinuxGL,VaapiVideoEncoder,VaapiOnNvidiaGPUs"
;;
intel)
CHROMIUM_FLAGS+=" --use-gl=angle --use-angle=gl"
FEATURES+="VaapiVideoEncoder,VaapiVideoDecodeLinuxGL"
;;
*)
CHROMIUM_FLAGS+=" --use-gl=angle --use-angle=gl"
FEATURES+="VaapiVideoEncoder,VaapiVideoDecodeLinuxGL"
;;
esac
# Web Dark mode
if [ "$WEB_DARKMODE" == "on" ] ; then
darktype="WebContentsForceDark:inversion_method/cielab_based/image_behavior/none/foreground_lightness_threshold/150/background_lightness_threshold/205"
FEATURES+=",$darktype"
fi
if [ "$ARCH" == "x86_64" ] ; then
CHROMIUM_FLAGS+=" --enable-features=$FEATURES"
fi
@mrintrepide
Copy link
Author

Fedora original Chromium system config file (/etc/chromium/chromium.conf) with modifications for better Ozone Wayland backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment