mirror of
https://git.adityakumar.xyz/dwmbar.git
synced 2024-11-21 18:12:53 +00:00
Added ethernet module
This commit is contained in:
parent
b4cd124c6c
commit
69c852b4a5
2 changed files with 19 additions and 10 deletions
16
modules/ethernet
Executable file
16
modules/ethernet
Executable file
|
@ -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
|
|
@ -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
|
||||
|
Loading…
Reference in a new issue