update custom chromium.conf

This commit is contained in:
Anders Rytter Hansen 2025-12-01 12:38:39 -03:00
commit 7aef3492e7

View file

@ -1 +1,75 @@
CHROMIUM_USER_FLAGS="--use-gl=angle --use-angle=gl --enable-features=AcceleratedVideoEncoder,AcceleratedVideoDecodeLinuxGL,VaapiOnNvidiaGPUs --ozone-platform=wayland --ignore-gpu-blocklist --disable-gpu-driver-bug-workaround --disable-features=ExtensionManifestV2Unsupported,ExtensionManifestV2Disabled --oauth2-client-id=77185425430.apps.googleusercontent.com --oauth2-client-secret=OTJgUOQcT7lO7GsGZq2G4IlT"
# system wide chromium flags
ARCH="$(arch)"
MODE="$(systemd-detect-virt)"
# GRAPHIC_DRIVER=[amd|intel|nvidia|default]
GRAPHIC_DRIVER=intel
# WEB_DARKMODE=[on|off]
WEB_DARKMODE=off
# NATIVE_WAYLAND=[on|off]
# chromium >=141 switched to --ozone-platform-hint=auto
if [ ! -z "$WAYLAND_DISPLAY" ]; then
NATIVE_WAYLAND=on
else
NATIVE_WAYLAND=off
fi
DISABLE_FEATURES="LensOverlay,ExtensionManifestV2Unsupported,ExtensionManifestV2Disabled"
ENABLE_FEATURES="AllowQt"
CHROMIUM_FLAGS=" --enable-chrome-browser-cloud-management"
if [ "$NATIVE_WAYLAND" == "on" ] ; then
ENABLE_FEATURES+=",WaylandLinuxDrmSyncobj,WaylandPerSurfaceScale,WaylandUiScale"
else
CHROMIUM_FLAGS+=" --enable-gpu-memory-buffer-video-frames"
CHROMIUM_FLAGS+=" --enable-zero-copy"
CHROMIUM_FLAGS+=" --ignore-gpu-blocklist --disable-gpu-driver-bug-workaround"
CHROMIUM_FLAGS+=" --enable-gpu-rasterization"
fi
ENABLE_FEATURES+=",AcceleratedVideoDecodeLinuxGL,AcceleratedVideoDecodeLinuxZeroCopyGL"
case "$GRAPHIC_DRIVER" in
amd|intel)
# 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+=" --enable-accelerated-video-decode"
ENABLE_FEATURES+=",VaapiIgnoreDriverChecks,UseMultiPlaneFormatForHardwareVideo"
;;
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
ENABLE_FEATURES+=",VaapiOnNvidiaGPUs"
export CUDA_DISABLE_PERF_BOOST=1
;;
*)
ENABLE_FEATURES+=",AcceleratedVideoEncoder"
;;
esac
if [ "$MODE" != "none" ] ; then
# chromium in VM, running with standard setting
CHROMIUM_FLAGS=""
DISABLE_FEATURES=""
ENABLE_FEATURES=""
fi
# Set gtk version to 3 by default
# todo: switch to gtk4 in the future
CHROMIUM_FLAGS+=" --gtk-version=3"
# 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"
if [ -z "$ENABLE_FEATURES" ] ; then
ENABLE_FEATURES+="$darktype"
else
ENABLE_FEATURES+=",$darktype"
fi
fi
[ -z "$DISABLE_FEATURES" ] || CHROMIUM_FLAGS+=" --disable-features=$DISABLE_FEATURES"
[ -z "$ENABLE_FEATURES" ] || CHROMIUM_FLAGS+=" --enable-features=$ENABLE_FEATURES"