Install missing apps when choosing defaults (#6950)

* Install missing apps when choosing defaults

* Restore Chromium through browser installer

* Trust default app installer status

* Use full conditionals for install paths
This commit is contained in:
David Heinemeier Hansson
2026-08-15 12:34:28 +02:00
committed by GitHub
parent 9b72edcc94
commit b724f76156
9 changed files with 394 additions and 44 deletions
+18 -4
View File
@@ -4,6 +4,12 @@
# omarchy:args=[alacritty|foot|ghostty|kitty]
# omarchy:examples=omarchy default terminal ghostty | omarchy default terminal kitty
installing=false
if [[ ${1:-} == "--install" ]]; then
installing=true
shift
fi
if (($# == 0)); then
desktop_id=$(xdg-terminal-exec --print-id 2>/dev/null || true)
desktop_id=${desktop_id%%:*}
@@ -18,16 +24,24 @@ if (($# == 0)); then
fi
case "$1" in
alacritty) desktop_id="Alacritty.desktop"; name="Alacritty"; glyph= ;;
foot) desktop_id="foot.desktop"; name="Foot"; glyph= ;;
ghostty) desktop_id="com.mitchellh.ghostty.desktop"; name="Ghostty"; glyph= ;;
kitty) desktop_id="kitty.desktop"; name="Kitty"; glyph= ;;
alacritty) terminal="alacritty"; desktop_id="Alacritty.desktop"; name="Alacritty"; glyph= ;;
foot) terminal="foot"; desktop_id="foot.desktop"; name="Foot"; glyph= ;;
ghostty) terminal="ghostty"; desktop_id="com.mitchellh.ghostty.desktop"; name="Ghostty"; glyph= ;;
kitty) terminal="kitty"; desktop_id="kitty.desktop"; name="Kitty"; glyph= ;;
*)
echo "Usage: omarchy-default-terminal <alacritty|foot|ghostty|kitty>"
exit 1
;;
esac
if omarchy-cmd-missing "$terminal"; then
if [[ $installing == "false" ]]; then
exec omarchy-launch-floating-terminal-with-presentation omarchy-default-terminal --install "$terminal"
else
omarchy-install-terminal "$terminal" || exit 1
fi
fi
cat >~/.config/xdg-terminals.list <<EOF
# Terminal emulator preference order for xdg-terminal-exec
# The first found and valid terminal will be used