Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
db03af3
feat: reword networkmanager module
Rodrigodd Sep 28, 2024
cded882
refactor: rename 'IconsConfig' to 'Icons'
Rodrigodd Nov 11, 2025
c517617
refactor: update DeviceType documentation
Rodrigodd Nov 11, 2025
152e907
refactor: replace mutually exclusive bools with enum
Rodrigodd Nov 11, 2025
d1fb624
refactor: move module_impl! to top of impl
Rodrigodd Nov 11, 2025
f07439b
docs(network-manager): update docs
Rodrigodd Nov 11, 2025
0d476fc
fix(networkmanager): fix panic when number of wifi levels is 0 or 1
Rodrigodd Nov 11, 2025
b376f3f
refactor: simplify use of `#[serder(default)]`
Rodrigodd Nov 11, 2025
d632b81
docs: fix typo
Rodrigodd Nov 11, 2025
5822a86
style: move comments of unmapped dbus properties
Rodrigodd Nov 11, 2025
15d7f82
chore: remove futures-signals
Rodrigodd Nov 11, 2025
11bccfd
docs: add list of device types to documentation.
Rodrigodd Nov 11, 2025
f15f523
fix: fix typos in docs
Rodrigodd Nov 13, 2025
99c3c3f
style: add space and header for unmapped properties comment
Rodrigodd Nov 13, 2025
657f2af
refactor: break up unwieldy expression
Rodrigodd Nov 13, 2025
978f86f
refactor: replace unwrap with expect
Rodrigodd Nov 13, 2025
5ddf6c4
fix: fix todo in strenght_to_level
Rodrigodd Nov 13, 2025
849d620
fix: keep `module_impl!("network_manager");`
Rodrigodd Nov 19, 2025
b45ddb5
refactor: alias tokio::sync::RwLock to AsyncRwLock
Rodrigodd Nov 19, 2025
c6ed09a
fix: fix example in docs
Rodrigodd Nov 19, 2025
842aa82
style: don't prefix used variable with underscore
Rodrigodd Nov 20, 2025
bcd32ca
fix: fix typo in log
Rodrigodd Nov 20, 2025
9bb55cf
doc: replace `networkmanager` with `network_manager`
Rodrigodd Nov 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ music = []
"music+mpris" = ["music", "mpris"]
"music+mpd" = ["music", "mpd-utils"]

network_manager = ["futures-lite", "futures-signals", "zbus"]
network_manager = ["futures-lite", "zbus"]

notifications = ["zbus"]

Expand Down Expand Up @@ -176,9 +176,6 @@ evdev-rs = { version = "0.6.3", optional = true }
mpd-utils = { version = "0.2.1", optional = true }
mpris = { version = "2.0.1", optional = true }

# network_manager
futures-signals = { version = "0.3.34", optional = true }

# sys_info
sysinfo = { version = "0.37.2", optional = true }

Expand Down
149 changes: 91 additions & 58 deletions docs/modules/Network-Manager.md
Original file line number Diff line number Diff line change
@@ -1,80 +1,113 @@
Displays the current network connection state of NetworkManager.
Supports wired ethernet, wifi, cellular data and VPN connections among others.

> [!NOTE]
> This module is currently a basic skeleton implementation and only offers the most basic functionality currently.
> It uses NetworkManager's so-called primary connection,
> and therefore inherits its limitation of only being able to display the "top-level" connection.
> For example, if we have a VPN connection over a wifi connection it will only display the former,
> until it is disconnected, at which point it will display the latter.
> A solution to this is currently in the works.
Displays the state of each network device managed by NetworkManager. Each device
type will show an icon representing its current state (connected, acquiring,
disconnected).

## Configuration

> Type: `network_manager`
| Name | Type | Default | Description |
|-------------|-----------|---------|-------------------------|
| `icon_size` | `integer` | `24` | Size to render icon at. |

