Add omarchy-doctor checks

This commit is contained in:
Ryan Hughes
2025-09-28 00:45:37 -04:00
parent 57a977a51d
commit 9dcc6f0aec
14 changed files with 321 additions and 165 deletions

View File

@@ -1,18 +1,27 @@
#!/bin/bash
OMARCHY_DESCRIPTION="Base Packages"
# 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[@]}"
# 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"
[[ -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"
}
# Check if all base packages are installed
if [[ -f "$OMARCHY_INSTALL/omarchy-base.packages" ]]; then
mapfile -t packages < <(grep -v '^#' "$OMARCHY_INSTALL/omarchy-base.packages" | grep -v '^$')
local missing_packages=()
for package in "${packages[@]}"; do
if ! pacman -Q "$package" &>/dev/null; then
missing_packages+=("$package")
fi
done
if [[ ${#missing_packages[@]} -gt 0 ]]; then
add_error "Missing base packages: ${missing_packages[*]}"
fi
fi
}

View File

@@ -1,18 +1,13 @@
#!/bin/bash
OMARCHY_DESCRIPTION="Omarchy Font"
# 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
# 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"
}
[[ -d ~/.local/share/fonts ]] || add_error "Fonts directory missing"
[[ -f ~/.local/share/fonts/omarchy.ttf ]] || add_error "Omarchy font missing"
}

View File

@@ -1,6 +1,5 @@
#!/bin/bash
OMARCHY_DESCRIPTION="Icons"
# Installation function
omarchy_install() {
# Copy all bundled icons to the applications/icons directory
ICON_DIR="$HOME/.local/share/applications/icons"
@@ -8,12 +7,9 @@ omarchy_install() {
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"
}
}

View File

@@ -1,14 +1,11 @@
#!/bin/bash
OMARCHY_DESCRIPTION="LazyVim"
# Installation function
omarchy_install() {
if [[ ! -d "$HOME/.config/nvim" ]]; then
omarchy-lazyvim-setup
fi
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"
}
[[ -d "$HOME/.config/nvim" ]] || add_error "Neovim config directory missing"
}

View File

@@ -1,16 +1,13 @@
#!/bin/bash
OMARCHY_DESCRIPTION="TUIs"
# Installation function
omarchy_install() {
ICON_DIR="$HOME/.local/share/applications/icons"
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"
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"
}
[[ -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"
}

View File

@@ -1,26 +1,34 @@
#!/bin/bash
OMARCHY_DESCRIPTION="Webapps"
# 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"
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"
}
# Check all webapps - use warnings since these are optional
[[ -f "$HOME/.local/share/applications/HEY.desktop" ]] || add_warning "HEY webapp not installed"
[[ -f "$HOME/.local/share/applications/Basecamp.desktop" ]] || add_warning "Basecamp webapp not installed"
[[ -f "$HOME/.local/share/applications/WhatsApp.desktop" ]] || add_warning "WhatsApp webapp not installed"
[[ -f "$HOME/.local/share/applications/Google Photos.desktop" ]] || add_warning "Google Photos webapp not installed"
[[ -f "$HOME/.local/share/applications/Google Contacts.desktop" ]] || add_warning "Google Contacts webapp not installed"
[[ -f "$HOME/.local/share/applications/Google Messages.desktop" ]] || add_warning "Google Messages webapp not installed"
[[ -f "$HOME/.local/share/applications/ChatGPT.desktop" ]] || add_warning "ChatGPT webapp not installed"
[[ -f "$HOME/.local/share/applications/YouTube.desktop" ]] || add_warning "YouTube webapp not installed"
[[ -f "$HOME/.local/share/applications/GitHub.desktop" ]] || add_warning "GitHub webapp not installed"
[[ -f "$HOME/.local/share/applications/X.desktop" ]] || add_warning "X webapp not installed"
[[ -f "$HOME/.local/share/applications/Figma.desktop" ]] || add_warning "Figma webapp not installed"
[[ -f "$HOME/.local/share/applications/Discord.desktop" ]] || add_warning "Discord webapp not installed"
[[ -f "$HOME/.local/share/applications/Zoom.desktop" ]] || add_warning "Zoom webapp not installed"
}