Skip to content

Commit 0400e34

Browse files
committed
bar: added network rx/tx to the builtin widgets
1 parent f968eb2 commit 0400e34

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

assets/translations/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,8 @@
10371037
"date": "Date",
10381038
"input-volume": "Input Volume",
10391039
"output-volume": "Output Volume",
1040+
"network-rx": "Network RX",
1041+
"network-tx": "Network TX",
10401042
"ram": "RAM",
10411043
"temp": "Temperature"
10421044
},

src/config/config_service.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,6 +870,16 @@ void ConfigService::seedBuiltinWidgets(Config& config) {
870870
ram.settings["stat"] = std::string("ram_used");
871871
seed("ram", std::move(ram));
872872

873+
WidgetConfig netTx;
874+
netTx.type = "sysmon";
875+
netTx.settings["stat"] = std::string("net_tx");
876+
seed("network_tx", std::move(netTx));
877+
878+
WidgetConfig netRx;
879+
netRx.type = "sysmon";
880+
netRx.settings["stat"] = std::string("net_rx");
881+
seed("network_rx", std::move(netRx));
882+
873883
WidgetConfig outputVolume;
874884
outputVolume.type = "volume";
875885
outputVolume.settings["device"] = std::string("output");

src/shell/settings/widget_settings_registry.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,12 @@ namespace settings {
210210
if (name == "input_volume") {
211211
return tr("settings.widgets.instances.input-volume");
212212
}
213+
if (name == "network_tx") {
214+
return tr("settings.widgets.instances.network-tx");
215+
}
216+
if (name == "network_rx") {
217+
return tr("settings.widgets.instances.network-rx");
218+
}
213219
return std::string(name);
214220
}
215221

0 commit comments

Comments
 (0)