Not worth the extraction

This commit is contained in:
David Heinemeier Hansson
2026-05-08 20:52:29 +02:00
parent df4ffe991f
commit 30f9a8da54
8 changed files with 43 additions and 71 deletions
-1
View File
@@ -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"
-9
View File
@@ -1,9 +0,0 @@
#!/bin/bash
# omarchy:summary=Print a failure message in red
# omarchy:args=<message>
RED='\033[0;31m'
NC='\033[0m'
echo -e "${RED}$*${NC}"
-9
View File
@@ -1,9 +0,0 @@
#!/bin/bash
# omarchy:summary=Print an informational message in yellow
# omarchy:args=<message>
YELLOW='\033[1;33m'
NC='\033[0m'
echo -e "${YELLOW}$*${NC}"
-9
View File
@@ -1,9 +0,0 @@
#!/bin/bash
# omarchy:summary=Print a success message in green
# omarchy:args=<message>
GREEN='\033[0;32m'
NC='\033[0m'
echo -e "${GREEN}$*${NC}"
+6 -6
View File
@@ -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"
+6 -6
View File
@@ -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"
+16 -16
View File
@@ -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
+15 -15
View File
@@ -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 = <span> 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