Dotfiles-dwm/dwmbar/modules/ethernet

17 lines
278 B
Plaintext
Raw Normal View History

2024-06-02 11:02:06 +00:00
#!/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