Skip to content

Commit 66f1d52

Browse files
committed
feat: add full verification and failure tracking to installer
1 parent e8f5075 commit 66f1d52

7 files changed

Lines changed: 1089 additions & 188 deletions

File tree

configs/i3/lock.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
set -u
88

99
# Source global defaults
10+
if [ ! -f "${HOME}/.config/environment.d/defaults.conf" ]; then
11+
echo "Error: defaults.conf not found" >&2
12+
exit 1
13+
fi
1014
. "${HOME}/.config/environment.d/defaults.conf"
1115

1216
# Use WALLPAPER from environment.d (expand ~ to $HOME)
@@ -248,9 +252,9 @@ start_sleep_timer
248252
# Lock screen (blocks until unlocked)
249253
# Use generated image if available, otherwise plain lock
250254
if [ -f "$LOCKSCREEN" ]; then
251-
$LOCKER -n -i "$LOCKSCREEN"
255+
"$LOCKER" -n -i "$LOCKSCREEN"
252256
else
253-
$LOCKER -n -c 000000 # Plain black background
257+
"$LOCKER" -n -c 000000 # Plain black background
254258
fi
255259

256260
# Unlocked - cancel sleep timer

configs/polybar/launch.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
set -u
55

66
# Source global defaults
7+
if [ ! -f "${HOME}/.config/environment.d/defaults.conf" ]; then
8+
echo "Error: defaults.conf not found" >&2
9+
exit 1
10+
fi
711
. "${HOME}/.config/environment.d/defaults.conf"
812

913
# Configuration
@@ -21,7 +25,7 @@ if [ -z "${DISPLAY:-}" ]; then
2125
exit 1
2226
fi
2327

24-
if ! command -v $BAR &>/dev/null; then
28+
if ! command -v "$BAR" &>/dev/null; then
2529
echo "Error: $BAR is not installed" >&2
2630
exit 1
2731
fi
@@ -57,22 +61,22 @@ fi
5761

5862
# Terminate already running bar instances
5963
if command -v killall &>/dev/null; then
60-
killall -q $BAR 2>/dev/null || true
64+
killall -q "$BAR" 2>/dev/null || true
6165
elif command -v pkill &>/dev/null; then
62-
pkill -x $BAR 2>/dev/null || true
66+
pkill -x "$BAR" 2>/dev/null || true
6367
fi
6468

6569
# Wait until the processes have been shut down (with timeout)
6670
shutdown_start=$(date +%s)
67-
while pgrep -u "$_CACHED_UID" -x $BAR >/dev/null 2>&1; do
71+
while pgrep -u "$_CACHED_UID" -x "$BAR" >/dev/null 2>&1; do
6872
current_time=$(date +%s)
6973
elapsed=$((current_time - shutdown_start))
7074

7175
if [ $elapsed -ge $SHUTDOWN_TIMEOUT ]; then
7276
echo "Warning: Status bar didn't shut down gracefully, forcing kill" | tee -a "$LOG_FILE"
7377
# Force kill remaining $BAR processes
7478
if command -v pkill &>/dev/null; then
75-
pkill -9 -u "$_CACHED_UID" -x $BAR 2>/dev/null || true
79+
pkill -9 -u "$_CACHED_UID" -x "$BAR" 2>/dev/null || true
7680
fi
7781
sleep 0.5
7882
break
@@ -87,7 +91,7 @@ echo "---" >> "$LOG_FILE"
8791
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Launching $BAR..." >> "$LOG_FILE"
8892

8993
# Launch $BAR with logging (proper background handling)
90-
$BAR main >> "$LOG_FILE" 2>&1 &
94+
"$BAR" main >> "$LOG_FILE" 2>&1 &
9195
BAR_pid=$!
9296

9397
# Brief wait to check if $BAR started successfully

configs/xprofile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Load Xresources
2-
[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources
2+
[ -f "$HOME/.Xresources" ] && xrdb -merge "$HOME/.Xresources"
33

44
# Qt5/Qt6 theming - use qt5ct for configuration
55
export QT_QPA_PLATFORMTHEME=qt5ct
@@ -20,16 +20,16 @@ fi
2020

2121
# Auto-detect network interfaces for polybar (handles USB adapters changing ports)
2222
# Each module auto-hides when disconnected, so both can be configured
23-
if [ -f ~/.config/polybar/config.ini ] && [ -w ~/.config/polybar/config.ini ]; then
23+
if [ -f "$HOME/.config/polybar/config.ini" ] && [ -w "$HOME/.config/polybar/config.ini" ]; then
2424
# Detect WiFi interface (prefer active/UP one)
2525
WIFI_IFACE=$(ip link show 2>/dev/null | grep -E "^[0-9]+: wl" | head -1 | awk -F: '{print $2}' | tr -d ' ')
26-
if [ -n "$WIFI_IFACE" ] && [[ "$WIFI_IFACE" =~ ^[a-zA-Z0-9_-]+$ ]]; then
27-
sed -i "/^\[module\/network-wifi\]/,/^\[module\// s/^interface = .*/interface = $WIFI_IFACE/" ~/.config/polybar/config.ini 2>/dev/null || true
26+
if [ -n "$WIFI_IFACE" ] && echo "$WIFI_IFACE" | grep -qE '^[a-zA-Z0-9_-]+$'; then
27+
sed -i "/^\[module\/network-wifi\]/,/^\[module\// s/^interface = .*/interface = $WIFI_IFACE/" "$HOME/.config/polybar/config.ini" 2>/dev/null || true
2828
fi
2929

3030
# Detect Ethernet interface
3131
ETH_IFACE=$(ip link show 2>/dev/null | grep -E "^[0-9]+: (enp|eth)" | head -1 | awk -F: '{print $2}' | tr -d ' ')
32-
if [ -n "$ETH_IFACE" ] && [[ "$ETH_IFACE" =~ ^[a-zA-Z0-9_-]+$ ]]; then
33-
sed -i "/^\[module\/network-eth\]/,/^\[module\// s/^interface = .*/interface = $ETH_IFACE/" ~/.config/polybar/config.ini 2>/dev/null || true
32+
if [ -n "$ETH_IFACE" ] && echo "$ETH_IFACE" | grep -qE '^[a-zA-Z0-9_-]+$'; then
33+
sed -i "/^\[module\/network-eth\]/,/^\[module\// s/^interface = .*/interface = $ETH_IFACE/" "$HOME/.config/polybar/config.ini" 2>/dev/null || true
3434
fi
3535
fi

0 commit comments

Comments
 (0)