mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
* Set default terminal, browser, editor explicitly * Consistent glyphs and setup * Tweaks * Always there * Proper order * Don't make a browser the default just because it's getting installed
94 lines
2.6 KiB
Bash
Executable File
94 lines
2.6 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Install a supported browser
|
|
# omarchy:args=<chrome|brave|brave-origin|edge|firefox|zen>
|
|
# omarchy:examples=omarchy install browser firefox | omarchy install browser brave
|
|
|
|
setup_policy_directory() {
|
|
sudo mkdir -p "$1"
|
|
sudo chmod a+rw "$1"
|
|
}
|
|
|
|
announce_browser_installed() {
|
|
echo ""
|
|
echo "$1 browser installed. Make it the default via Setup > Defaults > Browser."
|
|
}
|
|
|
|
copy_chromium_flags() {
|
|
mkdir -p ~/.config
|
|
cp -f "${OMARCHY_PATH:-$HOME/.local/share/omarchy}/config/chromium-flags.conf" "$1"
|
|
}
|
|
|
|
setup_firefox_preferences() {
|
|
local distribution_dir="$1"
|
|
|
|
setup_policy_directory "$distribution_dir"
|
|
sudo cp -f "$OMARCHY_PATH/default/firefox/policies.json" "$distribution_dir/policies.json"
|
|
}
|
|
|
|
setup_firefox_wayland() {
|
|
mkdir -p ~/.config/environment.d
|
|
echo "MOZ_ENABLE_WAYLAND=1" > ~/.config/environment.d/omarchy-firefox-wayland.conf
|
|
}
|
|
|
|
case $1 in
|
|
chrome)
|
|
echo "Installing Chrome..."
|
|
omarchy-pkg-aur-add google-chrome || exit 1
|
|
|
|
setup_policy_directory /etc/opt/chrome/policies/managed
|
|
copy_chromium_flags ~/.config/chrome-flags.conf
|
|
omarchy-theme-set-browser
|
|
announce_browser_installed "Chrome"
|
|
;;
|
|
edge)
|
|
echo "Installing Edge..."
|
|
omarchy-pkg-aur-add microsoft-edge-stable-bin || exit 1
|
|
|
|
setup_policy_directory /etc/opt/edge/policies/managed
|
|
copy_chromium_flags ~/.config/microsoft-edge-stable-flags.conf
|
|
omarchy-theme-set-browser
|
|
announce_browser_installed "Edge"
|
|
;;
|
|
brave)
|
|
echo "Installing Brave..."
|
|
omarchy-pkg-aur-add brave-bin || exit 1
|
|
|
|
setup_policy_directory /etc/brave/policies/managed
|
|
copy_chromium_flags ~/.config/brave-flags.conf
|
|
omarchy-theme-set-browser
|
|
announce_browser_installed "Brave"
|
|
;;
|
|
brave-origin)
|
|
echo "Installing Brave Origin..."
|
|
omarchy-pkg-aur-add brave-origin-beta-bin || exit 1
|
|
|
|
setup_policy_directory /etc/brave/policies/managed
|
|
mkdir -p ~/.config
|
|
# FIXME: Use normal chromium flags when Brave Origin wrapper has been fixed
|
|
echo "--load-extension=~/.local/share/omarchy/default/chromium/extensions/copy-url" > ~/.config/brave-origin-beta-flags.conf
|
|
omarchy-theme-set-browser
|
|
announce_browser_installed "Brave Origin"
|
|
;;
|
|
firefox)
|
|
echo "Installing Firefox..."
|
|
omarchy-pkg-add firefox || exit 1
|
|
|
|
setup_firefox_preferences /usr/lib/firefox/distribution
|
|
setup_firefox_wayland
|
|
announce_browser_installed "Firefox"
|
|
;;
|
|
zen)
|
|
echo "Installing Zen..."
|
|
omarchy-pkg-aur-add zen-browser-bin || exit 1
|
|
|
|
setup_firefox_preferences /opt/zen-browser/distribution
|
|
setup_firefox_wayland
|
|
announce_browser_installed "Zen"
|
|
;;
|
|
*)
|
|
echo "Usage: omarchy-install-browser <chrome|brave|brave-origin|edge|firefox|zen>"
|
|
exit 1
|
|
;;
|
|
esac
|