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|zen|helium]
# omarchy:examples=omarchy default browser firefox | omarchy default browser brave

installing=false
Expand All @@ -20,6 +20,7 @@ if (($# == 0)); then
microsoft-edge.desktop) echo "edge" ;;
firefox.desktop) echo "firefox" ;;
zen.desktop) echo "zen" ;;
helium.desktop) echo "helium" ;;
*) echo "$current_browser" ;;
esac
exit 0
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=󰈹 ;;
helium) browser="helium"; command="helium-browser"; desktop_id="helium.desktop"; name="Helium"; 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|zen|helium>"
exit 1
;;
esac
Expand Down
50 changes: 50 additions & 0 deletions bin/omarchy-default-webapp-browser
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

# omarchy:summary=Choose a web app browser independently of the default browser
# omarchy:args=[auto|chromium|chrome|brave|brave-origin|edge|helium|opera|vivaldi]
# omarchy:examples=omarchy default webapp-browser helium | omarchy default webapp-browser auto

set -e
config="${XDG_CONFIG_HOME:-$HOME/.config}/omarchy/webapp-browser"

if (( $# == 0 )); then
if [[ -f $config ]]; then
cat "$config"
else
echo auto
fi
exit 0
fi

case "$1" in
auto) desktop_id=auto ;;
chromium) command=chromium; desktop_id=chromium.desktop; name="Chromium" ;;
chrome) command=google-chrome-stable; desktop_id=google-chrome.desktop; name="Chrome" ;;
brave) command=brave; desktop_id=brave-browser.desktop; name="Brave" ;;
brave-origin) command=brave-origin; desktop_id=brave-origin.desktop; name="Brave Origin" ;;
edge) command=microsoft-edge-stable; desktop_id=microsoft-edge.desktop; name="Edge" ;;
helium) command=helium-browser; desktop_id=helium.desktop; name="Helium" ;;
opera) command=opera; desktop_id=opera.desktop; name="Opera" ;;
vivaldi) command=vivaldi-stable; desktop_id=vivaldi-stable.desktop; name="Vivaldi" ;;
*)
echo "Usage: omarchy-default-webapp-browser <auto|chromium|chrome|brave|brave-origin|edge|helium|opera|vivaldi>" >&2
exit 1
;;
esac

if [[ $desktop_id != "auto" ]] && omarchy-cmd-missing "$command"; then
echo "Install $1 with 'omarchy install browser $1' before selecting it as the web app browser." >&2
exit 1
fi

mkdir -p "$(dirname "$config")"
temporary=$(mktemp "${config}.XXXXXX")
trap 'rm -f "$temporary"' EXIT
printf '%s\n' "$desktop_id" > "$temporary"
mv -f "$temporary" "$config"

if [[ $desktop_id == "auto" ]]; then
omarchy-notification-send -g 󰖟 "$(omarchy-i18n default.webappBrowserAuto)"
else
omarchy-notification-send -g 󰖟 "$(omarchy-i18n default.webappBrowserSet "$name")"
fi
14 changes: 12 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|zen|helium>
# omarchy:examples=omarchy install browser chromium | omarchy install browser firefox

set -e
Expand Down Expand Up @@ -105,6 +105,16 @@ firefox)
omarchy-lifecycle-dispatch post-install firefox
announce_browser_installed "Firefox"
;;
helium)
echo "Installing Helium..."
omarchy-pkg-aur-add helium-browser-bin || exit 1

setup_chromium_policy_directory /etc/chromium/policies/managed
copy_chromium_flags ~/.config/helium-browser-flags.conf
omarchy-theme-set-browser
omarchy-lifecycle-dispatch post-install helium
announce_browser_installed "Helium"
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
;;
zen)
echo "Installing Zen..."
omarchy-pkg-aur-add zen-browser-bin || exit 1
Expand All @@ -115,7 +125,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|zen|helium>"
exit 1
;;
esac
45 changes: 33 additions & 12 deletions bin/omarchy-launch-webapp
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
#!/bin/bash

# omarchy:summary=Launch a URL as a web app in the default supported browser
# omarchy:summary=Launch a URL as a web app in the selected web app browser
# omarchy:args=<url>

browser=$(omarchy-cmd-default-browser)
browser=$(omarchy-default-webapp-browser) || exit 1

