From: Ingo Bürk Date: Tue, 27 Mar 2018 07:26:55 +0000 (+0200) Subject: Merge branch 'master' into master X-Git-Tag: 2.12~3^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fpull%2F264%2Fhead;p=i3%2Fi3status Merge branch 'master' into master --- 4345fa9d9715a912c55828565783311e3fab4f0f diff --cc src/first_network_device.c index 430f1d5,1ed50a2..b930f53 --- a/src/first_network_device.c +++ b/src/first_network_device.c @@@ -109,24 -124,8 +109,25 @@@ static net_type_t iface_type(const cha close(s); return NET_TYPE_ETHERNET; } +#else + char devtype[32]; + + if (!sysfs_devtype(devtype, sizeof(devtype), ifname)) + return NET_TYPE_OTHER; + + /* Default to Ethernet when no devtype is available */ + if (!devtype[0]) + return NET_TYPE_ETHERNET; + + if (strcmp(devtype, "wlan") == 0) + return NET_TYPE_WIRELESS; + + if (strcmp(devtype, "wwan") == 0) + return NET_TYPE_OTHER; + + return NET_TYPE_OTHER; #endif + return NET_TYPE_OTHER; } const char *first_eth_interface(const net_type_t type) {