From 567b05c489b1266442d106513b87c8d2b77b3caa Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 8 Aug 2025 15:07:07 +0200 Subject: [PATCH] Use present_terminal in omarchy-menu to do fancy command presentation Then the individual commands can be clean --- bin/omarchy-menu | 12 ++++++------ bin/omarchy-setup-fido2 | 4 ---- bin/omarchy-setup-fingerprint | 4 ---- bin/omarchy-update | 6 ------ bin/omarchy-webapp-install | 2 -- bin/omarchy-webapp-remove | 3 --- 6 files changed, 6 insertions(+), 25 deletions(-) diff --git a/bin/omarchy-menu b/bin/omarchy-menu index 715654ab..28ef726a 100755 --- a/bin/omarchy-menu +++ b/bin/omarchy-menu @@ -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 } diff --git a/bin/omarchy-setup-fido2 b/bin/omarchy-setup-fido2 index 11f29df5..abe6c5da 100755 --- a/bin/omarchy-setup-fido2 +++ b/bin/omarchy-setup-fido2 @@ -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 diff --git a/bin/omarchy-setup-fingerprint b/bin/omarchy-setup-fingerprint index 6e512db1..b1f29d84 100755 --- a/bin/omarchy-setup-fingerprint +++ b/bin/omarchy-setup-fingerprint @@ -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 diff --git a/bin/omarchy-update b/bin/omarchy-update index 191b2e07..246bb83a 100755 --- a/bin/omarchy-update +++ b/bin/omarchy-update @@ -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 diff --git a/bin/omarchy-webapp-install b/bin/omarchy-webapp-install index 1e4cb179..b54a881f 100755 --- a/bin/omarchy-webapp-install +++ b/bin/omarchy-webapp-install @@ -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 diff --git a/bin/omarchy-webapp-remove b/bin/omarchy-webapp-remove index 4d0a6849..2897a8b2 100755 --- a/bin/omarchy-webapp-remove +++ b/bin/omarchy-webapp-remove @@ -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