network: use dynlist instead of fixed name

Closes #271
Closes #265
Closes #71
This commit is contained in:
Sertonix 2024-02-07 14:33:52 +01:00 committed by Daniel Eklöf
parent 4e07b63cef
commit c44c66c83f
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
4 changed files with 504 additions and 421 deletions

View file

@ -27,6 +27,10 @@
### Changed
* log-level: default to `warning`
* network: use dynlist instead of fixed name ([#355][355])
[355]: https://codeberg.org/dnkl/yambar/pulls/355
### Deprecated
### Removed

View file

@ -6,11 +6,12 @@ network - This module monitors network connection state
# DESCRIPTION
This module monitors network connection state; disconnected/connected
state and MAC/IP addresses.
state and MAC/IP addresses. It instantiates the provided _content_
particle for each network interface.
Note: while the module internally tracks all assigned IPv4/IPv6
addresses, it currently exposes only a single IPv4 and a single IPv6
address.
address per network interface.
# TAGS
@ -68,10 +69,18 @@ address.
:[ *Type*
:[ *Req*
:< *Description*
| name
: string
: yes
: Name of network interface to monitor
| left-spacing
: int
: no
: Space, in pixels, in the left side of each rendered volume
| right-spacing
: int
: no
: Space, in pixels, on the right side of each rendered volume
| spacing
: int
: no
: Short-hand for setting both _left-spacing_ and _right-spacing_
| poll-interval
: int
: no
@ -86,9 +95,13 @@ address.
bar:
left:
- network:
name: wlp3s0
content:
map:
default:
string: {text: "{name}: {state} ({ipv4})"}
conditions:
ipv4 == "":
string: {text: "{name}: {state}"}
```
# SEE ALSO

View file

@ -169,9 +169,11 @@ bar:
- string: {text: , font: *awesome}
- string: {text: "{layout}"}
- network:
name: enp1s0
content:
map:
default: {empty: {}}
conditions:
name == enp1s0:
conditions:
~carrier: {empty: {}}
carrier:
@ -180,9 +182,12 @@ bar:
conditions:
state == up && ipv4 != "": {string: {text: , font: *awesome}}
- network:
name: wlp2s0
poll-interval: 1000
content:
map:
default: {empty: {}}
conditions:
name == wlp2s0:
map:
default: {string: {text: , font: *awesome, foreground: ffffff66}}
conditions:

File diff suppressed because it is too large Load diff