[PR #998] [MERGED] feat(bar): to_pretty_bytes on network #1162

Closed
opened 2026-01-05 14:54:19 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/LGUG2Z/komorebi/pull/998
Author: @CtByte
Created: 9/12/2024
Status: Merged
Merged: 9/13/2024
Merged by: @LGUG2Z

Base: feature/komorebi-status-barHead: feature/komorebi-status-bar-network


📝 Commits (1)

  • 8501f7e to_pretty_bytes on network activity

📊 Changes

3 files changed (+64 additions, -24 deletions)

View changed files

📝 .gitignore (+1 -0)
📝 komorebi-bar/Cargo.toml (+3 -0)
📝 komorebi-bar/src/network.rs (+60 -24)

📄 Description

I added formatting to the network widget that prettifies bytes.
I think it made sense to choose KiB as the minimum data unit, which could be changed by adding it to the settings, if needed.
I formatted the output on the activity readings with left padding to make it easier to read the values when they change constantly.
I changed the icons too, sorry 😄

I think that the to_pretty_bytes function could be placed in a separate file so another widget can use it as well. For example if we want to display the size on the drives or ram.

I little bit of refactoring might be needed, I am pretty new to Rust :)

image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/LGUG2Z/komorebi/pull/998 **Author:** [@CtByte](https://github.com/CtByte) **Created:** 9/12/2024 **Status:** ✅ Merged **Merged:** 9/13/2024 **Merged by:** [@LGUG2Z](https://github.com/LGUG2Z) **Base:** `feature/komorebi-status-bar` ← **Head:** `feature/komorebi-status-bar-network` --- ### 📝 Commits (1) - [`8501f7e`](https://github.com/LGUG2Z/komorebi/commit/8501f7e6c6877ea96a9345dfa668d05dc0d99715) to_pretty_bytes on network activity ### 📊 Changes **3 files changed** (+64 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+1 -0) 📝 `komorebi-bar/Cargo.toml` (+3 -0) 📝 `komorebi-bar/src/network.rs` (+60 -24) </details> ### 📄 Description I added formatting to the network widget that prettifies bytes. I think it made sense to choose `KiB` as the minimum data unit, which could be changed by adding it to the settings, if needed. I formatted the output on the activity readings with left padding to make it easier to read the values when they change constantly. I changed the icons too, sorry 😄 I think that the `to_pretty_bytes` function could be placed in a separate file so another widget can use it as well. For example if we want to display the size on the drives or ram. I little bit of refactoring might be needed, I am pretty new to Rust :) ![image](https://github.com/user-attachments/assets/73b35a37-6228-4968-88f3-c7f2c61912c2) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-01-05 14:54:19 +01:00
adam closed this issue 2026-01-05 14:54:19 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#1162