2013-09-07 14:33:41 +02:00
|
|
|
[<- widgets](https://github.com/copycat-killer/lain/wiki/Widgets)
|
|
|
|
|
2013-09-07 13:55:46 +02:00
|
|
|
Monitors network interfaces and shows current traffic in a textbox.
|
|
|
|
|
|
|
|
mynet = lain.widgets.net()
|
|
|
|
|
2013-09-10 23:55:52 +02:00
|
|
|
### input table
|
2013-09-07 13:55:46 +02:00
|
|
|
|
|
|
|
Variable | Meaning | Type | Default
|
|
|
|
--- | --- | --- | ---
|
2013-09-10 23:55:52 +02:00
|
|
|
`timeout` | Refresh timeout seconds | int | 2
|
2013-09-07 13:55:46 +02:00
|
|
|
`iface` | Network device | string | autodetected
|
|
|
|
`units` | Units | int | 1024 (kilobytes)
|
2013-09-10 23:55:52 +02:00
|
|
|
`settings` | User settings | function | empty function
|
2013-09-07 13:55:46 +02:00
|
|
|
|
2013-09-12 21:32:27 +02:00
|
|
|
Possible other values for `units` are 1 (byte) or multiple of 1024: 1024^2 (mb), 1024^3 (gb), and so on.
|
2013-09-07 13:55:46 +02:00
|
|
|
|
2013-09-12 21:33:04 +02:00
|
|
|
`settings` can use the following `iface` strings:
|
|
|
|
|
|
|
|
- `carrier` ("0", "1");
|
|
|
|
- `state` ("up", "down");
|
|
|
|
- `sent` and `received` (numbers).
|
2013-09-10 23:56:45 +02:00
|
|
|
|
|
|
|
### output
|
|
|
|
|
|
|
|
A textbox.
|