case $browser in
google-chrome* | brave* | microsoft-edge* | opera* | vivaldi* | helium*) ;;
*) browser="chromium.desktop" ;;
esac
if [[ $browser == "auto" ]]; then
selected=false
browser=$(omarchy-cmd-default-browser)
case $browser in
google-chrome* | brave* | microsoft-edge* | opera* | vivaldi* | helium*) ;;
*) browser="chromium.desktop" ;;
esac
else
selected=true
case $browser in
chromium* | google-chrome* | brave* | microsoft-edge* | opera* | vivaldi* | helium*) ;;
*)
echo "omarchy-launch-webapp: unsupported web app browser $browser; choose one with 'omarchy default webapp-browser'" >&2
omarchy-notification-send -u critical -g 󰖟 "$(omarchy-i18n browser.webappBrowserMissing)" "$(omarchy-i18n browser.webappBrowserMissingHint)"
exit 1
;;
esac
fi

# Read Exec= from the same data dirs omarchy-cmd-default-browser searched, as
# omarchy-launch-browser does, so a browser it resolved is one this can start.
Expand All @@ -22,14 +36,21 @@ for data_dir in "${data_dirs[@]}"; do
done

# Handing an empty command to uwsm-app surfaces as "Command not found: \"\"",
# which fails a keybinding silently. A web app runs in a Chromium-based
# browser, so say that rather than claiming no browser is set.
if [[ -z $browser_exec ]]; then
echo "omarchy-launch-webapp: web apps need a Chromium-based browser; install Chromium with 'omarchy install browser chromium'" >&2
omarchy-notification-send -u critical -g 󰖟 "$(omarchy-i18n browser.webappNeedsChromium)" "$(omarchy-i18n browser.webappNeedsChromiumHint)"
# which fails a keybinding silently. A selected browser that was removed says
# so, rather than opening a different browser profile. Otherwise a web app
# runs in a Chromium-based browser, so say that rather than claiming no
# browser is set.
if [[ -z $browser_exec ]] || omarchy-cmd-missing "$browser_exec"; then
if [[ $selected == "true" ]]; then
echo "omarchy-launch-webapp: web app browser $browser is not installed; choose another with 'omarchy default webapp-browser'" >&2
omarchy-notification-send -u critical -g 󰖟 "$(omarchy-i18n browser.webappBrowserMissing)" "$(omarchy-i18n browser.webappBrowserMissingHint)"
else
echo "omarchy-launch-webapp: web apps need a Chromium-based browser; install Chromium with 'omarchy install browser chromium'" >&2
omarchy-notification-send -u critical -g 󰖟 "$(omarchy-i18n browser.webappNeedsChromium)" "$(omarchy-i18n browser.webappNeedsChromiumHint)"
fi
exit 1
fi

if ! omarchy-cmd-browser-handoff "$browser_exec" --app="$1" "${@:2}"; then
exec setsid uwsm-app -- $browser_exec --app="$1" "${@:2}"
exec setsid uwsm-app -- "$browser_exec" --app="$1" "${@:2}"
fi
10 changes: 8 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|zen|helium>
# omarchy:examples=omarchy remove browser firefox | omarchy remove browser brave
# omarchy:requires-sudo=true

Expand Down Expand Up @@ -58,13 +58,19 @@ firefox)
set_fallback_default_browser firefox.desktop
omarchy-pkg-drop firefox
;;
helium)
echo "Removing Helium..."
set_fallback_default_browser helium.desktop
omarchy-pkg-drop helium-browser-bin
rm -f ~/.config/helium-browser-flags.conf
;;
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|zen|helium>"
exit 1
;;
esac
3 changes: 2 additions & 1 deletion bin/omarchy-theme-set-browser
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# omarchy:summary=Apply the current theme color to Chromium, Chrome, Edge, and Brave
# omarchy:summary=Apply the current theme color to Chromium, Chrome, Edge, Brave, and Helium
# omarchy:hidden=true

