From 30f9a8da5455882b666c6627862dabca5da9e580 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 8 May 2026 20:52:09 +0200 Subject: [PATCH] Not worth the extraction --- bin/omarchy | 1 - bin/omarchy-echo-failure | 9 ------- bin/omarchy-echo-info | 9 ------- bin/omarchy-echo-success | 9 ------- bin/omarchy-remove-security-fido2 | 12 +++++----- bin/omarchy-remove-security-fingerprint | 12 +++++----- bin/omarchy-setup-security-fido2 | 32 ++++++++++++------------- bin/omarchy-setup-security-fingerprint | 30 +++++++++++------------ 8 files changed, 43 insertions(+), 71 deletions(-) delete mode 100755 bin/omarchy-echo-failure delete mode 100755 bin/omarchy-echo-info delete mode 100755 bin/omarchy-echo-success diff --git a/bin/omarchy b/bin/omarchy index 863d5104..c23a6457 100755 --- a/bin/omarchy +++ b/bin/omarchy @@ -53,7 +53,6 @@ GROUP_DESCRIPTIONS[npx]="NPX package wrappers" GROUP_DESCRIPTIONS[pkg]="Package management helpers" GROUP_DESCRIPTIONS[plymouth]="Plymouth boot theme management" GROUP_DESCRIPTIONS[powerprofiles]="Power profile management" -GROUP_DESCRIPTIONS[echo]="Colored terminal output helpers" GROUP_DESCRIPTIONS[refresh]="Reset config to defaults" GROUP_DESCRIPTIONS[reinstall]="Reinstall and reset workflows" GROUP_DESCRIPTIONS[reminder]="Desktop notification reminders" diff --git a/bin/omarchy-echo-failure b/bin/omarchy-echo-failure deleted file mode 100755 index 6a0e2e3c..00000000 --- a/bin/omarchy-echo-failure +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# omarchy:summary=Print a failure message in red -# omarchy:args= - -RED='\033[0;31m' -NC='\033[0m' - -echo -e "${RED}$*${NC}" diff --git a/bin/omarchy-echo-info b/bin/omarchy-echo-info deleted file mode 100755 index b48543cc..00000000 --- a/bin/omarchy-echo-info +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# omarchy:summary=Print an informational message in yellow -# omarchy:args= - -YELLOW='\033[1;33m' -NC='\033[0m' - -echo -e "${YELLOW}$*${NC}" diff --git a/bin/omarchy-echo-success b/bin/omarchy-echo-success deleted file mode 100755 index 40bc21b5..00000000 --- a/bin/omarchy-echo-success +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -# omarchy:summary=Print a success message in green -# omarchy:args= - -GREEN='\033[0;32m' -NC='\033[0m' - -echo -e "${GREEN}$*${NC}" diff --git a/bin/omarchy-remove-security-fido2 b/bin/omarchy-remove-security-fido2 index f8925767..c93b490f 100755 --- a/bin/omarchy-remove-security-fido2 +++ b/bin/omarchy-remove-security-fido2 @@ -9,27 +9,27 @@ set -e remove_pam_config() { # Remove from sudo if grep -q pam_u2f.so /etc/pam.d/sudo; then - omarchy-echo-info "Removing FIDO2 authentication from sudo..." + echo "Removing FIDO2 authentication from sudo..." sudo sed -i '/pam_u2f\.so/d' /etc/pam.d/sudo fi # Remove from polkit if [[ -f /etc/pam.d/polkit-1 ]] && grep -Fq 'pam_u2f.so' /etc/pam.d/polkit-1; then - omarchy-echo-info "Removing FIDO2 authentication from polkit..." + echo "Removing FIDO2 authentication from polkit..." sudo sed -i '/pam_u2f\.so/d' /etc/pam.d/polkit-1 fi } -omarchy-echo-success "Removing FIDO2 device from authentication.\n" +echo -e "\e[32mRemoving FIDO2 device from authentication.\n\e[0m" remove_pam_config if [[ -d /etc/fido2 ]]; then - omarchy-echo-info "Removing FIDO2 configuration..." + echo "Removing FIDO2 configuration..." sudo rm -rf /etc/fido2 fi -omarchy-echo-info "Removing FIDO2 packages..." +echo "Removing FIDO2 packages..." omarchy-pkg-drop libfido2 pam-u2f -omarchy-echo-success "FIDO2 authentication has been completely removed." +echo -e "\e[32mFIDO2 authentication has been completely removed.\e[0m" diff --git a/bin/omarchy-remove-security-fingerprint b/bin/omarchy-remove-security-fingerprint index ba3bd4c4..1bbc7982 100755 --- a/bin/omarchy-remove-security-fingerprint +++ b/bin/omarchy-remove-security-fingerprint @@ -9,29 +9,29 @@ set -e remove_pam_config() { # Remove from sudo if grep -q pam_fprintd.so /etc/pam.d/sudo; then - omarchy-echo-info "Removing fingerprint authentication from sudo..." + echo "Removing fingerprint authentication from sudo..." sudo sed -i '/pam_fprintd\.so/d' /etc/pam.d/sudo fi # Remove from polkit if [[ -f /etc/pam.d/polkit-1 ]] && grep -Fq 'pam_fprintd.so' /etc/pam.d/polkit-1; then - omarchy-echo-info "Removing fingerprint authentication from polkit..." + echo "Removing fingerprint authentication from polkit..." sudo sed -i '/pam_fprintd\.so/d' /etc/pam.d/polkit-1 fi } remove_hyprlock_fingerprint_icon() { - omarchy-echo-info "Removing fingerprint icon from hyprlock placeholder text..." + echo "Removing fingerprint icon from hyprlock placeholder text..." sed -i 's/placeholder_text = .*/placeholder_text = Enter Password/' ~/.config/hypr/hyprlock.conf sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = false/' ~/.config/hypr/hyprlock.conf } -omarchy-echo-success "Removing fingerprint scanner from authentication.\n" +echo -e "\e[32mRemoving fingerprint scanner from authentication.\n\e[0m" remove_pam_config remove_hyprlock_fingerprint_icon -omarchy-echo-info "Removing fingerprint packages..." +echo "Removing fingerprint packages..." omarchy-pkg-drop fprintd libfprint-git -omarchy-echo-success "Fingerprint authentication has been completely removed." +echo -e "\e[32mFingerprint authentication has been completely removed.\e[0m" diff --git a/bin/omarchy-setup-security-fido2 b/bin/omarchy-setup-security-fido2 index 603add90..8513968e 100755 --- a/bin/omarchy-setup-security-fido2 +++ b/bin/omarchy-setup-security-fido2 @@ -9,7 +9,7 @@ set -e check_fido2_hardware() { tokens=$(fido2-token -L 2>/dev/null) if [[ -z $tokens ]]; then - omarchy-echo-failure "\nNo FIDO2 device detected. Please plug it in (you may need to unlock it as well)." + echo -e "\e[31m\nNo FIDO2 device detected. Please plug it in (you may need to unlock it as well).\e[0m" return 1 fi return 0 @@ -18,16 +18,16 @@ check_fido2_hardware() { setup_pam_config() { # Configure sudo if ! grep -q pam_u2f.so /etc/pam.d/sudo; then - omarchy-echo-info "Configuring sudo for FIDO2 authentication..." + echo "Configuring sudo for FIDO2 authentication..." sudo sed -i '1i auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2' /etc/pam.d/sudo fi # Configure polkit if [[ -f /etc/pam.d/polkit-1 ]] && ! grep -q 'pam_u2f.so' /etc/pam.d/polkit-1; then - omarchy-echo-info "Configuring polkit for FIDO2 authentication..." + echo "Configuring polkit for FIDO2 authentication..." sudo sed -i '1i auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2' /etc/pam.d/polkit-1 elif [[ ! -f /etc/pam.d/polkit-1 ]]; then - omarchy-echo-info "Creating polkit configuration with FIDO2 authentication..." + echo "Creating polkit configuration with FIDO2 authentication..." sudo tee /etc/pam.d/polkit-1 >/dev/null <<'EOF' auth sufficient pam_u2f.so cue authfile=/etc/fido2/fido2 auth required pam_unix.so @@ -39,10 +39,10 @@ EOF fi } -omarchy-echo-success "Setting up FIDO2 device for authentication.\n" +echo -e "\e[32mSetting up FIDO2 device for authentication.\n\e[0m" # Install required packages -omarchy-echo-info "Installing required packages..." +echo "Installing required packages..." omarchy-pkg-add libfido2 pam-u2f if ! check_fido2_hardware; then @@ -52,30 +52,30 @@ fi # Create the pamu2fcfg file if [[ ! -f /etc/fido2/fido2 ]]; then sudo mkdir -p /etc/fido2 - omarchy-echo-success "\nLet's setup your device by confirming on the device now." - omarchy-echo-info "Touch your FIDO2 key when it lights up...\n" + echo -e "\e[32m\nLet's setup your device by confirming on the device now.\e[0m" + echo -e "Touch your FIDO2 key when it lights up...\n" if pamu2fcfg >/tmp/fido2; then sudo mv /tmp/fido2 /etc/fido2/fido2 - omarchy-echo-success "FIDO2 device registered successfully!" + echo -e "\e[32mFIDO2 device registered successfully!\e[0m" else - omarchy-echo-failure "\nFIDO2 registration failed. Please try again." + echo -e "\e[31m\nFIDO2 registration failed. Please try again.\e[0m" exit 1 fi else - omarchy-echo-info "FIDO2 device already registered." + echo "FIDO2 device already registered." fi # Configure PAM setup_pam_config # Test with sudo -omarchy-echo-info "\nTesting FIDO2 authentication with sudo..." -omarchy-echo-info "Touch your FIDO2 key when prompted.\n" +echo -e "\nTesting FIDO2 authentication with sudo..." +echo -e "Touch your FIDO2 key when prompted.\n" if sudo echo "FIDO2 authentication test successful"; then - omarchy-echo-success "\nPerfect! FIDO2 authentication is now configured." - omarchy-echo-info "You can use your FIDO2 key for sudo and polkit authentication." + echo -e "\e[32m\nPerfect! FIDO2 authentication is now configured.\e[0m" + echo "You can use your FIDO2 key for sudo and polkit authentication." else - omarchy-echo-failure "\nVerification failed. You may want to check your configuration." + echo -e "\e[31m\nVerification failed. You may want to check your configuration.\e[0m" fi diff --git a/bin/omarchy-setup-security-fingerprint b/bin/omarchy-setup-security-fingerprint index 821f2472..f704348e 100755 --- a/bin/omarchy-setup-security-fingerprint +++ b/bin/omarchy-setup-security-fingerprint @@ -12,7 +12,7 @@ check_fingerprint_hardware() { # Exit if no devices found if [[ -z $devices ]]; then - omarchy-echo-failure "\nNo fingerprint sensor detected." + echo -e "\e[31m\nNo fingerprint sensor detected.\e[0m" return 1 fi return 0 @@ -21,16 +21,16 @@ check_fingerprint_hardware() { setup_pam_config() { # Configure sudo if ! grep -q pam_fprintd.so /etc/pam.d/sudo; then - omarchy-echo-info "Configuring sudo for fingerprint authentication..." + echo "Configuring sudo for fingerprint authentication..." sudo sed -i '1i auth sufficient pam_fprintd.so' /etc/pam.d/sudo fi # Configure polkit if [[ -f /etc/pam.d/polkit-1 ]] && ! grep -q 'pam_fprintd.so' /etc/pam.d/polkit-1; then - omarchy-echo-info "Configuring polkit for fingerprint authentication..." + echo "Configuring polkit for fingerprint authentication..." sudo sed -i '1i auth sufficient pam_fprintd.so' /etc/pam.d/polkit-1 elif [[ ! -f /etc/pam.d/polkit-1 ]]; then - omarchy-echo-info "Creating polkit configuration with fingerprint authentication..." + echo "Creating polkit configuration with fingerprint authentication..." sudo tee /etc/pam.d/polkit-1 >/dev/null <<'EOF' auth sufficient pam_fprintd.so auth required pam_unix.so @@ -43,15 +43,15 @@ EOF } add_hyprlock_fingerprint_icon() { - omarchy-echo-info "Adding fingerprint icon to hyprlock placeholder text..." + echo "Adding fingerprint icon to hyprlock placeholder text..." sed -i 's/placeholder_text = .*/placeholder_text = Enter Password 󰈷 <\/span>/' ~/.config/hypr/hyprlock.conf sed -i 's/fingerprint:enabled = .*/fingerprint:enabled = true/' ~/.config/hypr/hyprlock.conf } -omarchy-echo-success "Setting up fingerprint scanner for authentication.\n" +echo -e "\e[32mSetting up fingerprint scanner for authentication.\n\e[0m" # Install required packages -omarchy-echo-info "Installing required packages..." +echo "Installing required packages..." # libfprint-git provides+conflicts libfprint; pacman -S --noconfirm # defaults the conflict prompt to N and aborts. Pre-remove libfprint @@ -75,21 +75,21 @@ setup_pam_config add_hyprlock_fingerprint_icon # Enroll first fingerprint -omarchy-echo-success "\nLet's setup your right index finger as the first fingerprint." -omarchy-echo-info "Keep moving the finger around on sensor until the process completes.\n" +echo -e "\e[32m\nLet's setup your right index finger as the first fingerprint.\e[0m" +echo -e "Keep moving the finger around on sensor until the process completes.\n" if sudo fprintd-enroll "$USER"; then - omarchy-echo-success "\nFingerprint enrolled successfully!" + echo -e "\e[32m\nFingerprint enrolled successfully!\e[0m" # Verify - omarchy-echo-info "\nNow let's verify that it's working correctly.\n" + echo -e "\nNow let's verify that it's working correctly.\n" if fprintd-verify; then - omarchy-echo-success "\nPerfect! Fingerprint authentication is now configured." - omarchy-echo-info "You can use your fingerprint for sudo, polkit, and lock screen (Super + Escape)." + echo -e "\e[32m\nPerfect! Fingerprint authentication is now configured.\e[0m" + echo "You can use your fingerprint for sudo, polkit, and lock screen (Super + Escape)." else - omarchy-echo-failure "\nVerification failed. You may want to try enrolling again." + echo -e "\e[31m\nVerification failed. You may want to try enrolling again.\e[0m" fi else - omarchy-echo-failure "\nEnrollment failed. Please try again." + echo -e "\e[31m\nEnrollment failed. Please try again.\e[0m" exit 1 fi