style(ui): apply cyberpunk neon theme across all menus

- replace color palette with Cyberpunk 2077 neon variants in lib/common.sh
- add DIM, BLINK, REV attributes and show_title ui helper
- make show_separator terminal-width-aware via tput cols
- restyle menus with ◢ numbered items and ▸_ prompt indicator
- support two-digit input aliases (01-05, 00) alongside single-digit
- update status tokens: [✓]/[✗] → [OK]/[KO], PURPLE → MAGENTA
- apply consistent ui changes to lxs.sh and tools/index.sh
This commit is contained in:
2026-05-12 22:01:57 -04:00
parent e0bd8e0a97
commit ade8e76a68
4 changed files with 134 additions and 129 deletions
+38 -22
View File
@@ -7,31 +7,47 @@
# Repo: https://git.hyko.cx/hykocx/lxs
# ═══════════════════════════════════════════════════════════════════════════
# Colors
# Colors — Cyberpunk 2077 neon palette
# ═══════════════════════════════════════════════════════════════════════════
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
PURPLE='\033[1;94m'
CYAN='\033[0;36m'
WHITE='\033[1;37m'
GRAY='\033[0;37m'
RED='\033[1;91m' # ICE alert
GREEN='\033[1;92m' # phosphor green
YELLOW='\033[1;93m' # signature electric yellow
MAGENTA='\033[1;95m' # hot pink neon
CYAN='\033[1;96m' # neon cyan
WHITE='\033[1;97m' # bold white
GRAY='\033[0;90m' # dark gray
PURPLE='\033[1;95m' # alias on MAGENTA for legacy sub-scripts
NC='\033[0m'
BOLD='\033[1m'
DIM='\033[2m'
BLINK='\033[5m'
REV='\033[7m'
# ═══════════════════════════════════════════════════════════════════════════
# UI helpers
# ═══════════════════════════════════════════════════════════════════════════
show_separator() {
echo -e "${GRAY}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
local cols
cols=$(tput cols 2>/dev/null || echo 64)
printf "${YELLOW}"
printf '▀%.0s' $(seq 1 "$cols")
printf "${NC}\n"
}
info() { echo -e "${PURPLE}[*]${NC} $*"; }
ok() { echo -e "${GREEN}[✓]${NC} $*"; }
warn() { echo -e "${YELLOW}[!]${NC} $*"; }
err() { echo -e "${RED}[✗]${NC} $*" >&2; }
show_title() {
local title="$1"
local subtitle="${2:-SYS_MODULE}"
echo ""
echo -e "${YELLOW}${REV} ${title} ${NC} ${MAGENTA}// ${subtitle}${NC}"
show_separator
}
info() { echo -e "${MAGENTA}[··]${NC} $*"; }
ok() { echo -e "${GREEN}[OK]${NC} $*"; }
warn() { echo -e "${YELLOW}[!!]${NC} $*"; }
err() { echo -e "${RED}[KO]${NC} $*" >&2; }
# ═══════════════════════════════════════════════════════════════════════════
# Spinner — runs a shell command, redirects output to a log file, shows
@@ -51,13 +67,13 @@ run_spinner() {
local spinstr='|/-\'
local log="${LXS_LOG_FILE:-/tmp/lxs.log}"
echo -e "${PURPLE}[*] ${message}${NC}"
echo -e "${MAGENTA}[··] ${message}${NC}"
eval "$command" > "$log" 2>&1 &
local pid=$!
while kill -0 "$pid" 2>/dev/null; do
local temp=${spinstr#?}
printf "\r${PURPLE}[%c]${NC} ${message}" "$spinstr"
printf "\r${MAGENTA}[%c·]${NC} ${message}" "$spinstr"
spinstr=$temp${spinstr%"$temp"}
sleep 0.15
done
@@ -65,9 +81,9 @@ run_spinner() {
wait "$pid"
local exit_code=$?
if [ $exit_code -eq 0 ]; then
printf "\r${GREEN}[]${NC} ${message}\n"
printf "\r${GREEN}[OK]${NC} ${message}\n"
else
printf "\r${RED}[]${NC} ${message}\n"
printf "\r${RED}[KO]${NC} ${message}\n"
fi
return $exit_code
}
@@ -138,7 +154,7 @@ ufw_allow() {
else
ufw allow "$rule" >/dev/null
fi
ok "UFW: allowed ${rule}${comment:+ (${comment})}"
ok "UFW :: allowed ${rule}${comment:+ (${comment})}"
}
# Wait for other apt/dpkg processes to release their locks. Up to 120s.
@@ -154,17 +170,17 @@ wait_for_apt() {
fuser /var/lib/apt/lists/lock >/dev/null 2>&1; do
[ "$lock_detected" = false ] && lock_detected=true && \
echo -e "${YELLOW}[!] Waiting for other package manager to finish...${NC}"
echo -e "${YELLOW}[!!] Waiting for other package manager to finish...${NC}"
wait_count=$((wait_count + 1))
[ $wait_count -ge $max_wait ] && \
echo -e "${RED}[] Timeout waiting for package manager${NC}" && return 1
echo -e "${RED}[KO] Timeout waiting for package manager${NC}" && return 1
printf "\r${GRAY}[i] Waiting... (%ds/%ds)${NC}" $wait_count $max_wait
printf "\r${GRAY}[··] Waiting... (%ds/%ds)${NC}" $wait_count $max_wait
sleep 1
done
[ "$lock_detected" = true ] && \
echo -e "\n${GREEN}[] Package manager is now available${NC}"
echo -e "\n${GREEN}[OK] Package manager is now available${NC}"
return 0
}