> [!NOTE]
> This module does not support module-level [layout options](module-level-options#layout).
> Type: `networkmanager`
| Name | Type | Default | Description |
| ----------------------------- | ---------- | ------------------------------------------ | ----------------------------------------------------------------------------------- |
| `icon_size` | `integer` | `24` | Size to render icon at. |
| `types_blacklist` | `string[]` | `[]` | Any device with a type in this list will not be shown. |
| `types_whitelist` | `string[]` | `[]` | If not empty, only devices with a type in this list will be shown. |
| `interface_blacklist` | `string[]` | `[]` | Any device whose interface name is in this list will not be shown. |
| `interface_whitelist` | `string[]` | `[]` | If not empty, only devices whose interface name is in this list will be shown. |
| `icons.wired.connected` | `string` | `icon:network-wired-symbolic` | Icon for connected wired device. |
| `icons.wired.acquiring` | `string` | `icon:network-wired-acquiring-symbolic` | Icon for acquiring wired device. |
| `icons.wired.disconnected` | `string` | `""` | Icon for disconnected wired device. |
| `icons.wifi.levels` | `string[]` | See below | Icon for each strengh level of a connected wifi connection, from lowest to highest. |
| `icons.wifi.acquiring` | `string` | `icon:network-wireless-acquiring-symbolic` | Icon for acquiring wifi device. |
| `icons.wifi.disconnected` | `string` | `""` | Icon for disconnected wifi connection. |
| `icons.cellular.connected` | `string` | `icon:network-cellular-connected-symbolic` | Icon for connected cellular device. |
| `icons.cellular.acquiring` | `string` | `icon:network-cellular-acquiring-symbolic` | Icon for acquiring cellular device. |
| `icons.cellular.disconnected` | `string` | `""` | Icon for disconnected cellular device. |
| `icons.vpn.connected` | `string` | `icon:network-vpn-symbolic` | Icon for connected VPN device. |
| `icons.vpn.acquiring` | `string` | `icon:network-vpn-acquiring-symbolic` | Icon for acquiring VPN device. |
| `icons.vpn.disconnected` | `string` | `""` | Icon for disconnected VPN device. |
| `unkown` | `string` | `icon:dialog-question-symbolic` | Icon for device in unkown state. |

**Device Types:** The device types used in `types_whitelist` and
`types_blacklists` are the same as those used by NetworkManager. You can find
the type of the devices on your system by running `nmcli device status` in a
terminal. The possible device types are: `unknown`, `ethernet`, `wifi`, `bt`,
`olpc_mesh`, `wimax`, `modem`, `infiniband`, `bond`, `vlan`, `adsl`, `bridge`,
`generic`, `team`, `tun`, `ip_tunnel`, `macvlan`, `vxlan`, `veth`, `macsec`,
`dummy`, `ppp`, `ovs_interface`, `ovs_port`, `ovs_bridge`, `wpan`, `six_lowpan`,
`wireguard`, `wifi_p2p`, `vrf`, `loopback`, `hsr` and `ipvlan`.

**Default `icons.wifi.levels`:** they contain the 5 GTK symbolic icons for wireless signal strength:
- `"icon:network-wireless-signal-none-symbolic"`
- `"icon:network-wireless-signal-weak-symbolic"`
- `"icon:network-wireless-signal-ok-symbolic"`
- `"icon:network-wireless-signal-good-symbolic"`
- `"icon:network-wireless-signal-excellent-symbolic"`

<details>
<summary>JSON</summary>

```json
{
"end": [
{
"type": "network_manager",
"icon_size": 32
}
]
}
```
<summary>JSON</summary>

```json
{
"end": [
{
"type": "networkmanager",
"icon_size": 24
types_blacklist: ["loopback", "bridge"]
}
]
}
```

</details>

<details>
<summary>TOML</summary>
<summary>TOML</summary>

```toml
[[end]]
type = "networkmanager"
icon_size = 24
types_blacklist = ["loopback", "bridge"]
```

```toml
[[end]]
type = "network_manager"
icon_size = 32
```
</details>

<details>
<summary>YAML</summary>
<summary>YAML</summary>

```yaml
end:
- type: "networkmanager"
icon_size: 24
types_blacklist:
- loopback
- bridge
```
```yaml
end:
- type: "network_manager"
icon_size: 32
```
</details>
<details>
<summary>Corn</summary>
```corn
{
end = [
{
type = "network_manager"
icon_size = 32
}
]
}
```
<summary>Corn</summary>
```corn
{
end = [
{
type = "networkmanager"
icon_size = 24
types_blacklist = ["loopback", "bridge"]
}
]
}
```

</details>

## Styling

| Selector | Description |
|--------------------------|----------------------------------|
| `.network_manager` | NetworkManager widget container. |
| `.network_manager .icon` | NetworkManager widget icon. |
| Selector | Description |
| ---------------------- | -------------------------------- |
| `.networkmanager` | NetworkManager widget container. |
| `.networkmanger .icon` | NetworkManager widget icons. |

For more information on styling, please see the [styling guide](styling-guide).
Loading
Loading