Commit Graph

207 Commits

Author SHA1 Message Date
DreamMaoMao 801319f024 fix: Correct the error in converting network speed units 2025-10-02 08:55:40 +08:00
peelz 4c72033309 refactor: why is that line there 2025-07-29 07:52:46 -04:00
peelz b5093f3e58 feat: match network interfaces by their altnames 2025-07-29 07:52:46 -04:00
peelz 73d9c5f560 fix(network): reset is_p2p_ in clearIface 2025-07-10 08:01:20 -04:00
peelz b85f0c17c3 fix(network): ignore carrier state when the interface is down
I'm not sure why, but my network card (mt7921e) sometimes will report
having a carrier when the interface is down. This usually happens
when rfkill was active before rebooting.
2025-07-10 08:01:20 -04:00
peelz b02694caef fix(network): initialize all fields
Some fields were previously uninitialized (e.g. carrier), which
could lead to UB.
2025-07-10 08:01:20 -04:00
peelz 0e07c7ac5c feat(network): add rfkill setting
This setting makes it possible to have a configuration with two
network modules where one of them displays the ethernet state
(disconnected, linked, ethernet), and the other, the wifi state
(disabled, disconnected, linked, wifi).

Otherwise the ethernet state would show up as "disabled" (instead of
"disconnected") when rfkill is active.
2025-07-10 08:01:20 -04:00
peelz 46a152abc8 fix(network): display as disabled if rfkill and no carrier
We want the "disabled" state even when an interface is selected
explicitly.
2025-07-10 08:01:20 -04:00
peelz b6c13ba58b fix: 'ethernet' network state should have precedence over 'disabled' 2025-07-01 10:37:31 -04:00
peelz b8a985d606 style: fix formatting 2025-06-21 10:54:16 -04:00
peelz 07468357f4 fix: network module not displaying rfkill state 2025-06-13 21:40:18 -04:00
Harishankar G 5e4dac1c0a
Newline as a seperator when displaying IPv4 and 6 at the same time 2025-03-05 15:29:21 +05:30
Harishankar G 4a6c417ef5
Add format replacements
For cidr6, netmask6
2025-03-04 19:09:21 +05:30
Harishankar G 8bd0285c88
Remove redundant if condition 2025-02-26 16:06:58 +05:30
Harishankar G 212c676251
Provide an option to show ipv4 or ipv6 or both of them 2025-02-26 15:59:33 +05:30
Gustaf Ullberg db943dae98 Let network module handle ipv4 and ipv6 simultaneously 2024-12-05 15:31:40 +01:00
Austin Horstman 895c870d02
network: use fmt for format
Fixes the gentoo build
2024-07-15 09:44:39 -05:00
Austin Horstman b19890c0b1
network: clang-format 2024-07-15 09:02:27 -05:00
Siddhant Kameswar e117bd7cb6
network: add bssid format replacement 2024-07-12 20:46:26 -05:00
zjeffer 7576611782 formatting 2023-10-21 17:06:02 +02:00
Davide Galassi 6829ed1bb4
Different interfaces have different index 2023-10-20 08:25:28 +02:00
Alex b9cd0287f4 fix: typo 2023-07-01 11:12:46 +02:00
Alex 9d741f89e2 fix: lint 2023-07-01 11:12:14 +02:00
Alex cc4370f1b2 fix: build 2023-07-01 11:08:31 +02:00
zjeffer 25c2aaabcb Fixed build warnings 2023-07-01 10:12:24 +02:00
Alex 097cbc0c53 fix: lint 2023-05-29 09:24:33 +02:00
cptpcrd 6163be687d Open network module eventfd as close-on-exec
Ensures that it is not leaked to child processes.
2023-05-21 12:13:17 -04:00
Viktar Lukashonak 8c83af75a1
happy linter
Signed-off-by: Viktar Lukashonak <myxabeer@gmail.com>
2023-04-28 15:38:34 +03:00
Paymon 3da3732cc9 network: detect if link is p2p and use local addr
without this we endup with peer's addr

