Initial commit: Omeron modular Hyprland setup framework
- Modular installer with gum-based TUI - Fresh-install detection with auto GPU driver selection - Preflight module for system detection (Intel/AMD/NVIDIA) - Core modules: packages, dotfiles, services, SDDM - Optional software installer (Obsidian, Neovim, VS Code, etc.) - Homelab config module with dynamic AGS integration - Two complete themes: Forest Neon and Rose Night - 19 Hyprland control scripts + 4 AGS widgets - Idempotent dotfile deployment with automatic backup - YAML-based configuration, extensible module system - Full logging to ~/.local/share/omeron/
This commit is contained in:
46
lib/log.sh
Executable file
46
lib/log.sh
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
OMERON_LOG_FILE="${OMERON_LOG_FILE:-$HOME/.local/share/omeron/install.log}"
|
||||
OMERON_LOG_LEVEL="${OMERON_LOG_LEVEL:-INFO}"
|
||||
|
||||
__log_init() {
|
||||
mkdir -p "$(dirname "$OMERON_LOG_FILE")"
|
||||
}
|
||||
|
||||
__log_timestamp() {
|
||||
date '+%Y-%m-%d %H:%M:%S'
|
||||
}
|
||||
|
||||
__log_write() {
|
||||
local level="$1"
|
||||
local message="$2"
|
||||
local timestamp
|
||||
timestamp="$(__log_timestamp)"
|
||||
|
||||
__log_init
|
||||
printf '[%s] [%s] %s\n' "$timestamp" "$level" "$message" | tee -a "$OMERON_LOG_FILE"
|
||||
}
|
||||
|
||||
log_info() { __log_write "INFO" "$1"; }
|
||||
log_warn() { __log_write "WARN" "$1" >&2; }
|
||||
log_error() { __log_write "ERROR" "$1" >&2; }
|
||||
log_success() { __log_write "SUCCESS" "$1"; }
|
||||
log_debug() {
|
||||
[[ "$OMERON_LOG_LEVEL" == "DEBUG" ]] && __log_write "DEBUG" "$1"
|
||||
}
|
||||
|
||||
log_step() {
|
||||
local num="$1"
|
||||
local total="$2"
|
||||
local message="$3"
|
||||
printf '\n━━━ [%d/%d] %s ━━━\n' "$num" "$total" "$message"
|
||||
__log_write "STEP" "[$num/$total] $message"
|
||||
}
|
||||
|
||||
log_section() {
|
||||
local message="$1"
|
||||
local line
|
||||
line="$(printf '━%.0s' $(seq 1 "${#message}"))"
|
||||
printf '\n%s\n%s\n%s\n' "$line" "$message" "$line"
|
||||
__log_write "SECTION" "$message"
|
||||
}
|
||||
Reference in New Issue
Block a user