bitzdots
gitlabLean Hyprland dotfiles with automatic matugen theming. Low-end optimized, full-stack auto-coloring, 26 Jinja2 templates. Rofi-powered menus, waybar modules, screenshot/recording, event-driven cache daemon.
clone
https://gitlab.com/bitzzdev/bitzdots.gitarchlinuxdotfileshyprlandhyprland-dotfileslow-endminimalricingwallustwaybarwayland
#!/bin/bash# Wait for NetworkManager to be ready and ensure WiFi auto-connects.# Fixes: on boot WiFi sometimes shows disconnected (strikethrough) and# impala/nmtui crash because NetworkManager isn't up yet.set -uNM_WAIT=30 # max seconds to wait for NetworkManagerCONN_WAIT=45 # max seconds to wait for an active connectionWAIT_STEP=1log() { echo "[wifi-fix] $*"; }# 1. Wait for NetworkManager D-Bus to come upwaited=0while ! nmcli -t -f STATE general 2>/dev/null | grep -q "connected\|connecting\|disconnected\|asleep\|unavailable"; dowaited=$((waited + WAIT_STEP))if [ "$waited" -ge "$NM_WAIT" ]; thenlog "NetworkManager did not come up after ${NM_WAIT}s"exit 1fisleep "$WAIT_STEP"donelog "NetworkManager is up"# 2. Make sure the radio is not soft-blockedif command -v rfkill &>/dev/null; thenrfkill unblock wifi 2>/dev/null || truefi# 3. Ensure WiFi radio is onnmcli radio wifi on 2>/dev/null || true# 4. Let NetworkManager autoconnect to saved profiles. If it already# connected during boot, skip; otherwise retry each saved connection.if nmcli -t -f DEVICE,STATE dev status 2>/dev/null | grep -q ":connected"; thenlog "Already connected"exit 0fifor _ in $(seq 1 "$CONN_WAIT"); doif nmcli -t -f DEVICE,STATE dev status 2>/dev/null | grep -q ":connected"; thenlog "Connected"exit 0fisleep "$WAIT_STEP"done# Still not connected — explicitly activate every saved connection oncelog "Not connected yet — reactivating saved connections"while IFS=: read -r name uuid; do[ -n "$name" ] || continuelog "Connecting to $name"nmcli connection up uuid "$uuid" 2>/dev/nulldone < <(nmcli -t -f NAME,UUID connection show 2>/dev/null)sleep 3if nmcli -t -f DEVICE,STATE dev status 2>/dev/null | grep -q ":connected"; thenlog "Connected after reactivation"exit 0fi# If still offline, retry a couple more times with a short delayfor attempt in 1 2 3; dosleep 5nmcli radio wifi off 2>/dev/nullsleep 2nmcli radio wifi on 2>/dev/nullfor _ in $(seq 1 10); doif nmcli -t -f DEVICE,STATE dev status 2>/dev/null | grep -q ":connected"; thenlog "Connected after retry"exit 0fisleep 1donedonelog "Could not connect to any network (attempt $attempt/3)"exit 1