Skip to content

Network

laiso edited this page Feb 22, 2024 · 1 revision

Network Module

  • Type : custom/script

  • Description : Displays an icon representing the current network connection type (Wi-Fi, VPN, Ethernet, or unknown).

  • How to modify :

    • Adjust the script network.sh to handle network detection and icon display as needed.
    • The type variable in the script is the icon that will be display in polybar.
    • Save the changes to the script and refresh or restart Polybar to apply the modifications.
  • Script Explanation :
    The provided network.sh script checks the network connection status by sending a request to https://www.google.com.
    If the response status is 200, indicating a successful connection.
    Then it proceeds to determine the type of connection (Wi-Fi, VPN, Ethernet, or unknown) based on the active network interfaces obtained using nmcli. The appropriate icon is then selected and outputted to be displayed in the Polybar mod

Clone this wiki locally