Skip to content
Open
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
6 changes: 4 additions & 2 deletions bin/omarchy-default-browser
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# omarchy:summary=Set the default browser for Omarchy and XDG handlers
# omarchy:args=[chromium|chrome|brave|brave-origin|edge|firefox|zen]
# omarchy:args=[chromium|chrome|brave|brave-origin|edge|firefox|librewolf|zen]
# omarchy:examples=omarchy default browser firefox | omarchy default browser brave

installing=false
Expand All @@ -19,6 +19,7 @@ if (($# == 0)); then
brave-origin.desktop) echo "brave-origin" ;;
microsoft-edge.desktop) echo "edge" ;;
firefox.desktop) echo "firefox" ;;
librewolf.desktop) echo "librewolf" ;;
zen.desktop) echo "zen" ;;
*) echo "$current_browser" ;;
esac
Expand All @@ -32,9 +33,10 @@ brave) browser="brave"; command="brave"; desktop_id="brave-browser.desktop"; nam
brave-origin) browser="brave-origin"; command="brave-origin"; desktop_id="brave-origin.desktop"; name="Brave Origin"; glyph=󰖟 ;;
edge) browser="edge"; command="microsoft-edge-stable"; desktop_id="microsoft-edge.desktop"; name="Edge"; glyph=󰇩 ;;
firefox) browser="firefox"; command="firefox"; desktop_id="firefox.desktop"; name="Firefox"; glyph=󰈹 ;;
librewolf) browser="librewolf"; command="librewolf"; desktop_id="librewolf.desktop"; name="LibreWolf"; glyph=󰖟 ;;
zen) browser="zen"; command="zen-browser"; desktop_id="zen.desktop"; name="Zen"; glyph=󰖟 ;;
*)
echo "Usage: omarchy-default-browser <chromium|chrome|brave|brave-origin|edge|firefox|zen>"
echo "Usage: omarchy-default-browser <chromium|chrome|brave|brave-origin|edge|firefox|librewolf|zen>"
exit 1
;;
esac
Expand Down
12 changes: 10 additions & 2 deletions bin/omarchy-install-browser
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# omarchy:summary=Install a supported browser
# omarchy:args=<chromium|chrome|brave|brave-origin|edge|firefox|zen>
# omarchy:args=<chromium|chrome|brave|brave-origin|edge|firefox|librewolf|zen>
# omarchy:examples=omarchy install browser chromium | omarchy install browser firefox

set -e
Expand Down Expand Up @@ -105,6 +105,14 @@ firefox)
omarchy-lifecycle-dispatch post-install firefox
announce_browser_installed "Firefox"
;;
librewolf)
echo "Installing LibreWolf..."
omarchy-pkg-add librewolf || exit 1

browser_policy_setup_librewolf_policies /etc/librewolf/policies
setup_firefox_wayland
announce_browser_installed "LibreWolf"
Comment on lines +113 to +114

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 LibreWolf skips platform setup

The LibreWolf branch skips omarchy-lifecycle-dispatch post-install librewolf. The repository contract requires every browser installer to run this step after setup and before announcing success. Every other browser branch does so. Add the call here so platform packages can apply their LibreWolf setup. This repository requirement must be satisfied before merging.

Suggested change
setup_firefox_wayland
announce_browser_installed "LibreWolf"
setup_firefox_wayland
omarchy-lifecycle-dispatch post-install librewolf
announce_browser_installed "LibreWolf"

File Used: docs/lifecycle-dispatch.md (source)

;;
zen)
echo "Installing Zen..."
omarchy-pkg-aur-add zen-browser-bin || exit 1
Expand All @@ -115,7 +123,7 @@ zen)
announce_browser_installed "Zen"
;;
*)
echo "Usage: omarchy-install-browser <chromium|chrome|brave|brave-origin|edge|firefox|zen>"
echo "Usage: omarchy-install-browser <chromium|chrome|brave|brave-origin|edge|firefox|librewolf|zen>"
exit 1
;;
esac
9 changes: 7 additions & 2 deletions bin/omarchy-remove-browser
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# omarchy:summary=Remove a supported browser and clean up Omarchy browser defaults
# omarchy:args=<chrome|brave|brave-origin|edge|firefox|zen>
# omarchy:args=<chrome|brave|brave-origin|edge|firefox|librewolf|zen>
# omarchy:examples=omarchy remove browser firefox | omarchy remove browser brave
# omarchy:requires-sudo=true

