Actually, using psutil.net_if_stats() ( https://psutil.readthedocs.io/en/latest/#psutil.net_if_stats) will let you see which interfaces are connected. You can then use those names to display stats for the active interfaces.
On Thu, 22 Oct 2020, 15:24 el Paraguayo, <[email protected]> wrote: > That's not quite how it works. > > When you use the 'all' interface name, the widget uses the psutil module > to get the io data but passes pernic=False (i.e. all NICs are aggregated - > giving you the active numbers). > > If you set pernic=True then you'll include inactive NICs. > > You'd need to modify the widget code to only show NICs that have some > activity (and maybe include some method to remember past activity in a > certain period so interfaces didn't constantly appear or disappear). Psutil > does also have net_connections which might give you what you need to filter > active connections. > > Is there a problem with naming your interfaces in the config.py file? > > On Thu, 22 Oct 2020, 12:05 Artur, <[email protected]> wrote: > >> yes, but the name of the interface in that case is "all". >> But I would expect the name of the active interface displayed. >> If more than one interface is active then, I'd like to see each >> separately. >> >> Is it possible to achieve? >> >> On Thu, 22 Oct 2020 at 12:50, Guillaume Gelin <[email protected]> wrote: >> >>> Hi Artur, >>> >>> IIRC this is the default behavior when you don't provide an "interface" >>> argument. >>> >>> Le jeu. 22 oct. 2020 à 12:47, Artur <[email protected]> a écrit : >>> >>>> Hi, >>>> >>>> Could you advice how I could display only active net interface in the >>>> bar in Net Widget? >>>> >>>> >>>> Best >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "qtile-dev" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/qtile-dev/70e08e17-d227-4d46-a7ed-8db5f76abf32n%40googlegroups.com >>>> <https://groups.google.com/d/msgid/qtile-dev/70e08e17-d227-4d46-a7ed-8db5f76abf32n%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> >>> >>> -- >>> Guillaume Gelin >>> >>> -- >>> You received this message because you are subscribed to a topic in the >>> Google Groups "qtile-dev" group. >>> To unsubscribe from this topic, visit >>> https://groups.google.com/d/topic/qtile-dev/TGQS79EDjXE/unsubscribe. >>> To unsubscribe from this group and all its topics, send an email to >>> [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/qtile-dev/CAPn4x%2BooUjAQk2xu466zf2ZrNPT4%3DJVYZ%3D%3Dt1ePFP2%2BbbMzbbg%40mail.gmail.com >>> <https://groups.google.com/d/msgid/qtile-dev/CAPn4x%2BooUjAQk2xu466zf2ZrNPT4%3DJVYZ%3D%3Dt1ePFP2%2BbbMzbbg%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "qtile-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/qtile-dev/CAGudEj4GVNp40xpaM_mx7bCrq0PG0PbYnuQZEoBzNP5ATtVrZw%40mail.gmail.com >> <https://groups.google.com/d/msgid/qtile-dev/CAGudEj4GVNp40xpaM_mx7bCrq0PG0PbYnuQZEoBzNP5ATtVrZw%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "qtile-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/qtile-dev/CADPQLhCJVKgcBMs5t9VOahogbutomZYJS5vF7C8F3yt5JdYqUQ%40mail.gmail.com.
