Use present_terminal in omarchy-menu to do fancy command presentation

Then the individual commands can be clean
This commit is contained in:
David Heinemeier Hansson 2025-08-08 15:07:07 +02:00
parent 3d489382e4
commit 567b05c489
6 changed files with 6 additions and 25 deletions

View File

@ -125,8 +125,8 @@ show_setup_menu() {
*Keybindings*) edit_in_nvim ~/.config/hypr/bindings.conf ;;
*Input*) edit_in_nvim ~/.config/hypr/input.conf ;;
*Configs*) show_setup_configs_menu ;;
*Fingerprint*) terminal $OMARCHY_BIN_PATH/omarchy-setup-fingerprint ;;
*Fido2*) terminal $OMARCHY_BIN_PATH/omarchy-setup-fido2 ;;
*Fingerprint*) present_terminal $OMARCHY_BIN_PATH/omarchy-setup-fingerprint ;;
*Fido2*) present_terminal $OMARCHY_BIN_PATH/omarchy-setup-fido2 ;;
*) show_main_menu ;;
esac
}
@ -159,7 +159,7 @@ show_setup_configs_menu() {
show_install_menu() {
case $(menu "Install" "󰣇 Package\n Web App\n Style\n Editor\n󱚤 AI\n Dropbox\n Steam\n Docker DB") in
*Package*) terminal $OMARCHY_BIN_PATH/omarchy-pkg-install ;;
*Web*) terminal $OMARCHY_BIN_PATH/omarchy-webapp-install ;;
*Web*) present_terminal $OMARCHY_BIN_PATH/omarchy-webapp-install ;;
*Style*) show_install_style_menu ;;
*Editor*) show_install_editor_menu ;;
*AI*) show_install_ai_menu ;;
@ -213,10 +213,10 @@ show_install_font_menu() {
show_remove_menu() {
case $(menu "Remove" "󰣇 Package\n Web App\n󰸌 Theme\n󰈷 Fingerprint\n Fido2") in
*Package*) terminal $OMARCHY_BIN_PATH/omarchy-pkg-remove ;;
*Web*) terminal $OMARCHY_BIN_PATH/omarchy-webapp-remove ;;
*Web*) present_terminal $OMARCHY_BIN_PATH/omarchy-webapp-remove ;;
*Theme*) present_terminal $OMARCHY_BIN_PATH/omarchy-theme-remove ;;
*Fingerprint*) terminal "$OMARCHY_BIN_PATH/omarchy-setup-fingerprint --remove" ;;
*Fido2*) terminal "$OMARCHY_BIN_PATH/omarchy-setup-fido2 --remove" ;;
*Fingerprint*) present_terminal "$OMARCHY_BIN_PATH/omarchy-setup-fingerprint --remove" ;;
*Fido2*) present_terminal "$OMARCHY_BIN_PATH/omarchy-setup-fido2 --remove" ;;
*) show_main_menu ;;
esac
}

View File

@ -1,7 +1,5 @@
#!/bin/bash
~/.local/share/omarchy/bin/omarchy-show-logo
if [[ "--remove" == "$1" ]]; then
echo -e "\e[32mLet's remove your Fido2 device from sudo authentication.\n\e[0m"
yay -Rns --noconfirm libfido2 pam-u2f
@ -39,5 +37,3 @@ else
fi
fi
fi
~/.local/share/omarchy/bin/omarchy-show-done

View File

@ -1,7 +1,5 @@
#!/bin/bash
~/.local/share/omarchy/bin/omarchy-show-logo
if [[ "--remove" == "$1" ]]; then
echo -e "\e[32mLet's remove your fingerprint scanner from authentication.\n\e[0m"
yay -Rns --noconfirm fprintd
@ -45,5 +43,3 @@ EOF
fi
fi
fi
~/.local/share/omarchy/bin/omarchy-show-done

View File

@ -3,10 +3,6 @@
# Exit immediately if a command exits with a non-zero status
set -e
# Show logo
clear
cat <~/.local/share/omarchy/logo.txt
# Get the latest while trying to preserve any modifications
omarchy_path=~/.local/share/omarchy
git -C $omarchy_path pull --autostash
@ -23,5 +19,3 @@ yay -Syu --noconfirm
if [ "$(uname -r | sed 's/-arch/\.arch/')" != "$(pacman -Q linux | awk '{print $2}')" ]; then
gum confirm "Linux kernel has been updated. Reboot?" && sudo reboot now
fi
~/.local/share/omarchy/bin/omarchy-show-done

View File

@ -1,7 +1,6 @@
#!/bin/bash
if [ "$#" -ne 3 ]; then
~/.local/share/omarchy/bin/omarchy-show-logo
echo -e "\e[32mLet's create a new web app you can start with the app launcher.\n\e[0m"
APP_NAME=$(gum input --prompt "Name> " --placeholder "My favorite web app")
APP_URL=$(gum input --prompt "URL> " --placeholder "https://example.com")
@ -44,5 +43,4 @@ chmod +x "$DESKTOP_FILE"
if [ "$#" -ne 3 ]; then
echo -e "You can now find $APP_NAME using the app launcher (SUPER + SPACE)\n"
~/.local/share/omarchy/bin/omarchy-show-done
fi

View File

@ -4,8 +4,6 @@ ICON_DIR="$HOME/.local/share/applications/icons"
DESKTOP_DIR="$HOME/.local/share/applications/"
if [ "$#" -ne 1 ]; then
~/.local/share/omarchy/bin/omarchy-show-logo
# Find all web apps
while IFS= read -r -d '' file; do
if grep -q '^Exec=.*chromium.*--app' "$file"; then
@ -35,5 +33,4 @@ rm "$ICON_DIR/$APP_NAME.png"
if [ "$#" -ne 1 ]; then
echo -e "Removed $APP_NAME\n"
~/.local/share/omarchy/bin/omarchy-show-done
fi