Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions bin/omarchy-install-browser
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
;;
Expand Down
16 changes: 16 additions & 0 deletions migrations/1789843016.sh
Original file line number Diff line number Diff line change
@@ -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
Loading