Last active
January 4, 2021 11:02
-
-
Save marmakoide/9f45b23b975d06ddbf8e6778be6dcaae to your computer and use it in GitHub Desktop.
Shell script that generates a string describing network connection status, to use with dwmblocks and Font Awesome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ETH_IT=enp3s0 | |
WLAN_IT=wlan0 | |
is_eth_used=$(cat /sys/class/net/${ETH_IT}/carrier) | |
is_wlan_used=$(cat /sys/class/net/${WLAN_IT}/carrier) | |
if [ "$is_eth_used" -eq 1 ]; then # wired network is carrying | |
icon="" #uF6FF | |
elif [ "$is_wlan_used" -eq 1 ]; then # wireless network is carrying | |
icon="" #uF1EB | |
else | |
icon="" #uf128 # no network | |
fi | |
echo $icon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment