Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated netspeed widget #72

Merged
merged 7 commits into from
Apr 22, 2024
Merged

Conversation

Stealthii
Copy link
Contributor

@Stealthii Stealthii commented Apr 17, 2024

This PR implements the features suggested in #66:

  • Reliably detect wireless/wired interface type
  • Detect when the interface is down
  • Add config flag to show local IPv4 address
  • Updated icons for interface types and state

The following additional changes were implemented:

  • Reduce to single bc calls for netspeed calculations
  • Add interface auto-detection via route
  • Add variable refresh time

Up, with traffic and IP:
netspeed
Down:
netspeed-down

BATS tests have been added to validate functionality, with a few edge cases handled that were discovered during testing.


Minor changes

  • netspeed: auto-detect interface if undefined
  • netspeed: new widget icons for device class and state
  • netspeed: detect interface type (wired/wireless)
  • netspeed: detect interface online state
  • netspeed: show IPv4 address with the @tokyo-night-tmux_netspeed_showip option
  • netspeed: vary the refresh rate with the @tokyo-night-tmux_netspeed_refresh option

Bug & security fixes

  • netspeed: improve accuracy and performance of netspeed calculations with bc
  • netspeed: handle
  • netspeed: handle VPN devices on macOS using the primary interface

Additional information

Potentially resolves #66.

@Stealthii
Copy link
Contributor Author

Stealthii commented Apr 17, 2024

Bats tests may be run as part of the PR workflow if #70 gets implemented. That PR additionally fixes the shfmt pre-commit to use a newer version that supports Bats files.

@Stealthii Stealthii force-pushed the feature/netspeed branch 3 times, most recently from f73601e to b97cc66 Compare April 17, 2024 19:48
@Stealthii Stealthii changed the base branch from next to master April 17, 2024 20:00
@janoamaral janoamaral added the enhancement New feature or request label Apr 22, 2024
@Stealthii Stealthii changed the base branch from master to next April 22, 2024 15:48
Copy link
Owner

@janoamaral janoamaral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just change the icons and we are good

src/netspeed.sh Outdated Show resolved Hide resolved
src/netspeed.sh Outdated Show resolved Hide resolved
src/wb-git-status.sh Outdated Show resolved Hide resolved
@janoamaral janoamaral self-requested a review April 22, 2024 18:06
This implements the features suggested in janoamaral#66:
- Detect when the interface is down
- Add config flag to show local IPv4 address
- Updated icons for interface types and state

The following additional changes were implemented:
- Reduce to single bc calls for netspeed calculations
- Add interface auto-detection via route
- Add variable refresh time
This implements BATS tests for functions provided by the netspeed
library where possible, as well as fixing two edge cases discovered
whilst testing.
This should improve detection of wireless devices.
Added snapshot and new configuration options.
@Stealthii
Copy link
Contributor Author

PR rebased, icons and screenshot updated!

@janoamaral janoamaral merged commit 2bc27a9 into janoamaral:next Apr 22, 2024
8 checks passed
@Stealthii Stealthii deleted the feature/netspeed branch April 22, 2024 21:59
uNyanda pushed a commit to uNyanda/tokyo-night-tmux that referenced this pull request Nov 13, 2024
## Minor changes

- [X] netspeed: auto-detect interface if undefined
- [X] netspeed: new widget icons for device class and state
- [X] netspeed: detect interface type (wired/wireless)
- [X] netspeed: detect interface online state
- [X] netspeed: show IPv4 address with the `@tokyo-night-tmux_netspeed_showip` option
- [X] netspeed: vary the refresh rate with the `@tokyo-night-tmux_netspeed_refresh` option

## Bug & security fixes

- [X] netspeed: improve accuracy and performance of netspeed calculations with `bc`
- [X] netspeed: handle 
- [X] netspeed: handle VPN devices on macOS using the primary interface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve netspeed widget icons
2 participants