From a184da2001447429db8da0f8a10a71fe15dbdbed Mon Sep 17 00:00:00 2001 From: Caleb Marshall Date: Sat, 19 Sep 2026 13:49:44 -0500 Subject: [PATCH] Register the Widevine CDM for Brave The widevine package installed by the Apple Silicon migration registers its CDM for Chromium and Firefox only. Brave, installed through `omarchy install browser brave`, looks for the CDM inside its own install directory, finds nothing, and silently fails on DRM sites: Netflix, Apple TV+ and Spotify show a green or blank player with no useful error. Link the system CDM into /opt/brave-bin at install time, and add a migration so existing Brave installs are repaired too. Both are no-ops when the widevine package is absent, which is the case wherever the browser ships its own CDM. Co-Authored-By: Claude Opus 5 --- bin/omarchy-install-browser | 14 ++++++++++++++ migrations/1789843016.sh | 16 ++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 migrations/1789843016.sh diff --git a/bin/omarchy-install-browser b/bin/omarchy-install-browser index 4593bc72d87b..e4e1c3f6ee60 100755 --- a/bin/omarchy-install-browser +++ b/bin/omarchy-install-browser @@ -17,6 +17,19 @@ announce_browser_installed() { echo "$1 browser installed. Make it the default via Setup > Defaults > Browser." } +register_widevine() { + # The widevine package registers its CDM for Chromium and Firefox only. Other + # Chromium-family browsers look for the CDM inside their own install + # directory, so link the system one in; without it DRM sites (Netflix, Apple + # TV+, Spotify) fail with no useful error. No-op when the widevine package is + # not installed, which is the case wherever the browser ships its own CDM. + local install_dir=$1 + + if [[ -d /opt/WidevineCdm/chromium ]] && [[ -d $install_dir ]] && [[ ! -e $install_dir/WidevineCdm ]]; then + sudo ln -sfn /opt/WidevineCdm/chromium "$install_dir/WidevineCdm" + fi +} + copy_chromium_flags() { mkdir -p ~/.config cp -f "$OMARCHY_PATH/config/chromium-flags.conf" "$1" @@ -63,6 +76,7 @@ brave) setup_chromium_policy_directory /etc/brave/policies/managed copy_chromium_flags ~/.config/brave-flags.conf + register_widevine /opt/brave-bin omarchy-theme-set-browser announce_browser_installed "Brave" ;; diff --git a/migrations/1789843016.sh b/migrations/1789843016.sh new file mode 100644 index 000000000000..9f90a970ab35 --- /dev/null +++ b/migrations/1789843016.sh @@ -0,0 +1,16 @@ +echo "Register the Widevine CDM for an installed Brave" + +# The widevine package registers its CDM for Chromium and Firefox only, so a +# Brave installed through `omarchy install browser brave` never finds one and +# DRM sites (Netflix, Apple TV+, Spotify) fail to play with no useful error. +# omarchy-install-browser links it for new installs; repair existing ones here. +if [[ ! -d /opt/WidevineCdm/chromium ]]; then + echo "Widevine CDM not installed; nothing to register." +elif [[ ! -d /opt/brave-bin ]]; then + echo "Brave not installed; nothing to register." +elif [[ -e /opt/brave-bin/WidevineCdm ]]; then + echo "Brave already has a Widevine CDM registered." +else + sudo ln -sfn /opt/WidevineCdm/chromium /opt/brave-bin/WidevineCdm + echo "Registered the Widevine CDM for Brave; restart Brave to pick it up." +fi