aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/network/README.md
blob: 551e23cfb0f5043cfdfdde2981169e889e619f30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# network

Wired and wifi in one module, because a connected `eth0` must not mask the
wifi state.

The tile is a globe, and each active link shows a green dot, its name and its
local IPv4 address. The address comes from `ip -j -4 addr show`, because the
Networking API exposes only the MAC; it is refreshed on link change and on a
slow timer while a link is up. When both wired and wifi are up the tile shows
both: the API exposes no route metric, so it does not guess which link
carries traffic.

The page opens on traffic: `br0`'s download and upload over the last minute,
sampled always by `perf/Perf.qml`, the five busiest processes below it, then
the LAN address and the public IP with its pin (see the perf README; Perf
still owns both, since a mismatch lights the perf tile's dot).
Those come from `ss -tinp`, its per-socket byte counters diffed every 2s
while the page is open, summed by process name. That is TCP only and the
user's own processes only: QUIC and system services are missing. nethogs
would see both, but unprivileged it cannot open the interfaces. The parsing
is in `perf/Perf.js`, tested by `perf/test_perf.js`.

Then the page lists managed wired devices, then a wifi radio switch and list. A
row click connects; a secured network that is not yet known reveals an inline
password field. Known networks offer Forget, the connected one Disconnect.

## Service lifetime

`alwaysActive: true`, and truthfully: the `Quickshell.Networking` backend
pushes and there is no poll to gate. There is no `Service.qml`, unlike sound's
`Service.qml` or vm's `Virsh.qml`, because there is no loop to own.
Referencing `Networking` in `NetworkModule.qml` is what instantiates it at
shell start.

The backend is empty for about two seconds after launch and then fills. Every
binding repaints when it arrives; nothing caches the first paint.

## Not built

Joining a hidden network. It would need a NetworkManager settings profile
built from scratch, and `NMSettings` is not in QML scope (`typeof` is
`undefined`), so there is no way to construct one from QML. Enterprise and
802.1x networks are out for the same class of reason.

Disconnect and forget failures. Neither backend exposes a failure signal for
them, so a failure shows only as the list not changing. Noted rather than
faked.