aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ethernet
diff options
context:
space:
mode:
Diffstat (limited to 'modules/ethernet')
-rwxr-xr-xmodules/ethernet16
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/ethernet b/modules/ethernet
new file mode 100755
index 0000000..ffd91a9
--- /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