Signed-off-by: Paymon MARANDI <darwinskernel@gmail.com>
2023-04-26 13:52:17 -04:00
Elyes Haouas 0d99d38089 modules/network.cpp: Remove repeated "the"
Signed-off-by: Elyes Haouas <ehaouas@noos.fr>
2023-02-25 09:51:40 +01:00
Aleksei Bavshin ea17a66dfc
fix: compilation errors with cpp_std=c++20
There were two main issues with fmtlib and C++20 mode:

 - `fmt::format` defaults to compile-time argument checking and requires
   using `fmt::runtime(format_string)` to bypass that.
 - `std::format` implementation introduces conflicting declarations and
   we have to specify the namespace for all `format`/`format_to` calls.
2023-01-20 22:50:02 -08:00
Simon Plakolb 5e9bbe5c76 modules: Revert button to label 2022-11-24 13:08:16 +01:00
Alex ebdf575d45 fix: lint 2022-10-28 14:44:48 +02:00
Alex a4d27ea806 fix: checking router id in handleEvent function 2022-10-28 14:44:04 +02:00
Simon Plakolb 2b735f44bc modules: Set tooltip on button
Mouse-over tooltips set on the label only appear once the mouse hovers
over exactly the label. Other apps (e.g. firefox) show the tooltip once
the pointer hovers the button. Not solely its label. With this commit we
get the same behaviour.
2022-10-12 10:25:30 +02:00
Simon Plakolb 8fa5d9b838 modules: Set style-context on button
Fixes issue where the class parameters in style.css would have no
effect.

The CSS now references the GtkButton instead of the GtkLabel. Removing
all style-classes from the custom module GtkButton however removes
any properties set via style.css. Thus, the default classes 'flat' and
'text-button' are added on every update of these modules.
2022-10-12 10:25:30 +02:00
Simon Plakolb b8322c4b4b button: Add AButton class
The AButton class is designed as full a substitute to ALabel. The
GtkButton attribute 'button_' is initialized with a label. This
label can the be referenced by the subsequent inheritors of AButton
instead of the GtkLabel attribute 'label_' of ALabel.
For convenience a GtkLabel* 'label_' attribute is added to AButton.

If the button cannot be clicked it is disabled, effectively acting
like its label predecessor.

GtkButton seems to catch one-click mouse events regardless of the
flags set on it. Therefore, 'signal_pressed' is connected to a
function creating a fake GdkEventButton* and calling 'handleToggle'
(for details on this possible bug in GTK see:
https://stackoverflow.com/questions/45334911 )

In accordance with other GtkButtons (i.e. the sway/workspace ones)
set_relief(Gtk::RELIEF_NONE) is called on the 'button_' instance.
2022-10-12 10:25:29 +02:00
Alex d1700bf202
Revert "added checking router id in handleEvent function, because module does…" 2022-09-15 15:47:14 +02:00
User 52e9f624be added checking router id in handleEvent function, because module doesn't update state 2022-09-15 14:03:32 +03:00
asas1asas200 f6322d2dd1 fix(network): dont escape essid in tooltip
Like #1256 , but escape by calling `set_tooltip_markup()`, because the
label text uses `set_markup()`.
2022-08-30 23:05:34 +08:00
Alex 249c0aad73 fix: lint 2022-06-14 09:17:40 +02:00
Andrei Costescu 4e2305639b
Add option for displaying total bandwidth 2022-05-28 10:54:10 +02:00
siikamiika 7231c47244 network: calculate bandwidth for current interface 2022-04-18 13:56:30 +03:00
Alex f2fcadbf62 refactor: lint 2022-04-06 08:37:19 +02:00
momokrono fcf93a6c45 feat: added network speed in Bytes 2022-03-18 10:35:19 +01:00
Alex 6c7acf18b5
Update network.cpp 2022-03-10 09:53:02 +01:00
mazunki d22d6a4522 Merge branch 'master' of github.com:Alexays/Waybar 2022-01-08 01:02:57 +01:00
Brent George 13d25d403e add to network module - signalStrengthApp shows what applications can run at current signal strength 2021-12-14 11:37:39 -07:00
Brent George 3218612d3b change frequency to GHz 2021-12-14 11:36:46 -07:00
Brent George 9bc86347be change signal strength to penalize overly strong signals 2021-12-14 11:34:15 -07:00