1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-09 21:24:16 +00:00

Performance and speed optimization

This commit is contained in:
Tw93
2025-12-08 15:34:51 +08:00
parent ea8488c1bb
commit 78e6743666
13 changed files with 366 additions and 552 deletions

View File

@@ -4,6 +4,27 @@
set -euo pipefail
# ============================================================================
# Helper Functions
# ============================================================================
list_login_items() {
if ! command -v osascript > /dev/null 2>&1; then
return
fi
local raw_items
raw_items=$(osascript -e 'tell application "System Events" to get the name of every login item' 2> /dev/null || echo "")
[[ -z "$raw_items" || "$raw_items" == "missing value" ]] && return
IFS=',' read -ra login_items_array <<< "$raw_items"
for entry in "${login_items_array[@]}"; do
local trimmed
trimmed=$(echo "$entry" | sed 's/^[[:space:]]*//; s/[[:space:]]*$//')
[[ -n "$trimmed" ]] && printf "%s\n" "$trimmed"
done
}
# ============================================================================
# Configuration Checks
# ============================================================================