I would like a command to check if my internet connection is wired or wireless. I am using Arch Linux. I am doing this to display a different icon in lemonbar for different network configurations.
Command to detect if internet connection is wired or wireless
networking;arch linux
In general case your network can be configured in the way, that you simultaneously have wireless and wired connection. E.g. part of your routes goes via wireless connection and the other part goes via wired.I would detect it in the following way: Identify the address which might be an indicator of network connection type (e.g. public google dns 8.8.8.8)Check what interface is used to reach this address from this command:ip route get 8.8.8.8Get information about interface like described in this SO answer