diff --git a/bin/omarchy-doctor b/bin/omarchy-doctor new file mode 100755 index 00000000..bde288ba --- /dev/null +++ b/bin/omarchy-doctor @@ -0,0 +1,161 @@ +#!/bin/bash + +# Request sudo upfront to avoid prompts during checks +sudo -v + +# Keep sudo alive during the script +(while true; do sudo -v; sleep 50; done) & +SUDO_REFRESH_PID=$! +trap "kill $SUDO_REFRESH_PID 2>/dev/null" EXIT + +# Define Omarchy locations +export OMARCHY_PATH="/home/ryan/Work/omarchy/omarchy-installer" +export OMARCHY_INSTALL="$OMARCHY_PATH/install" + +# Track results +failed_checks=0 +passed_checks=0 +skipped_checks=0 +total_checks=0 + +# Function to display a message with icon +show_message() { + local type="$1" + local msg="$2" + case "$type" in + error) printf " ❌ ERROR %s\n" "$msg" ;; + warning) printf " ⚠️ WARNING %s\n" "$msg" ;; + info) printf " ✅ OK %s\n" "$msg" ;; + esac +} + +# Function to check a single script +check_script() { + local script="$1" + local script_name="${script#$OMARCHY_INSTALL/}" + + # Check if script has verify function + if ! bash -c "source '$script' && declare -f omarchy_verify" >/dev/null 2>&1; then + ((skipped_checks++)) + return + fi + + ((total_checks++)) + + # Get friendly name + local friendly_name=$(bash -c "source '$script' 2>/dev/null; echo \"\${OMARCHY_DESCRIPTION:-$script_name}\"") + + # Run verification in subshell and capture output + local output + output=$( + errors=() + warnings=() + infos=() + + add_error() { errors+=("$1"); } + add_warning() { warnings+=("$1"); } + add_info() { infos+=("$1"); } + + source "$script" + omarchy_verify + exit_code=$? + + # Output results with delimiters + echo "EXIT:$exit_code" + for e in "${errors[@]}"; do echo "ERROR:$e"; done + for w in "${warnings[@]}"; do echo "WARNING:$w"; done + for i in "${infos[@]}"; do echo "INFO:$i"; done + ) + + # Parse output + local exit_code errors=() warnings=() infos=() + while IFS= read -r line; do + case "$line" in + EXIT:*) exit_code="${line#EXIT:}" ;; + ERROR:*) errors+=("${line#ERROR:}") ;; + WARNING:*) warnings+=("${line#WARNING:}") ;; + INFO:*) infos+=("${line#INFO:}") ;; + esac + done <<< "$output" + + # Handle skipped (return code 2) + if [[ $exit_code -eq 2 ]]; then + ((skipped_checks++)) + return + fi + + # Count messages + local error_count=${#errors[@]} + local warning_count=${#warnings[@]} + + # Determine status + local status_icon status_color + if [[ $error_count -gt 0 ]]; then + status_icon="❌" + status_color="1" # Red + ((failed_checks++)) + elif [[ $warning_count -gt 0 ]]; then + status_icon="⚠️" + status_color="3" # Yellow + ((passed_checks++)) + else + status_icon="✅" + status_color="2" # Green + ((passed_checks++)) + fi + + # Display result + printf "%s %s\n" "$status_icon" "$(gum style --foreground "$status_color" --bold "$friendly_name")" + + # Display messages if any errors or warnings + if [[ $error_count -gt 0 || $warning_count -gt 0 ]]; then + for msg in "${errors[@]}"; do + show_message error "$msg" + done + + for msg in "${warnings[@]}"; do + show_message warning "$msg" + done + + for msg in "${infos[@]}"; do + show_message info "$msg" + done + fi + + echo +} + +# Main execution +echo +gum style --italic --foreground 7 "Running health checks..." +echo + +# Process all scripts +while IFS= read -r script; do + # Skip certain directories + if [[ "$script" == */all.sh ]] || + [[ "$script" == */helpers/* ]] || + [[ "$script" == */preflight/* ]] || + [[ "$script" == */first-run/* ]] || + [[ "$script" == */post-install/* ]]; then + continue + fi + + check_script "$script" +done < <(find "$OMARCHY_INSTALL" -type f -name "*.sh" | sort) + +# Display summary +echo +echo "Summary:" +echo " Passed: $passed_checks/$total_checks" +[[ $failed_checks -gt 0 ]] && echo " Failed: $failed_checks/$total_checks" +[[ $skipped_checks -gt 0 ]] && echo " Skipped: $skipped_checks" + +echo + +if [[ $failed_checks -gt 0 ]]; then + echo "❌ Some checks failed. Please review the errors above." + exit 1 +else + echo "✅ All checks passed!" +fi diff --git a/install/config/branding.sh b/install/config/branding.sh index bad55f09..e5b28b58 100644 --- a/install/config/branding.sh +++ b/install/config/branding.sh @@ -1,4 +1,13 @@ -# Allow the user to change the branding for fastfetch and screensaver -mkdir -p ~/.config/omarchy/branding -cp ~/.local/share/omarchy/icon.txt ~/.config/omarchy/branding/about.txt -cp ~/.local/share/omarchy/logo.txt ~/.config/omarchy/branding/screensaver.txt +OMARCHY_DESCRIPTION="Branding Config" + +omarchy_install() { + mkdir -p ~/.config/omarchy/branding + cp ~/.local/share/omarchy/icon.txt ~/.config/omarchy/branding/about.txt + cp ~/.local/share/omarchy/logo.txt ~/.config/omarchy/branding/screensaver.txt +} + +omarchy_verify() { + [[ -d ~/.config/omarchy/branding ]] || add_error "Branding directory missing" + [[ -f ~/.config/omarchy/branding/about.txt ]] || add_error "About branding file missing" + [[ -f ~/.config/omarchy/branding/screensaver.txt ]] || add_error "Screensaver branding file missing" +} diff --git a/install/config/config.sh b/install/config/config.sh index 62f1417b..bdf9ae50 100644 --- a/install/config/config.sh +++ b/install/config/config.sh @@ -1,6 +1,18 @@ -# Copy over Omarchy configs -mkdir -p ~/.config -cp -R ~/.local/share/omarchy/config/* ~/.config/ +OMARCHY_DESCRIPTION="Config Files" -# Use default bashrc from Omarchy -cp ~/.local/share/omarchy/default/bashrc ~/.bashrc +omarchy_install() { + # Copy over Omarchy configs + mkdir -p ~/.config + cp -R ~/.local/share/omarchy/config/* ~/.config/ + + # Use default bashrc from Omarchy + cp ~/.local/share/omarchy/default/bashrc ~/.bashrc +} + +omarchy_verify() { + [[ -d ~/.config ]] || add_error "Config directory missing" + [[ -f ~/.bashrc ]] || add_error "Bashrc file missing" + + [[ -d ~/.config/hypr ]] || add_error "Hypr config missing" + [[ -d ~/.config/waybar ]] || add_error "Waybar config missing" +} diff --git a/install/config/detect-keyboard-layout.sh b/install/config/detect-keyboard-layout.sh index aaaee4f8..26805a3e 100644 --- a/install/config/detect-keyboard-layout.sh +++ b/install/config/detect-keyboard-layout.sh @@ -1,13 +1,29 @@ -# Copy over the keyboard layout that's been set in Arch during install to Hyprland -conf="/etc/vconsole.conf" -hyprconf="$HOME/.config/hypr/input.conf" +OMARCHY_DESCRIPTION="Keyboard Layout Config" -if grep -q '^XKBLAYOUT=' "$conf"; then - layout=$(grep '^XKBLAYOUT=' "$conf" | cut -d= -f2 | tr -d '"') - sed -i "/^[[:space:]]*kb_options *=/i\ kb_layout = $layout" "$hyprconf" -fi +omarchy_install() { + # Copy over the keyboard layout that's been set in Arch during install to Hyprland + conf="/etc/vconsole.conf" + hyprconf="$HOME/.config/hypr/input.conf" -if grep -q '^XKBVARIANT=' "$conf"; then - variant=$(grep '^XKBVARIANT=' "$conf" | cut -d= -f2 | tr -d '"') - sed -i "/^[[:space:]]*kb_options *=/i\ kb_variant = $variant" "$hyprconf" -fi + if grep -q '^XKBLAYOUT=' "$conf"; then + layout=$(grep '^XKBLAYOUT=' "$conf" | cut -d= -f2 | tr -d '"') + sed -i "/^[[:space:]]*kb_options *=/i\ kb_layout = $layout" "$hyprconf" + fi + + if grep -q '^XKBVARIANT=' "$conf"; then + variant=$(grep '^XKBVARIANT=' "$conf" | cut -d= -f2 | tr -d '"') + sed -i "/^[[:space:]]*kb_options *=/i\ kb_variant = $variant" "$hyprconf" + fi +} + +omarchy_verify() { + [[ -f "$HOME/.config/hypr/input.conf" ]] || add_error "Hyprland input config missing" + + # If vconsole.conf has keyboard layout, check if it's in hypr config + if [[ -f "/etc/vconsole.conf" ]] && grep -q '^XKBLAYOUT=' "/etc/vconsole.conf"; then + layout=$(grep '^XKBLAYOUT=' "/etc/vconsole.conf" | cut -d= -f2 | tr -d '"') + if [[ -f "$HOME/.config/hypr/input.conf" ]]; then + grep -q "kb_layout = $layout" "$HOME/.config/hypr/input.conf" || add_error "Keyboard layout not configured in Hyprland" + fi + fi +} diff --git a/install/config/docker.sh b/install/config/docker.sh index 99096245..12dcdbcc 100644 --- a/install/config/docker.sh +++ b/install/config/docker.sh @@ -1,32 +1,52 @@ -# Configure Docker daemon: -# - limit log size to avoid running out of disk -# - use host's DNS resolver -sudo mkdir -p /etc/docker -sudo tee /etc/docker/daemon.json >/dev/null <<'EOF' +OMARCHY_DESCRIPTION="Docker Configuration" + +omarchy_install() { + # Configure Docker daemon: + # - limit log size to avoid running out of disk + # - use host's DNS resolver + sudo mkdir -p /etc/docker + sudo tee /etc/docker/daemon.json >/dev/null <<'EOF' { - "log-driver": "json-file", - "log-opts": { "max-size": "10m", "max-file": "5" }, - "dns": ["172.17.0.1"], - "bip": "172.17.0.1/16" + "log-driver": "json-file", + "log-opts": { "max-size": "10m", "max-file": "5" }, + "dns": ["172.17.0.1"], + "bip": "172.17.0.1/16" } EOF -# Expose systemd-resolved to our Docker network -sudo mkdir -p /etc/systemd/resolved.conf.d -echo -e '[Resolve]\nDNSStubListenerExtra=172.17.0.1' | sudo tee /etc/systemd/resolved.conf.d/20-docker-dns.conf >/dev/null -sudo systemctl restart systemd-resolved + # Expose systemd-resolved to our Docker network + sudo mkdir -p /etc/systemd/resolved.conf.d + echo -e '[Resolve]\nDNSStubListenerExtra=172.17.0.1' | sudo tee /etc/systemd/resolved.conf.d/20-docker-dns.conf >/dev/null + sudo systemctl restart systemd-resolved -# Start Docker automatically -sudo systemctl enable docker + # Start Docker automatically + sudo systemctl enable docker -# Give this user privileged Docker access -sudo usermod -aG docker ${USER} + # Give this user privileged Docker access + sudo usermod -aG docker ${USER} -# Prevent Docker from preventing boot for network-online.target -sudo mkdir -p /etc/systemd/system/docker.service.d -sudo tee /etc/systemd/system/docker.service.d/no-block-boot.conf <<'EOF' + # Prevent Docker from preventing boot for network-online.target + sudo mkdir -p /etc/systemd/system/docker.service.d + sudo tee /etc/systemd/system/docker.service.d/no-block-boot.conf <<'EOF' [Unit] DefaultDependencies=no EOF -sudo systemctl daemon-reload + sudo systemctl daemon-reload +} + +omarchy_verify() { + [[ -f /etc/docker/daemon.json ]] || add_error "Docker daemon.json missing" + [[ -f /etc/systemd/resolved.conf.d/20-docker-dns.conf ]] || add_error "Docker DNS config missing" + [[ -f /etc/systemd/system/docker.service.d/no-block-boot.conf ]] || add_error "Docker boot config missing" + + getent group docker >/dev/null 2>&1 || add_error "Docker group does not exist" + + groups "$USER" | grep -q docker || add_error "User $USER not in docker group" + + if systemctl list-unit-files | grep -q docker.service; then + systemctl is-enabled docker >/dev/null 2>&1 || add_error "Docker service not enabled" + + systemctl is-active docker >/dev/null 2>&1 || add_warning "Docker service is not running (may be intentional)" + fi +} diff --git a/install/config/fix-powerprofilesctl-shebang.sh b/install/config/fix-powerprofilesctl-shebang.sh index 61cac432..19f81f66 100644 --- a/install/config/fix-powerprofilesctl-shebang.sh +++ b/install/config/fix-powerprofilesctl-shebang.sh @@ -1,2 +1,14 @@ -# Ensure we use system python3 and not mise's python3 -sudo sed -i '/env python3/ c\#!/bin/python3' /usr/bin/powerprofilesctl +OMARCHY_DESCRIPTION="Powerprofilesctl" + +omarchy_install() { + # Ensure we use system python3 and not mise's python3 + sudo sed -i '/env python3/ c\#!/bin/python3' /usr/bin/powerprofilesctl +} + +omarchy_verify() { + [[ -f /usr/bin/powerprofilesctl ]] || add_error "powerprofilesctl not found" + + if [[ -f /usr/bin/powerprofilesctl ]]; then + head -n1 /usr/bin/powerprofilesctl | grep -q "^#!/bin/python3$" || add_error "powerprofilesctl shebang not fixed" + fi +} diff --git a/install/config/git.sh b/install/config/git.sh index 39f77ed8..dc22162d 100644 --- a/install/config/git.sh +++ b/install/config/git.sh @@ -1,20 +1,41 @@ -# Ensure git settings live under ~/.config -mkdir -p ~/.config/git -touch ~/.config/git/config +OMARCHY_DESCRIPTION="Git" -# Set common git aliases -git config --global alias.co checkout -git config --global alias.br branch -git config --global alias.ci commit -git config --global alias.st status -git config --global pull.rebase true -git config --global init.defaultBranch master +omarchy_install() { + # Ensure git settings live under ~/.config + mkdir -p ~/.config/git + touch ~/.config/git/config -# Set identification from install inputs -if [[ -n "${OMARCHY_USER_NAME//[[:space:]]/}" ]]; then - git config --global user.name "$OMARCHY_USER_NAME" -fi + # Set common git aliases + git config --global alias.co checkout + git config --global alias.br branch + git config --global alias.ci commit + git config --global alias.st status + git config --global pull.rebase true + git config --global init.defaultBranch master -if [[ -n "${OMARCHY_USER_EMAIL//[[:space:]]/}" ]]; then - git config --global user.email "$OMARCHY_USER_EMAIL" -fi + # Set identification from install inputs + if [[ -n "${OMARCHY_USER_NAME//[[:space:]]/}" ]]; then + git config --global user.name "$OMARCHY_USER_NAME" + fi + + if [[ -n "${OMARCHY_USER_EMAIL//[[:space:]]/}" ]]; then + git config --global user.email "$OMARCHY_USER_EMAIL" + fi +} + +omarchy_verify() { + [[ -d ~/.config/git ]] || add_error "Git config directory missing" + [[ -f ~/.config/git/config ]] || add_error "Git config file missing" + + command -v git >/dev/null 2>&1 || add_error "Git not installed" + + if command -v git >/dev/null 2>&1; then + git config --global pull.rebase >/dev/null || add_error "Git pull.rebase not configured" + git config --global init.defaultBranch >/dev/null || add_error "Git defaultBranch not configured" + + git config --global alias.co >/dev/null || add_error "Git alias 'co' not configured" + git config --global alias.br >/dev/null || add_error "Git alias 'br' not configured" + git config --global alias.ci >/dev/null || add_error "Git alias 'ci' not configured" + git config --global alias.st >/dev/null || add_error "Git alias 'st' not configured" + fi +} diff --git a/install/config/gpg.sh b/install/config/gpg.sh index 7e209f65..a8c571d3 100644 --- a/install/config/gpg.sh +++ b/install/config/gpg.sh @@ -1,6 +1,22 @@ -# Setup GPG configuration with multiple keyservers for better reliability -sudo mkdir -p /etc/gnupg -sudo cp ~/.local/share/omarchy/default/gpg/dirmngr.conf /etc/gnupg/ -sudo chmod 644 /etc/gnupg/dirmngr.conf -sudo gpgconf --kill dirmngr || true -sudo gpgconf --launch dirmngr || true +OMARCHY_DESCRIPTION="GPG" + +omarchy_install() { + # Setup GPG configuration with multiple keyservers for better reliability + sudo mkdir -p /etc/gnupg + sudo cp ~/.local/share/omarchy/default/gpg/dirmngr.conf /etc/gnupg/ + sudo chmod 644 /etc/gnupg/dirmngr.conf + sudo gpgconf --kill dirmngr || true + sudo gpgconf --launch dirmngr || true +} + +omarchy_verify() { + [[ -d /etc/gnupg ]] || add_error "GPG config directory missing" + [[ -f /etc/gnupg/dirmngr.conf ]] || add_error "GPG dirmngr.conf missing" + + if [[ -f /etc/gnupg/dirmngr.conf ]]; then + local perms=$(stat -c %a /etc/gnupg/dirmngr.conf) + [[ "$perms" == "644" ]] || add_error "GPG dirmngr.conf has incorrect permissions: $perms (should be 644)" + fi + + pgrep -x dirmngr >/dev/null || add_error "GPG dirmngr is not running" +} diff --git a/install/config/hardware/bluetooth.sh b/install/config/hardware/bluetooth.sh index 65fc90d1..e9f62284 100644 --- a/install/config/hardware/bluetooth.sh +++ b/install/config/hardware/bluetooth.sh @@ -1,2 +1,9 @@ -# Turn on bluetooth by default -chrootable_systemctl_enable bluetooth.service +OMARCHY_DESCRIPTION="Enable Bluetooth Service" + +omarchy_install() { + chrootable_systemctl_enable bluetooth.service +} + +omarchy_verify() { + systemctl is-enabled bluetooth.service >/dev/null 2>&1 || add_error "Bluetooth service not enabled" +} diff --git a/install/config/hardware/fix-apple-bcm4360.sh b/install/config/hardware/fix-apple-bcm4360.sh index f7d6d324..b761981f 100644 --- a/install/config/hardware/fix-apple-bcm4360.sh +++ b/install/config/hardware/fix-apple-bcm4360.sh @@ -1,5 +1,18 @@ -# Install wifi drivers for 2013-2015 MacBooks using the BCM4360 chip -if lspci -nnv | grep -A2 "14e4:43a0" | grep -q "106b:"; then +OMARCHY_DESCRIPTION="Apple BCM4360 WiFi Driver" + +should_run() { + lspci -nnv | grep -A2 "14e4:43a0" | grep -q "106b:" +} + +omarchy_install() { + should_run || return 0 + echo "Apple BCM4360 detected" sudo pacman -S --noconfirm --needed broadcom-wl dkms linux-headers -fi +} + +omarchy_verify() { + should_run || return 2 + + omarchy-pkg-present broadcom-wl || add_error "Broadcom wireless driver not installed" +} diff --git a/install/config/hardware/fix-apple-spi-keyboard.sh b/install/config/hardware/fix-apple-spi-keyboard.sh index f549669f..87ad3575 100644 --- a/install/config/hardware/fix-apple-spi-keyboard.sh +++ b/install/config/hardware/fix-apple-spi-keyboard.sh @@ -1,7 +1,23 @@ -# Detect MacBook models that need SPI keyboard modules -if [[ "$(cat /sys/class/dmi/id/product_name 2>/dev/null)" =~ MacBook12,1|MacBookPro13,[123]|MacBookPro14,[123] ]]; then - echo "Detected MacBook with SPI keyboard" +OMARCHY_DESCRIPTION="MacBook SPI Keyboard Support" +should_run() { + [[ "$(cat /sys/class/dmi/id/product_name 2>/dev/null)" =~ MacBook12,1|MacBookPro13,[123]|MacBookPro14,[123] ]] +} + +omarchy_install() { + should_run || return 0 + + echo "Detected MacBook with SPI keyboard" sudo pacman -S --noconfirm --needed macbook12-spi-driver-dkms echo "MODULES=(applespi intel_lpss_pci spi_pxa2xx_platform)" | sudo tee /etc/mkinitcpio.conf.d/macbook_spi_modules.conf >/dev/null -fi +} + +omarchy_verify() { + should_run || return 2 # Return 2 to indicate "not applicable" + + # Check if driver is installed + pacman -Q macbook12-spi-driver-dkms &>/dev/null || add_error "MacBook SPI driver not installed" + + # Check if mkinitcpio config exists + [[ -f /etc/mkinitcpio.conf.d/macbook_spi_modules.conf ]] || add_error "MacBook SPI modules config missing" +} diff --git a/install/config/hardware/fix-apple-t2.sh b/install/config/hardware/fix-apple-t2.sh index 51273f21..43f70024 100644 --- a/install/config/hardware/fix-apple-t2.sh +++ b/install/config/hardware/fix-apple-t2.sh @@ -1,15 +1,23 @@ -# Detect T2 MacBook models using PCI IDs -# Vendor: 106b (Apple), Device IDs: 1801 or 1802 (T2 Security Chip) -if lspci -nn | grep -q "106b:180[12]"; then +OMARCHY_DESCRIPTION="Apple T2 MacBook Support" + +# Detect T2 MacBook models using PCI IDs: 106b:1801 or 106b:1802 +should_run() { + lspci -nn | grep -q "106b:180[12]" +} + +# Installation function +omarchy_install() { + should_run || return 0 + echo "Detected MacBook with T2 chip. Installing support items..." sudo pacman -S --noconfirm --needed \ - linux-t2 \ - linux-t2-headers \ - apple-t2-audio-config \ - apple-bcm-firmware \ - t2fanrd \ - tiny-dfr + linux-t2 \ + linux-t2-headers \ + apple-t2-audio-config \ + apple-bcm-firmware \ + t2fanrd \ + tiny-dfr echo "apple-bce" | sudo tee /etc/modules-load.d/t2.conf >/dev/null @@ -20,9 +28,22 @@ if lspci -nn | grep -q "106b:180[12]"; then options brcmfmac feature_disable=0x82000 EOF - sudo mkdir -p /etc/limine-entry-tool.d - cat </dev/null + sudo mkdir -p /etc/limine-entry-tool.d + cat </dev/null # Generated by Omarchy installer for T2 Mac support KERNEL_CMDLINE[default]+="intel_iommu=on iommu=pt pcie_ports=compat" EOF -fi +} + +# Verification function +omarchy_verify() { + should_run || return 2 + + pacman -Q linux-t2 &>/dev/null || add_error "T2 Linux kernel not installed" + + # Check if config files exist + [[ -f /etc/modules-load.d/t2.conf ]] || add_error "T2 modules config missing" + [[ -f /etc/mkinitcpio.conf.d/apple-t2.conf ]] || add_error "T2 mkinitcpio config missing" + [[ -f /etc/modprobe.d/brcmfmac.conf ]] || add_error "T2 WiFi fix config missing" + [[ -f /etc/limine-entry-tool.d/t2-mac.conf ]] || add_error "T2 boot config missing" +} diff --git a/install/config/hardware/fix-f13-amd-audio-input.sh b/install/config/hardware/fix-f13-amd-audio-input.sh index f443659f..ff7757a3 100644 --- a/install/config/hardware/fix-f13-amd-audio-input.sh +++ b/install/config/hardware/fix-f13-amd-audio-input.sh @@ -1,5 +1,18 @@ -AMD_AUDIO_CARD=$(pactl list cards 2>/dev/null | grep -B20 "Family 17h/19h" | grep "Name: " | awk '{print $2}' || true) +OMARCHY_DESCRIPTION="Framework 13 AMD Audio Input Fix" + +should_run() { + AMD_AUDIO_CARD=$(pactl list cards 2>/dev/null | grep -B20 "Family 17h/19h" | grep "Name: " | awk '{print $2}' || true) + [[ -n "$AMD_AUDIO_CARD" ]] +} + +omarchy_install() { + should_run || return 0 -if [[ -n $AMD_AUDIO_CARD ]]; then pactl set-card-profile "$AMD_AUDIO_CARD" "HiFi (Mic1, Mic2, Speaker)" 2>/dev/null || true -fi +} + +omarchy_verify() { + should_run || return 2 + + pactl list cards | grep -A10 "$AMD_AUDIO_CARD" | grep -q "Active Profile:" || add_error "AMD audio profile not configured" +} diff --git a/install/config/hardware/fix-fkeys.sh b/install/config/hardware/fix-fkeys.sh index d0b43154..922b290a 100644 --- a/install/config/hardware/fix-fkeys.sh +++ b/install/config/hardware/fix-fkeys.sh @@ -1,4 +1,16 @@ -# Ensure that F-keys on Apple-like keyboards (such as Lofree Flow84) are always F-keys -if [[ ! -f /etc/modprobe.d/hid_apple.conf ]]; then - echo "options hid_apple fnmode=2" | sudo tee /etc/modprobe.d/hid_apple.conf -fi +OMARCHY_DESCRIPTION="Set F-keys as F-keys by default" + +omarchy_install() { + # Ensure that F-keys on Apple-like keyboards (such as Lofree Flow84) are always F-keys + if [[ ! -f /etc/modprobe.d/hid_apple.conf ]]; then + echo "options hid_apple fnmode=2" | sudo tee /etc/modprobe.d/hid_apple.conf + fi +} + +omarchy_verify() { + [[ -f /etc/modprobe.d/hid_apple.conf ]] || add_error "Apple HID config missing" + + if [[ -f /etc/modprobe.d/hid_apple.conf ]]; then + grep -q "options hid_apple fnmode=2" /etc/modprobe.d/hid_apple.conf || add_error "F-key mode not configured" + fi +} diff --git a/install/config/hardware/ignore-power-button.sh b/install/config/hardware/ignore-power-button.sh index 8e514f69..c8075892 100644 --- a/install/config/hardware/ignore-power-button.sh +++ b/install/config/hardware/ignore-power-button.sh @@ -1,2 +1,15 @@ -# Disable shutting system down on power button to bind it to power menu afterwards -sudo sed -i 's/.*HandlePowerKey=.*/HandlePowerKey=ignore/' /etc/systemd/logind.conf +OMARCHY_DESCRIPTION="Disable power button" + +omarchy_install() { + # Disable shutting system down on power button to bind it to power menu afterwards + sudo sed -i 's/.*HandlePowerKey=.*/HandlePowerKey=ignore/' /etc/systemd/logind.conf +} + +omarchy_verify() { + [[ -f /etc/systemd/logind.conf ]] || add_error "Logind config missing" + + # Check if power button is set to ignore + if [[ -f /etc/systemd/logind.conf ]]; then + grep -q "^HandlePowerKey=ignore" /etc/systemd/logind.conf || add_error "Power button not set to ignore" + fi +} diff --git a/install/config/hardware/intel.sh b/install/config/hardware/intel.sh index 546fe477..ab193769 100644 --- a/install/config/hardware/intel.sh +++ b/install/config/hardware/intel.sh @@ -1,11 +1,30 @@ -# This installs hardware video acceleration for Intel GPUs -# Check if we have an Intel GPU at all -if INTEL_GPU=$(lspci | grep -iE 'vga|3d|display' | grep -i 'intel'); then +OMARCHY_DESCRIPTION="Setup Intel video acceleration" + +should_run() { + INTEL_GPU=$(lspci | grep -iE 'vga|3d|display' | grep -i 'intel' || true) + [[ -n "$INTEL_GPU" ]] +} + +omarchy_install() { + should_run || return 0 + # HD Graphics and newer uses intel-media-driver if [[ "${INTEL_GPU,,}" =~ "hd graphics"|"xe"|"iris" ]]; then - sudo pacman -S --needed --noconfirm intel-media-driver + sudo pacman -S --needed --noconfirm intel-media-driver elif [[ "${INTEL_GPU,,}" =~ "gma" ]]; then - # Older generations from 2008 to ~2014-2017 use libva-intel-driver - sudo pacman -S --needed --noconfirm libva-intel-driver + # Older generations from 2008 to ~2014-2017 use libva-intel-driver + sudo pacman -S --needed --noconfirm libva-intel-driver fi -fi +} + +# Verification function +omarchy_verify() { + should_run || return 2 + + # Check if appropriate driver is installed + if [[ "${INTEL_GPU,,}" =~ "hd graphics"|"xe"|"iris" ]]; then + pacman -Q intel-media-driver &>/dev/null || add_error "Intel media driver not installed" + elif [[ "${INTEL_GPU,,}" =~ "gma" ]]; then + pacman -Q libva-intel-driver &>/dev/null || add_error "Intel VA-API driver not installed" + fi +} diff --git a/install/config/hardware/network.sh b/install/config/hardware/network.sh index 65f9fdbb..9ca8199b 100644 --- a/install/config/hardware/network.sh +++ b/install/config/hardware/network.sh @@ -1,6 +1,14 @@ -# Ensure iwd service will be started -sudo systemctl enable iwd.service +OMARCHY_DESCRIPTION="Network Config" -# Prevent systemd-networkd-wait-online timeout on boot -sudo systemctl disable systemd-networkd-wait-online.service -sudo systemctl mask systemd-networkd-wait-online.service +omarchy_install() { + sudo systemctl enable iwd.service + + sudo systemctl disable systemd-networkd-wait-online.service + sudo systemctl mask systemd-networkd-wait-online.service +} + +omarchy_verify() { + systemctl is-enabled iwd.service >/dev/null 2>&1 || add_error "IWD service not enabled" + + systemctl is-enabled systemd-networkd-wait-online.service 2>&1 | grep -q "masked" || add_error "systemd-networkd-wait-online not masked" +} diff --git a/install/config/hardware/nvidia.sh b/install/config/hardware/nvidia.sh index 494390b7..f993ca70 100644 --- a/install/config/hardware/nvidia.sh +++ b/install/config/hardware/nvidia.sh @@ -1,31 +1,28 @@ -# ============================================================================== -# Hyprland NVIDIA Setup Script for Arch Linux -# ============================================================================== -# This script automates the installation and configuration of NVIDIA drivers -# for use with Hyprland on Arch Linux, following the official Hyprland wiki. -# -# Author: https://github.com/Kn0ax -# -# ============================================================================== +OMARCHY_DESCRIPTION="NVIDIA GPU Configuration" + +should_run() { + NVIDIA_GPU=$(lspci | grep -i 'nvidia' || true) + [[ -n "$NVIDIA_GPU" ]] +} + +omarchy_install() { + should_run || return 0 -# --- GPU Detection --- -if [ -n "$(lspci | grep -i 'nvidia')" ]; then - # --- Driver Selection --- # Turing (16xx, 20xx), Ampere (30xx), Ada (40xx), and newer recommend the open-source kernel modules - if echo "$(lspci | grep -i 'nvidia')" | grep -q -E "RTX [2-9][0-9]|GTX 16"; then - NVIDIA_DRIVER_PACKAGE="nvidia-open-dkms" + if echo "$NVIDIA_GPU" | grep -q -E "RTX [2-9][0-9]|GTX 16"; then + NVIDIA_DRIVER_PACKAGE="nvidia-open-dkms" else - NVIDIA_DRIVER_PACKAGE="nvidia-dkms" + NVIDIA_DRIVER_PACKAGE="nvidia-dkms" fi # Check which kernel is installed and set appropriate headers package KERNEL_HEADERS="linux-headers" # Default if pacman -Q linux-zen &>/dev/null; then - KERNEL_HEADERS="linux-zen-headers" + KERNEL_HEADERS="linux-zen-headers" elif pacman -Q linux-lts &>/dev/null; then - KERNEL_HEADERS="linux-lts-headers" + KERNEL_HEADERS="linux-lts-headers" elif pacman -Q linux-hardened &>/dev/null; then - KERNEL_HEADERS="linux-hardened-headers" + KERNEL_HEADERS="linux-hardened-headers" fi # force package database refresh @@ -67,9 +64,9 @@ if [ -n "$(lspci | grep -i 'nvidia')" ]; then sudo mkinitcpio -P # Add NVIDIA environment variables to hyprland.conf - HYPRLAND_CONF="$HOME/.config/hypr/hyprland.conf" + HYPRLAND_CONF="$HOME/.config/hypr/envs.conf" if [ -f "$HYPRLAND_CONF" ]; then - cat >>"$HYPRLAND_CONF" <<'EOF' + cat >>"$HYPRLAND_CONF" <<'EOF' # NVIDIA environment variables env = NVD_BACKEND,direct @@ -77,4 +74,22 @@ env = LIBVA_DRIVER_NAME,nvidia env = __GLX_VENDOR_LIBRARY_NAME,nvidia EOF fi -fi +} + +omarchy_verify() { + should_run || return 2 + + pacman -Q nvidia-dkms &>/dev/null || pacman -Q nvidia-open-dkms &>/dev/null || add_error "NVIDIA driver not installed" + + [[ -f /etc/modprobe.d/nvidia.conf ]] || add_error "NVIDIA modprobe config missing" + + if [[ -f /etc/modprobe.d/nvidia.conf ]]; then + grep -q "options nvidia_drm modeset=1" /etc/modprobe.d/nvidia.conf || add_error "NVIDIA DRM modeset not enabled" + fi + + grep -q "nvidia" /etc/mkinitcpio.conf || add_error "NVIDIA modules not in mkinitcpio.conf" + + if [[ -f "$HOME/.config/hypr/hyprland.conf" ]]; then + grep -q "LIBVA_DRIVER_NAME,nvidia" "$HOME/.config/hypr/hyprland.conf" || add_error "NVIDIA env vars not in Hyprland config" + fi +} diff --git a/install/config/hardware/printer.sh b/install/config/hardware/printer.sh index 781a9871..b9ad180f 100644 --- a/install/config/hardware/printer.sh +++ b/install/config/hardware/printer.sh @@ -1,16 +1,32 @@ -chrootable_systemctl_enable cups.service +OMARCHY_DESCRIPTION="Printer Config" -# Disable multicast dns in resolved. Avahi will provide this for better network printer discovery -sudo mkdir -p /etc/systemd/resolved.conf.d -echo -e "[Resolve]\nMulticastDNS=no" | sudo tee /etc/systemd/resolved.conf.d/10-disable-multicast.conf -chrootable_systemctl_enable avahi-daemon.service +omarchy_install() { + chrootable_systemctl_enable cups.service -# Enable mDNS resolution for .local domains -sudo sed -i 's/^hosts:.*/hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns/' /etc/nsswitch.conf + # Disable multicast dns in resolved. Avahi will provide this for better network printer discovery + sudo mkdir -p /etc/systemd/resolved.conf.d + echo -e "[Resolve]\nMulticastDNS=no" | sudo tee /etc/systemd/resolved.conf.d/10-disable-multicast.conf + chrootable_systemctl_enable avahi-daemon.service -# Enable automatically adding remote printers -if ! grep -q '^CreateRemotePrinters Yes' /etc/cups/cups-browsed.conf; then - echo 'CreateRemotePrinters Yes' | sudo tee -a /etc/cups/cups-browsed.conf -fi + # Enable mDNS resolution for .local domains + sudo sed -i 's/^hosts:.*/hosts: mymachines mdns_minimal [NOTFOUND=return] resolve [!UNAVAIL=return] files myhostname dns/' /etc/nsswitch.conf -chrootable_systemctl_enable cups-browsed.service + # Enable automatically adding remote printers + if ! grep -q '^CreateRemotePrinters Yes' /etc/cups/cups-browsed.conf; then + echo 'CreateRemotePrinters Yes' | sudo tee -a /etc/cups/cups-browsed.conf + fi + + chrootable_systemctl_enable cups-browsed.service +} + +omarchy_verify() { + systemctl is-enabled cups.service >/dev/null 2>&1 || add_error "CUPS service not enabled" + systemctl is-enabled avahi-daemon.service >/dev/null 2>&1 || add_error "Avahi daemon not enabled" + systemctl is-enabled cups-browsed.service >/dev/null 2>&1 || add_error "CUPS browsed service not enabled" + + [[ -f /etc/systemd/resolved.conf.d/10-disable-multicast.conf ]] || add_error "Multicast DNS config missing" + + grep -q "mdns_minimal" /etc/nsswitch.conf || add_error "mDNS not configured in nsswitch.conf" + + [[ -f /etc/cups/cups-browsed.conf ]] && grep -q '^CreateRemotePrinters Yes' /etc/cups/cups-browsed.conf || add_error "Remote printers not enabled in CUPS" +} diff --git a/install/config/hardware/set-wireless-regdom.sh b/install/config/hardware/set-wireless-regdom.sh index 8f28407f..98b42034 100644 --- a/install/config/hardware/set-wireless-regdom.sh +++ b/install/config/hardware/set-wireless-regdom.sh @@ -1,33 +1,37 @@ -# First check that wireless-regdb is there -if [ -f "/etc/conf.d/wireless-regdom" ]; then - unset WIRELESS_REGDOM - . /etc/conf.d/wireless-regdom -fi +OMARCHY_DESCRIPTION="Wireless Regdom" -# If the region is already set, we're done -if [ ! -n "${WIRELESS_REGDOM}" ]; then - # Get the current timezone - if [ -e "/etc/localtime" ]; then - TIMEZONE=$(readlink -f /etc/localtime) - TIMEZONE=${TIMEZONE#/usr/share/zoneinfo/} +omarchy_install() { + if [ -f "/etc/conf.d/wireless-regdom" ]; then + unset WIRELESS_REGDOM + . /etc/conf.d/wireless-regdom + fi - # Some timezones are formatted with the two letter country code at the start - COUNTRY="${TIMEZONE%%/*}" + if [ ! -n "${WIRELESS_REGDOM}" ]; then + if [ -e "/etc/localtime" ]; then + TIMEZONE=$(readlink -f /etc/localtime) + TIMEZONE=${TIMEZONE#/usr/share/zoneinfo/} - # If we don't have a two letter country, get it from the timezone table - if [[ ! "$COUNTRY" =~ ^[A-Z]{2}$ ]] && [ -f "/usr/share/zoneinfo/zone.tab" ]; then - COUNTRY=$(awk -v tz="$TIMEZONE" '$3 == tz {print $1; exit}' /usr/share/zoneinfo/zone.tab) - fi + COUNTRY="${TIMEZONE%%/*}" - # Check if we have a two letter country code - if [[ "$COUNTRY" =~ ^[A-Z]{2}$ ]]; then - # Append it to the wireless-regdom conf file that is used at boot - echo "WIRELESS_REGDOM=\"$COUNTRY\"" | sudo tee -a /etc/conf.d/wireless-regdom >/dev/null + if [[ ! "$COUNTRY" =~ ^[A-Z]{2}$ ]] && [ -f "/usr/share/zoneinfo/zone.tab" ]; then + COUNTRY=$(awk -v tz="$TIMEZONE" '$3 == tz {print $1; exit}' /usr/share/zoneinfo/zone.tab) + fi - # Also set it one off now - if command -v iw &>/dev/null; then - sudo iw reg set ${COUNTRY} + if [[ "$COUNTRY" =~ ^[A-Z]{2}$ ]]; then + echo "WIRELESS_REGDOM=\"$COUNTRY\"" | sudo tee -a /etc/conf.d/wireless-regdom >/dev/null + + if command -v iw &>/dev/null; then + sudo iw reg set ${COUNTRY} + fi fi fi fi -fi +} + +omarchy_verify() { + [[ -f /etc/conf.d/wireless-regdom ]] || add_error "Wireless regdom config missing" + + if [[ -f /etc/conf.d/wireless-regdom ]]; then + grep -q "^WIRELESS_REGDOM=" /etc/conf.d/wireless-regdom || add_error "Wireless regulatory domain not configured" + fi +} diff --git a/install/config/hardware/usb-autosuspend.sh b/install/config/hardware/usb-autosuspend.sh index 91323846..185f5f5d 100644 --- a/install/config/hardware/usb-autosuspend.sh +++ b/install/config/hardware/usb-autosuspend.sh @@ -1,5 +1,16 @@ -# Disable USB autosuspend to prevent peripheral disconnection issues -if [[ ! -f /etc/modprobe.d/disable-usb-autosuspend.conf ]]; then - echo "options usbcore autosuspend=-1" | sudo tee /etc/modprobe.d/disable-usb-autosuspend.conf -fi +OMARCHY_DESCRIPTION="USB Autosuspend" +omarchy_install() { + # Disable USB autosuspend to prevent peripheral disconnection issues + if [[ ! -f /etc/modprobe.d/disable-usb-autosuspend.conf ]]; then + echo "options usbcore autosuspend=-1" | sudo tee /etc/modprobe.d/disable-usb-autosuspend.conf + fi +} + +omarchy_verify() { + [[ -f /etc/modprobe.d/disable-usb-autosuspend.conf ]] || add_error "USB autosuspend config missing" + + if [[ -f /etc/modprobe.d/disable-usb-autosuspend.conf ]]; then + grep -q "options usbcore autosuspend=-1" /etc/modprobe.d/disable-usb-autosuspend.conf || add_error "USB autosuspend not disabled" + fi +} diff --git a/install/config/increase-lockout-limit.sh b/install/config/increase-lockout-limit.sh index 522deb72..11e7b8d6 100644 --- a/install/config/increase-lockout-limit.sh +++ b/install/config/increase-lockout-limit.sh @@ -1,3 +1,16 @@ -# Increase lockout limit to 10 and decrease timeout to 2 minutes -sudo sed -i 's|^\(auth\s\+required\s\+pam_faillock.so\)\s\+preauth.*$|\1 preauth silent deny=10 unlock_time=120|' "/etc/pam.d/system-auth" -sudo sed -i 's|^\(auth\s\+\[default=die\]\s\+pam_faillock.so\)\s\+authfail.*$|\1 authfail deny=10 unlock_time=120|' "/etc/pam.d/system-auth" +OMARCHY_DESCRIPTION="Lockout Limit" + +omarchy_install() { + # Increase lockout limit to 10 and decrease timeout to 2 minutes + sudo sed -i 's|^\(auth\s\+required\s\+pam_faillock.so\)\s\+preauth.*$|\1 preauth silent deny=10 unlock_time=120|' "/etc/pam.d/system-auth" + sudo sed -i 's|^\(auth\s\+\[default=die\]\s\+pam_faillock.so\)\s\+authfail.*$|\1 authfail deny=10 unlock_time=120|' "/etc/pam.d/system-auth" +} + +omarchy_verify() { + [[ -f /etc/pam.d/system-auth ]] || add_error "PAM system-auth file missing" + + if [[ -f /etc/pam.d/system-auth ]]; then + grep -q "pam_faillock.so.*deny=10" /etc/pam.d/system-auth || add_error "Faillock deny limit not set to 10" + grep -q "pam_faillock.so.*unlock_time=120" /etc/pam.d/system-auth || add_error "Faillock unlock time not set to 120" + fi +} diff --git a/install/config/increase-sudo-tries.sh b/install/config/increase-sudo-tries.sh index 5b64b869..0fd66609 100644 --- a/install/config/increase-sudo-tries.sh +++ b/install/config/increase-sudo-tries.sh @@ -1,3 +1,18 @@ -# Give the user 10 instead of 3 tries to fat finger their password before lockout -echo "Defaults passwd_tries=10" | sudo tee /etc/sudoers.d/passwd-tries -sudo chmod 440 /etc/sudoers.d/passwd-tries +OMARCHY_DESCRIPTION="Sudo lockout limit" + +omarchy_install() { + # Give the user 10 instead of 3 tries to fat finger their password before lockout + echo "Defaults passwd_tries=10" | sudo tee /etc/sudoers.d/passwd-tries + sudo chmod 440 /etc/sudoers.d/passwd-tries +} + +omarchy_verify() { + sudo test -f /etc/sudoers.d/passwd-tries || add_error "Sudoers passwd-tries file missing" + + if sudo test -f /etc/sudoers.d/passwd-tries; then + local perms=$(sudo stat -c %a /etc/sudoers.d/passwd-tries) + [[ "$perms" == "440" ]] || add_error "Sudoers file has incorrect permissions: $perms (should be 440)" + + sudo grep -q "passwd_tries=10" /etc/sudoers.d/passwd-tries || add_error "Passwd tries not set to 10" + fi +} diff --git a/install/config/lazyvim.sh b/install/config/lazyvim.sh index 325f6310..7219a2b4 100644 --- a/install/config/lazyvim.sh +++ b/install/config/lazyvim.sh @@ -1 +1,10 @@ -omarchy-lazyvim-setup +OMARCHY_DESCRIPTION="LazyVim" + +omarchy_install() { + omarchy-lazyvim-setup +} + +omarchy_verify() { + [[ -d ~/.config/nvim ]] || add_error "Neovim config directory missing" + [[ -d ~/.local/share/nvim/lazy ]] || add_error "LazyVim plugins directory missing" +} diff --git a/install/config/localdb.sh b/install/config/localdb.sh index 73721488..7cfd819d 100644 --- a/install/config/localdb.sh +++ b/install/config/localdb.sh @@ -1,2 +1,12 @@ -# Update localdb so that locate will find everything installed -sudo updatedb +OMARCHY_DESCRIPTION="LocalDB" + +omarchy_install() { + # Update localdb so that locate will find everything installed + sudo updatedb +} + +omarchy_verify() { + [[ -f /var/lib/mlocate/mlocate.db ]] || [[ -f /var/lib/plocate/plocate.db ]] || add_error "Locate database missing" + + command -v locate >/dev/null 2>&1 || add_error "Locate command not available" +} diff --git a/install/config/mimetypes.sh b/install/config/mimetypes.sh index 48bb8cfa..834845d1 100644 --- a/install/config/mimetypes.sh +++ b/install/config/mimetypes.sh @@ -1,35 +1,48 @@ -omarchy-refresh-applications -update-desktop-database ~/.local/share/applications +OMARCHY_DESCRIPTION="Mimetypes" -# Open all images with imv -xdg-mime default imv.desktop image/png -xdg-mime default imv.desktop image/jpeg -xdg-mime default imv.desktop image/gif -xdg-mime default imv.desktop image/webp -xdg-mime default imv.desktop image/bmp -xdg-mime default imv.desktop image/tiff +omarchy_install() { + omarchy-refresh-applications + update-desktop-database ~/.local/share/applications -# Open PDFs with the Document Viewer -xdg-mime default org.gnome.Evince.desktop application/pdf + # Open all images with imv + xdg-mime default imv.desktop image/png + xdg-mime default imv.desktop image/jpeg + xdg-mime default imv.desktop image/gif + xdg-mime default imv.desktop image/webp + xdg-mime default imv.desktop image/bmp + xdg-mime default imv.desktop image/tiff -# Use Chromium as the default browser -xdg-settings set default-web-browser chromium.desktop -xdg-mime default chromium.desktop x-scheme-handler/http -xdg-mime default chromium.desktop x-scheme-handler/https + # Open PDFs with the Document Viewer + xdg-mime default org.gnome.Evince.desktop application/pdf -# Open video files with mpv -xdg-mime default mpv.desktop video/mp4 -xdg-mime default mpv.desktop video/x-msvideo -xdg-mime default mpv.desktop video/x-matroska -xdg-mime default mpv.desktop video/x-flv -xdg-mime default mpv.desktop video/x-ms-wmv -xdg-mime default mpv.desktop video/mpeg -xdg-mime default mpv.desktop video/ogg -xdg-mime default mpv.desktop video/webm -xdg-mime default mpv.desktop video/quicktime -xdg-mime default mpv.desktop video/3gpp -xdg-mime default mpv.desktop video/3gpp2 -xdg-mime default mpv.desktop video/x-ms-asf -xdg-mime default mpv.desktop video/x-ogm+ogg -xdg-mime default mpv.desktop video/x-theora+ogg -xdg-mime default mpv.desktop application/ogg + # Use Chromium as the default browser + xdg-settings set default-web-browser chromium.desktop + xdg-mime default chromium.desktop x-scheme-handler/http + xdg-mime default chromium.desktop x-scheme-handler/https + + # Open video files with mpv + xdg-mime default mpv.desktop video/mp4 + xdg-mime default mpv.desktop video/x-msvideo + xdg-mime default mpv.desktop video/x-matroska + xdg-mime default mpv.desktop video/x-flv + xdg-mime default mpv.desktop video/x-ms-wmv + xdg-mime default mpv.desktop video/mpeg + xdg-mime default mpv.desktop video/ogg + xdg-mime default mpv.desktop video/webm + xdg-mime default mpv.desktop video/quicktime + xdg-mime default mpv.desktop video/3gpp + xdg-mime default mpv.desktop video/3gpp2 + xdg-mime default mpv.desktop video/x-ms-asf + xdg-mime default mpv.desktop video/x-ogm+ogg + xdg-mime default mpv.desktop video/x-theora+ogg + xdg-mime default mpv.desktop application/ogg +} + +omarchy_verify() { + [[ -d ~/.local/share/applications ]] || add_error "Applications directory missing" + + xdg-mime query default image/png | grep -q "imv.desktop" || add_error "Image viewer not set for PNG" + xdg-mime query default application/pdf | grep -q "Evince.desktop" || add_error "PDF viewer not set" + xdg-mime query default x-scheme-handler/http | grep -q "chromium.desktop" || add_warning "Browser not set to Chromium" + xdg-mime query default video/mp4 | grep -q "mpv.desktop" || add_error "Video player not set for MP4" +} diff --git a/install/config/mise-work.sh b/install/config/mise-work.sh index 15d71923..1c1a993c 100644 --- a/install/config/mise-work.sh +++ b/install/config/mise-work.sh @@ -1,9 +1,23 @@ -# Add ./bin to path for all items in ~/Work -mkdir -p "$HOME/Work" +OMARCHY_DESCRIPTION="Mise" -cat >"$HOME/Work/.mise.toml" <<'EOF' +omarchy_install() { + # Add ./bin to path for all items in ~/Work + mkdir -p "$HOME/Work" + + cat >"$HOME/Work/.mise.toml" <<'EOF' [env] _.path = "{{ cwd }}/bin" EOF -mise trust ~/Work/.mise.toml + mise trust ~/Work/.mise.toml +} + +omarchy_verify() { + [[ -d "$HOME/Work" ]] || add_error "Work directory missing" + + [[ -f "$HOME/Work/.mise.toml" ]] || add_error "Mise config missing in Work directory" + + if [[ -f "$HOME/Work/.mise.toml" ]]; then + grep -q '_.path' "$HOME/Work/.mise.toml" || add_error "Mise path configuration missing" + fi +} diff --git a/install/config/ssh-flakiness.sh b/install/config/ssh-flakiness.sh index 906e68aa..d3890f19 100644 --- a/install/config/ssh-flakiness.sh +++ b/install/config/ssh-flakiness.sh @@ -1,2 +1,14 @@ -# Solve common flakiness with SSH -echo "net.ipv4.tcp_mtu_probing=1" | sudo tee -a /etc/sysctl.d/99-sysctl.conf +OMARCHY_DESCRIPTION="SSH Flakiness Fix" + +omarchy_install() { + # Solve common flakiness with SSH + echo "net.ipv4.tcp_mtu_probing=1" | sudo tee -a /etc/sysctl.d/99-sysctl.conf +} + +omarchy_verify() { + [[ -f /etc/sysctl.d/99-sysctl.conf ]] || add_error "Sysctl config file missing" + + if [[ -f /etc/sysctl.d/99-sysctl.conf ]]; then + grep -q "net.ipv4.tcp_mtu_probing=1" /etc/sysctl.d/99-sysctl.conf || add_error "TCP MTU probing not configured" + fi +} diff --git a/install/config/sudoless-asdcontrol.sh b/install/config/sudoless-asdcontrol.sh index 120c6fc2..18933236 100644 --- a/install/config/sudoless-asdcontrol.sh +++ b/install/config/sudoless-asdcontrol.sh @@ -1,3 +1,18 @@ -# Setup sudo-less controls for controlling brightness on Apple Displays -echo "$USER ALL=(ALL) NOPASSWD: /usr/local/bin/asdcontrol" | sudo tee /etc/sudoers.d/asdcontrol -sudo chmod 440 /etc/sudoers.d/asdcontrol +OMARCHY_DESCRIPTION="ASDControl Sudoless Brightness Control" + +omarchy_install() { + # Setup sudo-less controls for controlling brightness on Apple Displays + echo "$USER ALL=(ALL) NOPASSWD: /usr/local/bin/asdcontrol" | sudo tee /etc/sudoers.d/asdcontrol + sudo chmod 440 /etc/sudoers.d/asdcontrol +} + +omarchy_verify() { + sudo test -f /etc/sudoers.d/asdcontrol || add_error "ASDControl sudoers file missing" + + if sudo test -f /etc/sudoers.d/asdcontrol; then + local perms=$(sudo stat -c %a /etc/sudoers.d/asdcontrol) + [[ "$perms" == "440" ]] || add_error "Sudoers file has incorrect permissions: $perms (should be 440)" + + sudo grep -q "NOPASSWD: /usr/local/bin/asdcontrol" /etc/sudoers.d/asdcontrol || add_error "ASDControl sudoers rule not configured" + fi +} diff --git a/install/config/theme.sh b/install/config/theme.sh index a0a6a694..48ada2af 100644 --- a/install/config/theme.sh +++ b/install/config/theme.sh @@ -1,31 +1,52 @@ -# Set links for Nautilius action icons -sudo ln -snf /usr/share/icons/Adwaita/symbolic/actions/go-previous-symbolic.svg /usr/share/icons/Yaru/scalable/actions/go-previous-symbolic.svg -sudo ln -snf /usr/share/icons/Adwaita/symbolic/actions/go-next-symbolic.svg /usr/share/icons/Yaru/scalable/actions/go-next-symbolic.svg +OMARCHY_DESCRIPTION="Theme" -# Setup theme links -mkdir -p ~/.config/omarchy/themes -for f in ~/.local/share/omarchy/themes/*; do ln -nfs "$f" ~/.config/omarchy/themes/; done +omarchy_install() { + # Set links for Nautilius action icons + sudo ln -snf /usr/share/icons/Adwaita/symbolic/actions/go-previous-symbolic.svg /usr/share/icons/Yaru/scalable/actions/go-previous-symbolic.svg + sudo ln -snf /usr/share/icons/Adwaita/symbolic/actions/go-next-symbolic.svg /usr/share/icons/Yaru/scalable/actions/go-next-symbolic.svg -# Set initial theme -mkdir -p ~/.config/omarchy/current -ln -snf ~/.config/omarchy/themes/tokyo-night ~/.config/omarchy/current/theme -ln -snf ~/.config/omarchy/current/theme/backgrounds/1-scenery-pink-lakeside-sunset-lake-landscape-scenic-panorama-7680x3215-144.png ~/.config/omarchy/current/background + # Setup theme links + mkdir -p ~/.config/omarchy/themes + for f in ~/.local/share/omarchy/themes/*; do ln -nfs "$f" ~/.config/omarchy/themes/; done -# Set specific app links for current theme -ln -snf ~/.config/omarchy/current/theme/neovim.lua ~/.config/nvim/lua/plugins/theme.lua + # Set initial theme + mkdir -p ~/.config/omarchy/current + ln -snf ~/.config/omarchy/themes/tokyo-night ~/.config/omarchy/current/theme + ln -snf ~/.config/omarchy/current/theme/backgrounds/1-scenery-pink-lakeside-sunset-lake-landscape-scenic-panorama-7680x3215-144.png ~/.config/omarchy/current/background -mkdir -p ~/.config/btop/themes -ln -snf ~/.config/omarchy/current/theme/btop.theme ~/.config/btop/themes/current.theme + # Set specific app links for current theme + ln -snf ~/.config/omarchy/current/theme/neovim.lua ~/.config/nvim/lua/plugins/theme.lua -mkdir -p ~/.config/mako -ln -snf ~/.config/omarchy/current/theme/mako.ini ~/.config/mako/config + mkdir -p ~/.config/btop/themes + ln -snf ~/.config/omarchy/current/theme/btop.theme ~/.config/btop/themes/current.theme -mkdir -p ~/.config/eza -ln -snf ~/.config/omarchy/current/theme/eza.yml ~/.config/eza/theme.yml + mkdir -p ~/.config/mako + ln -snf ~/.config/omarchy/current/theme/mako.ini ~/.config/mako/config -# Add managed policy directories for Chromium and Brave for theme changes -sudo mkdir -p /etc/chromium/policies/managed -sudo chmod a+rw /etc/chromium/policies/managed + mkdir -p ~/.config/eza + ln -snf ~/.config/omarchy/current/theme/eza.yml ~/.config/eza/theme.yml -sudo mkdir -p /etc/brave/policies/managed -sudo chmod a+rw /etc/brave/policies/managed + # Add managed policy directories for Chromium and Brave for theme changes + sudo mkdir -p /etc/chromium/policies/managed + sudo chmod a+rw /etc/chromium/policies/managed + + sudo mkdir -p /etc/brave/policies/managed + sudo chmod a+rw /etc/brave/policies/managed +} + +omarchy_verify() { + [[ -d ~/.config/omarchy/themes ]] || add_error "Theme directory missing: ~/.config/omarchy/themes" + [[ -L ~/.config/omarchy/current/theme ]] || add_error "Current theme symlink missing" + [[ -L ~/.config/omarchy/current/background ]] || add_error "Background symlink missing" + + [[ -L /usr/share/icons/Yaru/scalable/actions/go-previous-symbolic.svg ]] || add_error "Nautilus previous icon not linked" + [[ -L /usr/share/icons/Yaru/scalable/actions/go-next-symbolic.svg ]] || add_error "Nautilus next icon not linked" + + [[ -L ~/.config/nvim/lua/plugins/theme.lua ]] || add_error "Neovim theme link missing" + [[ -L ~/.config/btop/themes/current.theme ]] || add_error "btop theme link missing" + [[ -L ~/.config/mako/config ]] || add_error "mako config link missing" + [[ -L ~/.config/eza/theme.yml ]] || add_error "eza theme link missing" + + [[ -d /etc/chromium/policies/managed ]] || add_error "Chromium policy directory missing" + [[ -d /etc/brave/policies/managed ]] || add_error "Brave policy directory missing" +} diff --git a/install/config/timezones.sh b/install/config/timezones.sh index 24e96a0f..102abb33 100644 --- a/install/config/timezones.sh +++ b/install/config/timezones.sh @@ -1,5 +1,20 @@ -# Ensure timezone can be updated without needing to sudo -sudo tee /etc/sudoers.d/omarchy-tzupdate >/dev/null </dev/null </dev/null </dev/null < : "$OMARCHY_USER_NAME" : "$OMARCHY_USER_EMAIL" EOF +} + +omarchy_verify() { + [[ -f ~/.XCompose ]] || add_error "XCompose file missing" + + if [[ -f ~/.XCompose ]]; then + grep -q "include.*xcompose" ~/.XCompose || add_error "XCompose include directive missing" + fi +} diff --git a/install/helpers/logging.sh b/install/helpers/logging.sh index 4ebe2a9e..f79b8e02 100644 --- a/install/helpers/logging.sh +++ b/install/helpers/logging.sh @@ -118,8 +118,15 @@ run_logged() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting: $script" >>"$OMARCHY_INSTALL_LOG_FILE" - # Use bash -c to create a clean subshell - bash -c "source '$script'" >"$OMARCHY_INSTALL_LOG_FILE" 2>&1 + ( + # Source the script + source "$script" + + # Check if omarchy_install function exists and run it, otherwise the script already ran + if declare -f omarchy_install >/dev/null 2>&1; then + omarchy_install + fi + ) >"$OMARCHY_INSTALL_LOG_FILE" 2>&1 local exit_code=$? diff --git a/install/login/limine-snapper.sh b/install/login/limine-snapper.sh index 6a037207..06e99900 100644 --- a/install/login/limine-snapper.sh +++ b/install/login/limine-snapper.sh @@ -1,33 +1,38 @@ -if command -v limine &>/dev/null; then - sudo pacman -S --noconfirm --needed limine-snapper-sync limine-mkinitcpio-hook +#!/bin/bash - sudo tee /etc/mkinitcpio.conf.d/omarchy_hooks.conf </dev/null +# Description for doctor +OMARCHY_DESCRIPTION="Limine Bootloader & Snapper Configuration" + +# Installation function +omarchy_install() { + if command -v limine &>/dev/null; then + sudo tee /etc/mkinitcpio.conf.d/omarchy_hooks.conf </dev/null HOOKS=(base udev plymouth keyboard autodetect microcode modconf kms keymap consolefont block encrypt filesystems fsck btrfs-overlayfs) EOF - [[ -f /boot/EFI/limine/limine.conf ]] || [[ -f /boot/EFI/BOOT/limine.conf ]] && EFI=true + [[ -f /boot/EFI/limine/limine.conf ]] || [[ -f /boot/EFI/BOOT/limine.conf ]] && EFI=true - # Conf location is different between EFI and BIOS - if [[ -n "$EFI" ]]; then - # Check USB location first, then regular EFI location - if [[ -f /boot/EFI/BOOT/limine.conf ]]; then - limine_config="/boot/EFI/BOOT/limine.conf" - else - limine_config="/boot/EFI/limine/limine.conf" - fi - else - limine_config="/boot/limine/limine.conf" - fi + # Conf location is different between EFI and BIOS + if [[ -n "$EFI" ]]; then + # Check USB location first, then regular EFI location + if [[ -f /boot/EFI/BOOT/limine.conf ]]; then + limine_config="/boot/EFI/BOOT/limine.conf" + else + limine_config="/boot/EFI/limine/limine.conf" + fi + else + limine_config="/boot/limine/limine.conf" + fi - # Double-check and exit if we don't have a config file for some reason - if [[ ! -f $limine_config ]]; then - echo "Error: Limine config not found at $limine_config" >&2 - exit 1 - fi + # Double-check and exit if we don't have a config file for some reason + if [[ ! -f $limine_config ]]; then + echo "Error: Limine config not found at $limine_config" >&2 + exit 1 + fi - CMDLINE=$(grep "^[[:space:]]*cmdline:" "$limine_config" | head -1 | sed 's/^[[:space:]]*cmdline:[[:space:]]*//') + CMDLINE=$(grep "^[[:space:]]*cmdline:" "$limine_config" | head -1 | sed 's/^[[:space:]]*cmdline:[[:space:]]*//') - sudo tee /etc/default/limine </dev/null + sudo tee /etc/default/limine </dev/null TARGET_OS_NAME="Omarchy" ESP_PATH="/boot" @@ -50,13 +55,13 @@ MAX_SNAPSHOT_ENTRIES=5 SNAPSHOT_FORMAT_CHOICE=5 EOF - # UKI and EFI fallback are EFI only - if [[ -z $EFI ]]; then - sudo sed -i '/^ENABLE_UKI=/d; /^ENABLE_LIMINE_FALLBACK=/d' /etc/default/limine - fi + # UKI and EFI fallback are EFI only + if [[ -z $EFI ]]; then + sudo sed -i '/^ENABLE_UKI=/d; /^ENABLE_LIMINE_FALLBACK=/d' /etc/default/limine + fi - # We overwrite the whole thing knowing the limine-update will add the entries for us - sudo tee /boot/limine.conf </dev/null + # We overwrite the whole thing knowing the limine-update will add the entries for us + sudo tee /boot/limine.conf </dev/null ### Read more at config document: https://github.com/limine-bootloader/limine/blob/trunk/CONFIG.md #timeout: 3 default_entry: 2 @@ -75,62 +80,62 @@ term_palette_bright: 414868;f7768e;9ece6a;e0af68;7aa2f7;bb9af7;7dcfff;c0caf5 term_foreground: c0caf5 term_foreground_bright: c0caf5 term_background_bright: 24283b - + EOF + sudo pacman -S --noconfirm --needed limine-snapper-sync limine-mkinitcpio-hook - # Match Snapper configs if not installing from the ISO - if [[ -z ${OMARCHY_CHROOT_INSTALL:-} ]]; then - if ! sudo snapper list-configs 2>/dev/null | grep -q "root"; then - sudo snapper -c root create-config / + # Match Snapper configs if not installing from the ISO + if [[ -z ${OMARCHY_CHROOT_INSTALL:-} ]]; then + if ! sudo snapper list-configs 2>/dev/null | grep -q "root"; then + sudo snapper -c root create-config / + fi + + if ! sudo snapper list-configs 2>/dev/null | grep -q "home"; then + sudo snapper -c home create-config /home + fi + fi + + # Tweak default Snapper configs + sudo sed -i 's/^TIMELINE_CREATE="yes"/TIMELINE_CREATE="no"/' /etc/snapper/configs/{root,home} + sudo sed -i 's/^NUMBER_LIMIT="50"/NUMBER_LIMIT="5"/' /etc/snapper/configs/{root,home} + sudo sed -i 's/^NUMBER_LIMIT_IMPORTANT="10"/NUMBER_LIMIT_IMPORTANT="5"/' /etc/snapper/configs/{root,home} + + chrootable_systemctl_enable limine-snapper-sync.service fi - if ! sudo snapper list-configs 2>/dev/null | grep -q "home"; then - sudo snapper -c home create-config /home + # Add UKI entry to UEFI machines to skip bootloader showing on normal boot + if [[ -n $EFI ]] && efibootmgr &>/dev/null && ! efibootmgr | grep -q Omarchy && + ! cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "American Megatrends" && + ! cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "Apple"; then + sudo efibootmgr --create \ + --disk "$(findmnt -n -o SOURCE /boot | sed 's/p\?[0-9]*$//')" \ + --part "$(findmnt -n -o SOURCE /boot | grep -o 'p\?[0-9]*$' | sed 's/^p//')" \ + --label "Omarchy" \ + --loader "\\EFI\\Linux\\$(cat /etc/machine-id)_linux.efi" fi - fi +} - # Tweak default Snapper configs - sudo sed -i 's/^TIMELINE_CREATE="yes"/TIMELINE_CREATE="no"/' /etc/snapper/configs/{root,home} - sudo sed -i 's/^NUMBER_LIMIT="50"/NUMBER_LIMIT="5"/' /etc/snapper/configs/{root,home} - sudo sed -i 's/^NUMBER_LIMIT_IMPORTANT="10"/NUMBER_LIMIT_IMPORTANT="5"/' /etc/snapper/configs/{root,home} +# Verification function +omarchy_verify() { + # Only verify if limine is installed + if command -v limine &>/dev/null; then + # Check limine configuration files + [[ -f /etc/mkinitcpio.conf.d/omarchy_hooks.conf ]] || add_error "Omarchy mkinitcpio hooks config missing" + [[ -f /etc/default/limine ]] || add_error "Limine default config missing" + [[ -f /boot/limine.conf ]] || add_error "Limine boot config missing" - chrootable_systemctl_enable limine-snapper-sync.service -fi + # Check if limine packages are installed + pacman -Q limine-snapper-sync &>/dev/null || add_error "limine-snapper-sync not installed" + pacman -Q limine-mkinitcpio-hook &>/dev/null || add_error "limine-mkinitcpio-hook not installed" -echo "Re-enabling mkinitcpio hooks..." + # Check snapper configs if not in chroot + if [[ -z ${OMARCHY_CHROOT_INSTALL:-} ]]; then + sudo snapper list-configs 2>/dev/null | grep -q "root" || add_error "Snapper root config not created" + sudo snapper list-configs 2>/dev/null | grep -q "home" || add_error "Snapper home config not created" + fi -# Restore the specific mkinitcpio pacman hooks -if [ -f /usr/share/libalpm/hooks/90-mkinitcpio-install.hook.disabled ]; then - sudo mv /usr/share/libalpm/hooks/90-mkinitcpio-install.hook.disabled /usr/share/libalpm/hooks/90-mkinitcpio-install.hook -fi - -if [ -f /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook.disabled ]; then - sudo mv /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook.disabled /usr/share/libalpm/hooks/60-mkinitcpio-remove.hook -fi - -echo "mkinitcpio hooks re-enabled" - -sudo limine-update - -if [[ -n $EFI ]] && efibootmgr &>/dev/null; then - # Remove the archinstall-created Limine entry - while IFS= read -r bootnum; do - sudo efibootmgr -b "$bootnum" -B >/dev/null 2>&1 - done < <(efibootmgr | grep -E "^Boot[0-9]{4}\*? Arch Linux Limine" | sed 's/^Boot\([0-9]\{4\}\).*/\1/') -fi - -if [[ -n $EFI ]] && efibootmgr &>/dev/null && - ! cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "American Megatrends" && - ! cat /sys/class/dmi/id/bios_vendor 2>/dev/null | grep -qi "Apple"; then - - uki_file=$(find /boot/EFI/Linux/ -name "omarchy*.efi" -printf "%f\n" 2>/dev/null | head -1) - - if [[ -n "$uki_file" ]]; then - sudo efibootmgr --create \ - --disk "$(findmnt -n -o SOURCE /boot | sed 's/p\?[0-9]*$//')" \ - --part "$(findmnt -n -o SOURCE /boot | grep -o 'p\?[0-9]*$' | sed 's/^p//')" \ - --label "Omarchy" \ - --loader "\\EFI\\Linux\\$uki_file" - fi -fi + # Check if service is enabled + systemctl is-enabled limine-snapper-sync.service &>/dev/null || add_error "limine-snapper-sync service not enabled" + fi +} diff --git a/install/packaging/base.sh b/install/packaging/base.sh index 668e4a9b..1158b9b5 100644 --- a/install/packaging/base.sh +++ b/install/packaging/base.sh @@ -1,3 +1,18 @@ -# Install all base packages -mapfile -t packages < <(grep -v '^#' "$OMARCHY_INSTALL/omarchy-base.packages" | grep -v '^$') -sudo pacman -S --noconfirm --needed "${packages[@]}" +#!/bin/bash + +# Installation function +omarchy_install() { + # Install all base packages + mapfile -t packages < <(grep -v '^#' "$OMARCHY_INSTALL/omarchy-base.packages" | grep -v '^$') + sudo pacman -S --noconfirm --needed "${packages[@]}" +} + +# Verification function +omarchy_verify() { + # Check if package list exists + [[ -f "$OMARCHY_INSTALL/omarchy-base.packages" ]] || add_error "Base packages list missing" + + # Check if some key base packages are installed + command -v bash >/dev/null 2>&1 || add_error "Bash not installed" + command -v sudo >/dev/null 2>&1 || add_error "Sudo not installed" +} \ No newline at end of file diff --git a/install/packaging/fonts.sh b/install/packaging/fonts.sh index 8d5a35ec..3671d127 100644 --- a/install/packaging/fonts.sh +++ b/install/packaging/fonts.sh @@ -1,4 +1,18 @@ -# Omarchy logo in a font for Waybar use -mkdir -p ~/.local/share/fonts -cp ~/.local/share/omarchy/config/omarchy.ttf ~/.local/share/fonts/ -fc-cache +#!/bin/bash + +# Installation function +omarchy_install() { + # Omarchy logo in a font for Waybar use + mkdir -p ~/.local/share/fonts + cp ~/.local/share/omarchy/config/omarchy.ttf ~/.local/share/fonts/ + fc-cache +} + +# Verification function +omarchy_verify() { + # Check if fonts directory exists + [[ -d ~/.local/share/fonts ]] || add_error "Fonts directory missing" + + # Check if Omarchy font is installed + [[ -f ~/.local/share/fonts/omarchy.ttf ]] || add_error "Omarchy font missing" +} \ No newline at end of file diff --git a/install/packaging/icons.sh b/install/packaging/icons.sh index 3110afc9..64f8ecfc 100644 --- a/install/packaging/icons.sh +++ b/install/packaging/icons.sh @@ -1,4 +1,19 @@ -# Copy all bundled icons to the applications/icons directory -ICON_DIR="$HOME/.local/share/applications/icons" -mkdir -p "$ICON_DIR" -cp ~/.local/share/omarchy/applications/icons/*.png "$ICON_DIR/" +#!/bin/bash + +# Installation function +omarchy_install() { + # Copy all bundled icons to the applications/icons directory + ICON_DIR="$HOME/.local/share/applications/icons" + mkdir -p "$ICON_DIR" + cp ~/.local/share/omarchy/applications/icons/*.png "$ICON_DIR/" +} + +# Verification function +omarchy_verify() { + # Check if icons directory exists + [[ -d "$HOME/.local/share/applications/icons" ]] || add_error "Icons directory missing" + + # Check if any icons were copied + local icon_count=$(find "$HOME/.local/share/applications/icons" -name "*.png" 2>/dev/null | wc -l) + [[ $icon_count -gt 0 ]] || add_error "No icons found in icons directory" +} \ No newline at end of file diff --git a/install/packaging/lazyvim.sh b/install/packaging/lazyvim.sh index f8b8e37b..575bf9a2 100644 --- a/install/packaging/lazyvim.sh +++ b/install/packaging/lazyvim.sh @@ -1,3 +1,14 @@ -if [[ ! -d "$HOME/.config/nvim" ]]; then - omarchy-lazyvim-setup -fi +#!/bin/bash + +# Installation function +omarchy_install() { + if [[ ! -d "$HOME/.config/nvim" ]]; then + omarchy-lazyvim-setup + fi +} + +# Verification function +omarchy_verify() { + # Check if neovim config exists + [[ -d "$HOME/.config/nvim" ]] || add_error "Neovim config directory missing" +} \ No newline at end of file diff --git a/install/packaging/tuis.sh b/install/packaging/tuis.sh index 273a5d70..4fa86441 100644 --- a/install/packaging/tuis.sh +++ b/install/packaging/tuis.sh @@ -1,4 +1,16 @@ -ICON_DIR="$HOME/.local/share/applications/icons" +#!/bin/bash -omarchy-tui-install "Disk Usage" "bash -c 'dust -r; read -n 1 -s'" float "$ICON_DIR/Disk Usage.png" -omarchy-tui-install "Docker" "lazydocker" tile "$ICON_DIR/Docker.png" +# Installation function +omarchy_install() { + ICON_DIR="$HOME/.local/share/applications/icons" + + omarchy-tui-install "Disk Usage" "bash -c 'dust -r; read -n 1 -s'" float "$ICON_DIR/Disk Usage.png" + omarchy-tui-install "Docker" "lazydocker" tile "$ICON_DIR/Docker.png" +} + +# Verification function +omarchy_verify() { + # Check if TUI desktop files were created + [[ -f "$HOME/.local/share/applications/Disk Usage.desktop" ]] || add_error "Disk Usage TUI not installed" + [[ -f "$HOME/.local/share/applications/Docker.desktop" ]] || add_error "Docker TUI not installed" +} \ No newline at end of file diff --git a/install/packaging/webapps.sh b/install/packaging/webapps.sh index df20bd3e..722d6b92 100644 --- a/install/packaging/webapps.sh +++ b/install/packaging/webapps.sh @@ -1,13 +1,26 @@ -omarchy-webapp-install "HEY" https://app.hey.com HEY.png -omarchy-webapp-install "Basecamp" https://launchpad.37signals.com Basecamp.png -omarchy-webapp-install "WhatsApp" https://web.whatsapp.com/ WhatsApp.png -omarchy-webapp-install "Google Photos" https://photos.google.com/ "Google Photos.png" -omarchy-webapp-install "Google Contacts" https://contacts.google.com/ "Google Contacts.png" -omarchy-webapp-install "Google Messages" https://messages.google.com/web/conversations "Google Messages.png" -omarchy-webapp-install "ChatGPT" https://chatgpt.com/ ChatGPT.png -omarchy-webapp-install "YouTube" https://youtube.com/ YouTube.png -omarchy-webapp-install "GitHub" https://github.com/ GitHub.png -omarchy-webapp-install "X" https://x.com/ X.png -omarchy-webapp-install "Figma" https://figma.com/ Figma.png -omarchy-webapp-install "Discord" https://discord.com/channels/@me Discord.png -omarchy-webapp-install "Zoom" https://app.zoom.us/wc/home Zoom.png "omarchy-webapp-handler-zoom %u" "x-scheme-handler/zoommtg;x-scheme-handler/zoomus" +#!/bin/bash + +# Installation function +omarchy_install() { + omarchy-webapp-install "HEY" https://app.hey.com HEY.png + omarchy-webapp-install "Basecamp" https://launchpad.37signals.com Basecamp.png + omarchy-webapp-install "WhatsApp" https://web.whatsapp.com/ WhatsApp.png + omarchy-webapp-install "Google Photos" https://photos.google.com/ "Google Photos.png" + omarchy-webapp-install "Google Contacts" https://contacts.google.com/ "Google Contacts.png" + omarchy-webapp-install "Google Messages" https://messages.google.com/web/conversations "Google Messages.png" + omarchy-webapp-install "ChatGPT" https://chatgpt.com/ ChatGPT.png + omarchy-webapp-install "YouTube" https://youtube.com/ YouTube.png + omarchy-webapp-install "GitHub" https://github.com/ GitHub.png + omarchy-webapp-install "X" https://x.com/ X.png + omarchy-webapp-install "Figma" https://figma.com/ Figma.png + omarchy-webapp-install "Discord" https://discord.com/channels/@me Discord.png + omarchy-webapp-install "Zoom" https://app.zoom.us/wc/home Zoom.png "omarchy-webapp-handler-zoom %u" "x-scheme-handler/zoommtg;x-scheme-handler/zoomus" +} + +# Verification function +omarchy_verify() { + # Check if some key webapp desktop files were created + [[ -f "$HOME/.local/share/applications/HEY.desktop" ]] || add_error "HEY webapp not installed" + [[ -f "$HOME/.local/share/applications/WhatsApp.desktop" ]] || add_error "WhatsApp webapp not installed" + [[ -f "$HOME/.local/share/applications/ChatGPT.desktop" ]] || add_error "ChatGPT webapp not installed" +} \ No newline at end of file