From 15de209cbaee6827f061e8d2788c9db232012c6b Mon Sep 17 00:00:00 2001 From: Cihangir Akturk Date: Mon, 22 Aug 2016 20:23:59 +0300 Subject: Parse uevent file to detect network device type (#153) Currently i3status differentiates wireless and wired devices based on the existence of wireless directory inside the device's sysfs directory. This approach seems to cause 3g modems to be incorrectly identified as the first ethernet device. This commit solves this problem by using DEVTYPE variable from uevent file. Signed-off-by: Cihangir Akturk --- include/i3status.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/i3status.h b/include/i3status.h index b4cf83f..4d2d0f1 100644 --- a/include/i3status.h +++ b/include/i3status.h @@ -202,7 +202,8 @@ void set_timezone(const char *tz); /* src/first_network_device.c */ typedef enum { NET_TYPE_WIRELESS = 0, - NET_TYPE_ETHERNET = 1 + NET_TYPE_ETHERNET = 1, + NET_TYPE_OTHER = 2 } net_type_t; const char *first_eth_interface(const net_type_t type); -- cgit v1.2.3