This recipe runs a quick LAN throughput test with iperf3, updates a TerminalWidget target, and also prints the measured Mbps to STDOUT.
It is designed for a Synology host running iperf3 (default host alias: syn), but it also works on other Linux/Unix systems with minimal changes to host and binary paths.
Script path:
- /bin/widget-network-perf.sh
1) Requirements
Install and verify:
sshaccess to the remote host alias (default:syn)iperf3on the remote host at/usr/local/bin/iperf3(this path is common on Synology; adjust on other systems)- local client binary
iperf3-darwinin PATH terminal-widgetCLI in PATH
Quick checks:
command -v ssh
command -v iperf3-darwin
command -v terminal-widget
ssh syn 'command -v /usr/local/bin/iperf3'
2) Make It Executable
chmod +x ~/scripts/widget-network-perf.sh
3) Configure Variables
Open the script and edit the variables at the top if needed:
SSH_HOSTIPERF_SERVER_BINIPERF_CLIENT_BINIPERF_CLIENT_TARGETREMOTE_SERVER_LOGWIDGET_TARGETWIDGET_TITLEWIDGET_BGWIDGET_FG
This is intentionally grouped at the top so sharing/customization is easy.
4) Run Manually
~/scripts/widget-network-perf.sh
Expected behavior:
- Starts a one-shot iperf3 server remotely
- Runs local iperf client against
IPERF_CLIENT_TARGET - Updates widget target
network_perfwith multiline text:- LAN Performance
<mbps>Mb/s- timestamp (
%m/%d %H:%M)
- Prints raw Mbps value to STDOUT
5) Use As a TerminalWidget Recipe
Use your existing TerminalWidget recipe mechanism and set the command to:
~/scripts/widget-network-perf.sh
Recommended:
- Refresh interval: 5-15 minutes for a stable signal
- Keep widget target as
network_perfunless you want a different widget ID
6) Troubleshooting
If the widget does not update:
- Confirm
terminal-widgetis installed and in PATH - Run script directly in Terminal to see STDERR output
- Confirm remote host alias resolves and allows SSH
If throughput cannot be parsed:
- iperf output format may differ; run:
iperf3-darwin -c Cyberzerk.local
- verify output includes
Mbits/secon sender or receiver summary lines