source "$OMARCHY_PATH/install/helpers/browser-policy.sh"
Expand Down Expand Up @@ -76,6 +76,7 @@ done
# Match on the binary path: the running process is named plain "brave", and a
# bare brave-origin pattern would also match the installer's own terminal.
[[ $running_args == *"/opt/brave-origin-bin/"* ]] && omarchy-cmd-present brave-origin && browsers_to_refresh+=(brave-origin)
[[ $running_args == *"/opt/helium-browser-bin/"* ]] && omarchy-cmd-present helium-browser && browsers_to_refresh+=(helium-browser)

wait "$policy_pid" || failed=1

Expand Down
4 changes: 4 additions & 0 deletions default/i18n/en/cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@
"browser.notFoundHint": "Install a browser or set one with: omarchy default browser <browser>",
"browser.webappNeedsChromium": "Web apps need a Chromium-based browser",
"browser.webappNeedsChromiumHint": "Install Chromium with: omarchy install browser chromium",
"browser.webappBrowserMissing": "The web app browser is not installed",
"browser.webappBrowserMissingHint": "Choose another under Setup > Defaults > Web App Browser",
"capture.audioNotAdded": "The %1 audio could not be added to this recording.",
"capture.noRecordingDir": "Screen recording directory does not exist: %1",
"capture.noWebcam": "No webcam devices found",
Expand Down Expand Up @@ -104,6 +106,8 @@
"crash.diagnose": "Click to diagnose with AI",
"crash.processCrashed": "Process crashed: %1",
"default.browserSet": "%1 is now the default browser",
"default.webappBrowserAuto": "Web apps now follow the default browser",
"default.webappBrowserSet": "%1 is now the web app browser",
"default.editorSet": "%1 is now the default editor",
"default.terminalSet": "%1 is now the default terminal",
"dictation.hexReady": "Hex Dictation Ready",
Expand Down
40 changes: 40 additions & 0 deletions default/i18n/en/menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,40 @@
"setup.default.browser.zen": {
"label": "Zen"
},
"setup.default.browser.helium": {
"label": "Helium"
},
"setup.default.webapp-browser": {
"label": "Web App Browser",
"title": "Web App Browser"
},
"setup.default.webapp-browser.auto": {
"label": "Automatic"
},
"setup.default.webapp-browser.chromium": {
"label": "Chromium"
},
"setup.default.webapp-browser.chrome": {
"label": "Chrome"
},
"setup.default.webapp-browser.brave": {
"label": "Brave"
},
"setup.default.webapp-browser.brave-origin": {
"label": "Brave Origin"
},
"setup.default.webapp-browser.edge": {
"label": "Edge"
},
"setup.default.webapp-browser.helium": {
"label": "Helium"
},
"setup.default.webapp-browser.opera": {
"label": "Opera"
},
"setup.default.webapp-browser.vivaldi": {
"label": "Vivaldi"
},
"setup.default.dictation": {
"label": "Dictation",
"title": "Default Dictation"
Expand Down Expand Up @@ -794,6 +828,9 @@
"install.browser.zen": {
"label": "Zen"
},
"install.browser.helium": {
"label": "Helium"
},
"install.service.1password": {
"label": "1Password"
},
Expand Down Expand Up @@ -1067,6 +1104,9 @@
"remove.browser.zen": {
"label": "Zen"
},
"remove.browser.helium": {
"label": "Helium"
},
"remove.service.1password": {
"label": "1Password"
},
Expand Down
13 changes: 13 additions & 0 deletions default/omarchy/omarchy-menu.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,17 @@
"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.zen": {"icon":"󰖟","label":"Zen","checked":"[[ \"$(omarchy-default-browser)\" == \"zen\" ]]","action":"omarchy-default-browser zen"},
"setup.default.browser.helium": {"icon":"󰖟","label":"Helium","checked":"[[ \"$(omarchy-default-browser)\" == \"helium\" ]]","action":"omarchy-default-browser helium"},
"setup.default.webapp-browser": {"icon":"","label":"Web App Browser","title":"Web App Browser"},
"setup.default.webapp-browser.auto": {"icon":"󰖟","label":"Automatic","checked":"[[ \"$(omarchy-default-webapp-browser)\" == \"auto\" ]]","action":"omarchy-default-webapp-browser auto"},
Comment thread
greptile-apps[bot] marked this conversation as resolved.
Resolved
"setup.default.webapp-browser.chromium": {"icon":"󰖟","label":"Chromium","checked":"[[ \"$(omarchy-default-webapp-browser)\" == \"chromium.desktop\" ]]","action":"omarchy-default-webapp-browser chromium","when":"omarchy-cmd-present chromium"},
"setup.default.webapp-browser.chrome": {"icon":"󰖟","label":"Chrome","checked":"[[ \"$(omarchy-default-webapp-browser)\" == \"google-chrome.desktop\" ]]","action":"omarchy-default-webapp-browser chrome","when":"omarchy-cmd-present google-chrome-stable"},
"setup.default.webapp-browser.brave": {"icon":"󰖟","label":"Brave","checked":"[[ \"$(omarchy-default-webapp-browser)\" == \"brave-browser.desktop\" ]]","action":"omarchy-default-webapp-browser brave","when":"omarchy-cmd-present brave"},
"setup.default.webapp-browser.brave-origin": {"icon":"󰖟","label":"Brave Origin","checked":"[[ \"$(omarchy-default-webapp-browser)\" == \"brave-origin.desktop\" ]]","action":"omarchy-default-webapp-browser brave-origin","when":"omarchy-cmd-present brave-origin"},
"setup.default.webapp-browser.edge": {"icon":"󰖟","label":"Edge","checked":"[[ \"$(omarchy-default-webapp-browser)\" == \"microsoft-edge.desktop\" ]]","action":"omarchy-default-webapp-browser edge","when":"omarchy-cmd-present microsoft-edge-stable"},
"setup.default.webapp-browser.helium": {"icon":"󰖟","label":"Helium","checked":"[[ \"$(omarchy-default-webapp-browser)\" == \"helium.desktop\" ]]","action":"omarchy-default-webapp-browser helium","when":"omarchy-cmd-present helium-browser"},
"setup.default.webapp-browser.opera": {"icon":"󰖟","label":"Opera","checked":"[[ \"$(omarchy-default-webapp-browser)\" == \"opera.desktop\" ]]","action":"omarchy-default-webapp-browser opera","when":"omarchy-cmd-present opera"},
"setup.default.webapp-browser.vivaldi": {"icon":"󰖟","label":"Vivaldi","checked":"[[ \"$(omarchy-default-webapp-browser)\" == \"vivaldi-stable.desktop\" ]]","action":"omarchy-default-webapp-browser vivaldi","when":"omarchy-cmd-present vivaldi-stable"},
"setup.default.dictation": {"icon":"","label":"Dictation","title":"Default Dictation"},
"setup.default.dictation.hex": {"icon":"","label":"Hex","checked":"[[ \"$(omarchy-default-dictation)\" == \"hex\" ]]","action":"omarchy-default-dictation hex"},
"setup.default.dictation.superwhisper": {"icon":"","label":"Superwhisper","checked":"[[ \"$(omarchy-default-dictation)\" == \"superwhisper\" ]]","action":"omarchy-default-dictation superwhisper"},
Expand Down Expand Up @@ -295,6 +306,7 @@
"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.zen": {"icon":"󰖟","label":"Zen","disabled":"omarchy-pkg-present zen-browser-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser zen'"},
"install.browser.helium": {"icon":"󰖟","label":"Helium","disabled":"omarchy-pkg-present helium-browser-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-install-browser helium'"},
"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"},
"install.service.spotify": {"icon":"󰓇","label":"Spotify","disabled":"omarchy-pkg-present spotify || [[ -f $HOME/.local/share/applications/Spotify.desktop ]]","action":"omarchy-launch-floating-terminal-with-presentation omarchy-install-service-spotify"},
Expand Down Expand Up @@ -386,6 +398,7 @@
"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.zen": {"icon":"","label":"Zen","when":"omarchy-pkg-present zen-browser-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-remove-browser zen'"},
"remove.browser.helium": {"icon":"󰖟","label":"Helium","when":"omarchy-pkg-present helium-browser-bin","action":"omarchy-launch-floating-terminal-with-presentation 'omarchy-remove-browser helium'"},
"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"},
"remove.service.tailscale": {"icon":"","iconFont":"omarchy","label":"Tailscale","when":"omarchy-pkg-present tailscale","action":"omarchy-launch-floating-terminal-with-presentation omarchy-remove-service-tailscale"},
Expand Down
Loading