Commit graph

18 commits

Author SHA1 Message Date
b35626c9fb Impl. showing the maximum value in a dyn. netgraph 2022-12-12 13:24:22 +09:00
3889eb6dcc Impl dynamic netgraph display
The netgraph can now dynamically "resize" to always have the maximum
bytes transferred in an interval be the max value.
2022-12-11 21:49:51 +09:00
4e8564b596 Round values when determining netgraph output 2022-10-19 11:11:24 +09:00
4ff185133f Refactor net graph handling 2022-10-18 21:14:45 +09:00
7bba60e323 Impl 0.1.5 of swaybar_info
Implemented `--netdev_width=<width>` which sets the minimum width of the netdev
byte/KiB/MiB text displays.

Implemented `--netgraph_max_bytes=<bytes>` which displays a graph in text using
Unicode "Block Elements" symbols. The `<bytes>` argument determines the maximum
amount of bytes that will determine which block-character is printed on the
interval. The graph is always 10 characters wide, and the right side is the
most-recent side. Note that this always checks against the maximum of either
download or upload rates. For example, if `<bytes>` is set to 1024, and 128
bytes were downloaded and 512 bytes were uploaded in an interval, the "Lower
Half Block" Unicode symbol will be emitted (exactly half).

SwaybarObject was changed to use an `Option<String>` instead of an `Option<u16>`
for `min_width`.
2022-10-18 21:04:28 +09:00
3c0e5069ca Refactor trim() of input line fetching netdev info 2022-08-16 20:24:29 +09:00
73f0b730fa Fix failing to fetch netdev info 2022-08-16 15:33:40 +09:00
251125366c Print to stderr on invalid arg, use f64 for memory 2022-07-10 17:02:54 +09:00
ed8d0b3f31 Refactor error handling in proc.rs 2022-07-10 13:13:57 +09:00
35e4332e2f Refactorings 2022-07-10 13:05:12 +09:00
5a16bc7ba0 Fix omitted error handling branch in "match" stmt 2022-07-09 22:57:29 +09:00
49e50371a7 Fix/Refactor based on clippy warnings
Also log errors/warnings to stderr instead of stdout, since swaybar
expects formatted stdout output.
2022-07-09 22:53:18 +09:00
750cc7065c Refactor for better Error handling in mod proc 2022-07-09 22:31:01 +09:00
32b15ea937 Impl use floats for net-rate values (precision .2) 2022-07-09 18:35:54 +09:00
be4421630e Fix output of memory info
It displayed "GiB" where it should have displayed "MiB"
2022-07-09 18:21:28 +09:00
ff181c27ed Impl get info from /proc/net/dev 2022-07-09 17:33:19 +09:00
d7990af228 Impl fetching /proc/loadavg 2022-07-09 17:04:49 +09:00
0df98bc2a9 Impl parsing /proc/meminfo, create object with str 2022-07-09 16:57:49 +09:00