Expand Down Expand Up @@ -58,13 +58,18 @@ firefox)
set_fallback_default_browser firefox.desktop
omarchy-pkg-drop firefox
;;
librewolf)
echo "Removing LibreWolf..."
set_fallback_default_browser librewolf.desktop
omarchy-pkg-drop librewolf

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Removal leaves installed policy

The installer writes an Omarchy-managed file under /etc/librewolf/policies, but this branch only removes the package. If the package transaction does not remove that file, removing LibreWolf leaves the system policy behind. Clean up the file created by the installer during removal.

Knowledge Base Used: Packages, apps, and optional services

;;
zen)
echo "Removing Zen..."
set_fallback_default_browser zen.desktop
omarchy-pkg-drop zen-browser-bin
;;
*)
echo "Usage: omarchy-remove-browser <chrome|brave|brave-origin|edge|firefox|zen>"
echo "Usage: omarchy-remove-browser <chrome|brave|brave-origin|edge|firefox|librewolf|zen>"
exit 1
;;
esac
1 change: 1 addition & 0 deletions default/fonts/omarchy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The private-use glyphs in `omarchy.ttf` are:
- `U+E91D` — Kimi, from <https://simpleicons.org/icons/kimi.svg>
- `U+E91E` — Crush, the heartbit from <https://github.com/charmbracelet/crush/blob/main/internal/oauth/callback/heartbit.svg>, its eyes and mouth cut out
- `U+E91F` — Muse Code, from <https://simpleicons.org/icons/meta.svg>: Meta publishes no separate Muse mark and dev.meta.ai uses this one
- `U+E920` — LibreWolf, from <https://simpleicons.org/icons/librewolf.svg>

The agent marks are monochrome so the menu can render them using the active
theme's foreground and selection colors.
Binary file modified default/fonts/omarchy/omarchy.ttf
Binary file not shown.
27 changes: 27 additions & 0 deletions default/librewolf/policies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"__COMMENT__ Omarchy": "Omarchy owns only the Preferences below. LibreWolf loads /etc/librewolf/policies/policies.json instead of its packaged policies, never both, so omarchy-install-browser merges this file over /usr/lib/librewolf/distribution/policies.json with jq. Keeping this file minimal means LibreWolf policy updates can never drift.",
"policies": {
"Preferences": {
"apz.overscroll.enabled": {
"Value": true,
"Status": "default"
},
"media.ffmpeg.vaapi.enabled": {
"Value": true,
"Status": "default"
},
"media.hardware-video-decoding.force-enabled": {
"Value": true,
"Status": "default"
},
"widget.disable-swipe-tracker": {
"Value": false,
"Status": "default"
},
"widget.wayland.fractional-scale.enabled": {
"Value": true,
"Status": "default"
}
}
}
}
3 changes: 3 additions & 0 deletions default/omarchy/omarchy-menu.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@
"setup.default.browser.brave-origin": {"icon":"󰖟","label":"Brave Origin","checked":"[[ \"$(omarchy-default-browser)\" == \"brave-origin\" ]]","action":"omarchy-default-browser brave-origin"},
"setup.default.browser.edge": {"icon":"󰇩","label":"Edge","checked":"[[ \"$(omarchy-default-browser)\" == \"edge\" ]]","action":"omarchy-default-browser edge"},
"setup.default.browser.firefox": {"icon":"","label":"Firefox","checked":"[[ \"$(omarchy-default-browser)\" == \"firefox\" ]]","action":"omarchy-default-browser firefox"},
"setup.default.browser.librewolf": {"icon":"\uE920","iconFont":"omarchy","label":"LibreWolf","checked":"[[ \"$(omarchy-default-browser)\" == \"librewolf\" ]]","action":"omarchy-default-browser librewolf"},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 English menu entries are missing

