aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmodules/ethernet16
-rwxr-xr-xmodules/wifi (renamed from modules/network)13
2 files changed, 19 insertions, 10 deletions
diff --git a/modules/ethernet b/modules/ethernet
new file mode 100755
index 0000000..0ebe572
--- /dev/null
+++ b/modules/ethernet
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# Prints out if there is an ethernet cable connected
+
+ETHERNET_ICON=''
+
+get_ethernet()
+{
+ if [ -d /sys/class/net/eth? ]; then
+ if [ "$(cat /sys/class/net/eth?/carrier)" == "1" ]; then
+ echo "$ETHERNET_ICON"
+ fi
+ fi
+}
+
+get_ethernet
diff --git a/modules/network b/modules/wifi
index 1507ad6..ebe30f9 100755
--- a/modules/network
+++ b/modules/wifi
@@ -1,13 +1,12 @@
#!/bin/bash
-# Gets the network status
+# Gets the wifi status
WIFI_FULL_ICON=''
WIFI_MID_ICON=''
WIFI_LOW_ICON=''
-ETHERNET_ICON=''
-get_network()
+get_wifi()
{
if grep -q wlan* "/proc/net/wireless"; then
# Wifi quality percentage
@@ -18,13 +17,7 @@ get_network()
2[0-9]|1[0-9]|[0-9]) echo "$WIFI_LOW_ICON" ;;
esac
fi
-
- if [ -d /sys/class/net/eth? ]; then
- if [ "$(cat /sys/class/net/eth?/carrier)" == "1" ]; then
- echo "$ETHERNET_ICON"
- fi
- fi
}
-get_network
+get_wifi