summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure18
1 files changed, 9 insertions, 9 deletions
diff --git a/configure b/configure
index 50ceaf8..99d4949 100755
--- a/configure
+++ b/configure
@@ -23,20 +23,20 @@ do
sed -i "/BATSTATE/a\\\\t{ battery_perc, \"[%s\", \"$BAT\"}," config.h
done
-# detect ethernet interfaces
-# WARNING: currently will fail with multiple interfaces due to as slstatus stores the # of bytes sent in a static variable
-ETH="$(ip link | grep ': en' | cut -d':' -f2 | xargs)"
-if [ -n "$ETH" ]; then
- sed -i "/NETSPEED/a\\\\t{ netspeed_tx, \"%7s]\", \"$ETH\"}," config.h
- sed -i "/NETSPEED/a\\\\t{ netspeed_rx, \"[%7s \", \"$ETH\"}," config.h
-fi
-
+# WARNING: slstatus can't handle more than 1 network interface, prioritize wireless
# detect wireless interfaces
WLAN="$(ip link | grep ': wlp' | cut -d':' -f2 | xargs)"
if [ -n "$WLAN" ]; then
sed -i "/NETSPEED/a\\\\t{ netspeed_tx, \"%7s]\", \"$WLAN\"}," config.h
- sed -i "/NETSPEED/a\\\\t{ netspeed_rx, \"[%7s \", \"$WLAN\"}," config.h
+ sed -i "/NETSPEED/a\\\\t{ netspeed_rx, \"[%7s \", \"$WLAN\"}," config.h
# sed -i "/NETSPEED/a\\\\t{ wifi_perc, \"[%3s\", \"$WLAN\"}," config.h
+else
+ # detect ethernet interfaces
+ ETH="$(ip link | grep ': en' | cut -d':' -f2 | xargs)"
+ if [ -n "$ETH" ]; then
+ sed -i "/NETSPEED/a\\\\t{ netspeed_tx, \"%7s]\", \"$ETH\"}," config.h
+ sed -i "/NETSPEED/a\\\\t{ netspeed_rx, \"[%7s \", \"$ETH\"}," config.h
+ fi
fi
sed -i "s/#define CPUS.*/#define CPUS $(nproc)/" components/cpu.c