The three new LibreWolf menu entries are missing from default/i18n/en/menu.json. i18n-test.sh requires every menu entry to have a matching English entry, so this change fails that check. The repository instructions also require this mirror. Add English entries for setup.default.browser.librewolf, install.browser.librewolf, and remove.browser.librewolf.

File Used: docs/i18n.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

"setup.default.browser.zen": {"icon":"󰖟","label":"Zen","checked":"[[ \"$(omarchy-default-browser)\" == \"zen\" ]]","action":"omarchy-default-browser zen"},
"setup.default.dictation": {"icon":"","label":"Dictation","title":"Default Dictation"},
"setup.default.dictation.superwhisper": {"icon":"","label":"Superwhisper","checked":"[[ \"$(omarchy-default-dictation)\" == \"superwhisper\" ]]","action":"omarchy-default-dictation superwhisper"},
Expand Down Expand Up @@ -294,6 +295,7 @@
"install.browser.brave": {"icon":"","label":"Brave","disabled":"omarchy-pkg-present brave-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser brave'"},
"install.browser.brave-origin": {"icon":"","label":"Brave Origin","disabled":"omarchy-pkg-present brave-origin-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser brave-origin'"},
"install.browser.firefox": {"icon":"","label":"Firefox","disabled":"omarchy-pkg-present firefox","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser firefox'"},
"install.browser.librewolf": {"icon":"\uE920","iconFont":"omarchy","label":"LibreWolf","disabled":"omarchy-pkg-present librewolf","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser librewolf'"},
"install.browser.zen": {"icon":"󰖟","label":"Zen","disabled":"omarchy-pkg-present zen-browser-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser zen'"},
"install.service.1password": {"icon":"󰢁","label":"1Password","disabled":"omarchy-pkg-present 1password","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-service-1password"},
"install.service.dropbox": {"icon":"","label":"Dropbox","when":"[[ $(getconf PAGESIZE) == 4096 ]]","disabled":"omarchy-pkg-present dropbox","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-service-dropbox"},
Expand Down Expand Up @@ -383,6 +385,7 @@
"remove.browser.brave": {"icon":"","label":"Brave","when":"omarchy-pkg-present brave-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-remove-browser brave'"},
"remove.browser.brave-origin": {"icon":"","label":"Brave Origin","when":"omarchy-pkg-present brave-origin-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-remove-browser brave-origin'"},
"remove.browser.firefox": {"icon":"","label":"Firefox","when":"omarchy-pkg-present firefox","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-remove-browser firefox'"},
"remove.browser.librewolf": {"icon":"\uE920","iconFont":"omarchy","label":"LibreWolf","when":"omarchy-pkg-present librewolf","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-remove-browser librewolf'"},
"remove.browser.zen": {"icon":"","label":"Zen","when":"omarchy-pkg-present zen-browser-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-remove-browser zen'"},
"remove.service.1password": {"icon":"󰢁","label":"1Password","when":"omarchy-pkg-present 1password","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-service-1password"},
"remove.service.dropbox": {"icon":"","label":"Dropbox","when":"omarchy-pkg-present dropbox","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-service-dropbox"},
Expand Down
44 changes: 44 additions & 0 deletions install/helpers/browser-policy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ BROWSER_POLICY_PARENT_DIRS=(

BROWSER_POLICY_FIREFOX_DIRS=(
/usr/lib/firefox/distribution
/etc/librewolf/policies
Comment thread
greptile-apps[bot] marked this conversation as resolved.
/opt/zen-browser/distribution
)

Expand Down Expand Up @@ -193,3 +194,46 @@ browser_policy_setup_firefox_distribution() {
browser_policy_purge_dir "$distribution_dir"
browser_policy_install_firefox_policies "$distribution_dir" "$policies"
}

# LibreWolf ignores its packaged policies whenever /etc/librewolf/policies/
# policies.json exists, so that file must carry LibreWolf's own policies next
# to Omarchy's. Shipping a frozen merged copy would drift on every LibreWolf
# update, so Omarchy keeps only its own Preferences and deep-merges them over
# the packaged file at install time; the overlay wins on conflicts.
browser_policy_librewolf_merged_policies() {
local packaged=$1
local overlay=${2:-$OMARCHY_PATH/default/librewolf/policies.json}

jq -s '.[0] * .[1]' "$packaged" "$overlay"
}

browser_policy_install_librewolf_policies() {
local policy_dir=$1
local packaged=${2:-/usr/lib/librewolf/distribution/policies.json}
local overlay=${3:-$OMARCHY_PATH/default/librewolf/policies.json}
local tmp

tmp=$(mktemp) || return 1
if ! browser_policy_librewolf_merged_policies "$packaged" "$overlay" >"$tmp"; then
rm -f "$tmp"
return 1
fi

if as_root install -m 644 -o root -g root -T "$tmp" "$policy_dir/policies.json"; then
rm -f "$tmp"
return 0
fi

rm -f "$tmp"
return 1
}

browser_policy_setup_librewolf_policies() {
local policy_dir=$1
local packaged=${2:-/usr/lib/librewolf/distribution/policies.json}
local overlay=${3:-$OMARCHY_PATH/default/librewolf/policies.json}

browser_policy_setup_parent "$policy_dir"
browser_policy_purge_dir "$policy_dir"
browser_policy_install_librewolf_policies "$policy_dir" "$packaged" "$overlay"
}
10 changes: 6 additions & 4 deletions manual/23-browsers.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Omarchy ships with [Chromium](https://www.chromium.org/) as the default browser. It's the plain open-source build, themed to match the rest of your system, and it's what `Super + Shift + Return` opens and what every [web app](25-web-apps.md) runs inside.

If Chromium isn't your taste, you're not stuck with it. Under _Install > Browser_ in the Omarchy menu you'll find Chrome, Edge, Brave, Brave Origin, Firefox, and [Zen](https://zen-browser.app/). Pick one and Omarchy installs it, sets up its policy directory, and applies your current theme to it.
If Chromium isn't your taste, you're not stuck with it. Under _Install > Browser_ in the Omarchy menu you'll find Chrome, Edge, Brave, Brave Origin, Firefox, LibreWolf, and [Zen](https://zen-browser.app/). Pick one and Omarchy installs it, sets up its policy directory, and applies your current theme to it.

## Making one the default

Expand All @@ -26,11 +26,13 @@ The Chromium-family browsers (Chromium itself, Chrome, Edge, and Brave) come wit

Both extensions talk to Omarchy through a small native messaging host, which gets installed for you along with the browser. That's the piece that lets a web page's video end up in your home directory and a URL end up in your clipboard manager, which a normal extension can't do on its own.

These are Chromium-family only. Firefox and Zen don't get them.
These are Chromium-family only. Firefox, LibreWolf, and Zen don't get them.

## Firefox and Zen
## Firefox, LibreWolf, and Zen

Firefox and Zen are a different family, so they get different treatment: Omarchy installs a policies file for sensible defaults and switches them into native Wayland mode, which you want for fractional scaling and smooth trackpad scrolling.
Firefox, LibreWolf, and Zen are a different family, so they get different treatment: Omarchy installs a policies file for sensible defaults and switches them into native Wayland mode, which you want for fractional scaling and smooth trackpad scrolling.

LibreWolf is a special case: it ships its own policies (uBlock Origin installed, HTTPS-Only on), and it uses either its own file or Omarchy's, never both. So when Omarchy installs it, it merges its own defaults over the policies LibreWolf ships, and you keep everything LibreWolf brings even as LibreWolf updates those policies.

They don't get the Chromium extensions above, and they're not themed by Omarchy, so those parts of the experience are yours to set up.

Expand Down
60 changes: 60 additions & 0 deletions test/shell.d/browser-policy-dir-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,66 @@ fi
[[ -d $dir_dist/policies.json ]] || fail "Firefox policy install leaves a planted policies.json directory in place"
pass "Firefox policy install does not write into a planted policies.json directory"

lw_packaged=$test_tmp/librewolf-packaged-policies.json
cat >"$lw_packaged" <<'JSON'
{
"__COMMENT__ More Information": "https://github.com/mozilla/policy-templates/blob/master/README.md",
"policies": {
"DisableTelemetry": true,
"HttpsOnlyMode": "enabled",
"ExtensionSettings": {
"uBlock0@raymondhill.net": {
"install_url": "https://addons.mozilla.org/firefox/downloads/latest/uBlock0@raymondhill.net/latest.xpi",
"installation_mode": "normal_installed",
"private_browsing": true
}
},
"Preferences": {
"apz.overscroll.enabled": {
"Value": false,
"Status": "locked"
}
}
}
}
JSON

lw_merged=$(browser_policy_librewolf_merged_policies "$lw_packaged")
jq -e '.policies.DisableTelemetry == true and .policies.HttpsOnlyMode == "enabled"' <<<"$lw_merged" >/dev/null ||
fail "the LibreWolf merge keeps LibreWolf's own policies"
jq -e '.policies.ExtensionSettings."uBlock0@raymondhill.net".installation_mode == "normal_installed"' <<<"$lw_merged" >/dev/null ||
fail "the LibreWolf merge keeps LibreWolf's uBlock Origin defaults"
jq -e '.policies.Preferences."widget.wayland.fractional-scale.enabled" == {"Value": true, "Status": "default"}' <<<"$lw_merged" >/dev/null ||
fail "the LibreWolf merge carries Omarchy's Preferences"
jq -e '.policies.Preferences."apz.overscroll.enabled" == {"Value": true, "Status": "default"}' <<<"$lw_merged" >/dev/null ||
fail "the LibreWolf merge lets Omarchy's overlay win over the packaged policies"
jq -e '."__COMMENT__ More Information" != null' <<<"$lw_merged" >/dev/null ||
fail "the LibreWolf merge keeps the packaged comment keys"
pass "LibreWolf policies merge the packaged file with Omarchy's overlay"

lw_dir=$test_tmp/librewolf-policies
mkdir -p "$lw_dir"
printf 'original\n' >"$test_tmp/librewolf-pwn"
ln -s "$test_tmp/librewolf-pwn" "$lw_dir/policies.json"
as_root() { unprivileged_as_root "$@"; }
browser_policy_install_librewolf_policies "$lw_dir" "$lw_packaged" ||
fail "LibreWolf policy install replaces a planted policies.json symlink"
[[ -f $lw_dir/policies.json && ! -L $lw_dir/policies.json ]] ||
fail "LibreWolf policy install unlinks a planted policies.json symlink instead of writing through it"
grep -Fxq 'original' "$test_tmp/librewolf-pwn" || fail "LibreWolf policy install leaves the symlink target unchanged"
mode=$(stat -c '%a' "$lw_dir/policies.json")
[[ $mode == "644" ]] || fail "LibreWolf policy install writes a root-mode policies.json" "mode=$mode"
jq -e '.policies.ExtensionSettings."uBlock0@raymondhill.net" != null and .policies.Preferences != null' "$lw_dir/policies.json" >/dev/null ||
fail "LibreWolf policy install writes the merged policies"
pass "LibreWolf policy install does not follow a planted policies.json symlink"

if browser_policy_install_librewolf_policies "$lw_dir" "$test_tmp/no-such-packaged-policies.json" 2>/dev/null; then
fail "LibreWolf policy install refuses a missing packaged policies file"
fi
jq -e '.policies.Preferences != null' "$lw_dir/policies.json" >/dev/null ||
fail "a refused LibreWolf install leaves the existing merged policies intact"
pass "LibreWolf policy install refuses to merge without the packaged policies"

grep -F 'exit "$failed"' "$ROOT/bin/omarchy-theme-set-browser" >/dev/null ||
fail "omarchy-theme-set-browser exits non-zero when a policy write fails"
pass "omarchy-theme-set-browser exits non-zero when a policy write fails"
Expand Down
Loading