@@ -56,8 +56,6 @@ LOCK_FILE="/tmp/draphyOS-install-$UID.lock"
5656LOG_FILE=" /tmp/draphyOS-install.log"
5757
5858# Hardware detection results (populated by configure_hardware, written by create_marker)
59- DETECTED_WIFI_IFACE=" "
60- DETECTED_ETH_IFACE=" "
6159IS_VM_MODE=" false"
6260
6361# Failed items tracking (displayed at end of installation)
578576 rm -f /tmp/ueberzugpp.repo
579577 print_step " ueberzugpp repo added"
580578 else
579+ rm -f /tmp/ueberzugpp.repo
581580 print_warning " Failed to add ueberzugpp repo"
582581 FAILED_ITEMS+=(" ueberzugpp-repo" )
583582 fi
590589 rm -f /tmp/ueberzugpp.repo
591590 print_step " ueberzugpp repo added (Fedora 41 fallback)"
592591 else
592+ rm -f /tmp/ueberzugpp.repo
593593 print_warning " Failed to add ueberzugpp repo (fallback)"
594594 FAILED_ITEMS+=(" ueberzugpp-repo" )
595595 fi
@@ -1493,82 +1493,9 @@ configure_hardware() {
14931493 fi
14941494 fi
14951495
1496- # Detect network interfaces (both WiFi and Ethernet)
1497- # Polybar has separate modules for each - they auto-hide when disconnected
1498- local WIFI_IFACE=" "
1499- local ETH_IFACE=" "
1500-
1501- # Detect WiFi interface (prefer active one from default route)
1502- local DEFAULT_IFACE
1503- DEFAULT_IFACE=$( ip route show default 2> /dev/null | awk ' /default/ {print $5}' | head -1)
1504-
1505- if [[ " $DEFAULT_IFACE " == wl* ]]; then
1506- WIFI_IFACE=" $DEFAULT_IFACE "
1507- else
1508- # Fallback: find any WiFi interface
1509- WIFI_IFACE=$( ip link show 2> /dev/null | grep -E " ^[0-9]+: wl" | head -1 | awk -F: ' {print $2}' | tr -d ' ' )
1510- fi
1511-
1512- # Detect Ethernet interface
1513- if [[ " $DEFAULT_IFACE " != wl* ]] && [ -n " $DEFAULT_IFACE " ]; then
1514- ETH_IFACE=" $DEFAULT_IFACE "
1515- else
1516- # Fallback: find any Ethernet interface
1517- ETH_IFACE=$( ip link show 2> /dev/null | grep -E " ^[0-9]+: (enp|eth)" | head -1 | awk -F: ' {print $2}' | tr -d ' ' )
1518- fi
1519-
1520- # Configure WiFi module
1521- if [ -n " $WIFI_IFACE " ]; then
1522- print_step " WiFi interface detected: $WIFI_IFACE "
1523- # Update interface in network-wifi module section only (escape special chars for sed)
1524- local wifi_escaped
1525- wifi_escaped=$( printf ' %s\n' " $WIFI_IFACE " | sed ' s/[&/\]/\\&/g' )
1526- if sed -i " /^\[module\/network-wifi\]/,/^\[module\// s/^interface = .*/interface = ${wifi_escaped} /" " $polybar_config " 2> /dev/null; then
1527- # Verify WiFi interface was set
1528- if ! grep -q " interface = $WIFI_IFACE " " $polybar_config " 2> /dev/null; then
1529- print_warning " WiFi interface config may not have been written correctly"
1530- FAILED_ITEMS+=(" hardware-wifi-verify" )
1531- (( hw_failures++ ))
1532- fi
1533- else
1534- print_warning " Failed to configure WiFi interface in polybar"
1535- FAILED_ITEMS+=(" hardware-wifi" )
1536- (( hw_failures++ ))
1537- fi
1538- # Store for writing to marker file later (marker created in create_marker)
1539- DETECTED_WIFI_IFACE=" $WIFI_IFACE "
1540- else
1541- print_step " No WiFi interface detected (module will be hidden)"
1542- fi
1543-
1544- # Configure Ethernet module
1545- if [ -n " $ETH_IFACE " ]; then
1546- print_step " Ethernet interface detected: $ETH_IFACE "
1547- # Update interface in network-eth module section only (escape special chars for sed)
1548- local eth_escaped
1549- eth_escaped=$( printf ' %s\n' " $ETH_IFACE " | sed ' s/[&/\]/\\&/g' )
1550- if sed -i " /^\[module\/network-eth\]/,/^\[module\// s/^interface = .*/interface = ${eth_escaped} /" " $polybar_config " 2> /dev/null; then
1551- # Verify Ethernet interface was set
1552- if ! grep -q " interface = $ETH_IFACE " " $polybar_config " 2> /dev/null; then
1553- print_warning " Ethernet interface config may not have been written correctly"
1554- FAILED_ITEMS+=(" hardware-eth-verify" )
1555- (( hw_failures++ ))
1556- fi
1557- else
1558- print_warning " Failed to configure Ethernet interface in polybar"
1559- FAILED_ITEMS+=(" hardware-eth" )
1560- (( hw_failures++ ))
1561- fi
1562- # Store for writing to marker file later (marker created in create_marker)
1563- DETECTED_ETH_IFACE=" $ETH_IFACE "
1564- else
1565- print_step " No Ethernet interface detected (module will be hidden)"
1566- fi
1567-
1568- if [ -z " $WIFI_IFACE " ] && [ -z " $ETH_IFACE " ]; then
1569- print_warning " No network interfaces detected. Please configure polybar manually."
1570- FAILED_ITEMS+=(" hardware-no-network" )
1571- fi
1496+ # Network interfaces auto-detected by polybar (interface-type = wireless/wired)
1497+ # No manual configuration needed - polybar 3.6+ handles this automatically
1498+ print_step " Network interfaces: auto-detected by polybar"
15721499
15731500 if [ $hw_failures -gt 0 ]; then
15741501 print_warning " Hardware configured with $hw_failures issue(s)"
@@ -3005,13 +2932,7 @@ create_marker() {
30052932 print_step " Detected: Fedora ${variant_id:- unknown} "
30062933 fi
30072934
3008- # Write hardware detection results (populated by configure_hardware and configure_vm)
3009- if [ -n " $DETECTED_WIFI_IFACE " ]; then
3010- echo " WIFI_IFACE=$DETECTED_WIFI_IFACE " >> " $MARKER_FILE "
3011- fi
3012- if [ -n " $DETECTED_ETH_IFACE " ]; then
3013- echo " ETH_IFACE=$DETECTED_ETH_IFACE " >> " $MARKER_FILE "
3014- fi
2935+ # Write hardware detection results (populated by configure_vm)
30152936 if [ " $IS_VM_MODE " = " true" ]; then
30162937 echo " VM_MODE=true" >> " $MARKER_FILE "
30172938 fi
0 commit comments