mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
* Add omarchy CLI * Remove outdated or internal * Add bash completions for command * Add omarchy command documentation * Add missing docs * Correct to what's now right * Fix tests --------- Co-authored-by: David Heinemeier Hansson <david@hey.com>
42 lines
1.1 KiB
Bash
Executable File
42 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# omarchy:summary=Install one of the approved terminals and set it as the default for Omarchy (Super + Return etc).
|
|
# omarchy:args=<alacritty|ghostty|kitty>
|
|
# omarchy:requires-sudo=true
|
|
|
|
if (($# == 0)); then
|
|
echo "Usage: omarchy-install-terminal [alacritty|ghostty|kitty]"
|
|
exit 1
|
|
fi
|
|
|
|
package="$1"
|
|
|
|
# Map package name to desktop entry ID
|
|
case "$package" in
|
|
alacritty) desktop_id="Alacritty.desktop" ;;
|
|
ghostty) desktop_id="com.mitchellh.ghostty.desktop" ;;
|
|
kitty) desktop_id="kitty.desktop" ;;
|
|
*)
|
|
echo "Unknown terminal: $package"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# Install package
|
|
if omarchy-pkg-add $package; then
|
|
# Copy custom desktop entry for alacritty with X-TerminalArg* keys
|
|
if [[ $package == "alacritty" ]]; then
|
|
mkdir -p ~/.local/share/applications
|
|
cp $OMARCHY_PATH/applications/Alacritty.desktop ~/.local/share/applications/
|
|
fi
|
|
|
|
# Update xdg-terminals.list to prioritize the proper terminal
|
|
cat >~/.config/xdg-terminals.list <<EOF
|
|
# Terminal emulator preference order for xdg-terminal-exec
|
|
# The first found and valid terminal will be used
|
|
$desktop_id
|
|
EOF
|
|
else
|
|
echo "Failed to install $package"
|
|
fi
|