summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-05-21swap.c: Refactor getstats() and its usageLaslo Hunhold
Add a return value so we are able to check any errors and actually fail when there has been a critical error instead of carrying on uselessly.
2018-05-21Refactor fmt_human() and fix a bugLaslo Hunhold
It is not necessary to copy memory or anything. Just keep a pointer to the active prefix-array and assign the length of the arrays to a variable. Make the code more readable by using a switch, be more strict when an invalid base is passed to it and fix a small oversight in the bottom of the code where the base 1024 was forgotten to generalized.
2018-05-21Merge fmt_human_2 and fmt_human_10 to one functionAaron Marcher
Now only one function, fmt_human, takes an additional argument "base".
2018-05-21Remove fmt from load_avgs for consistencyAaron Marcher
In a later commit something like that will be enabled for every component
2018-05-21Add option to output only once and exitAaron Marcher
2018-05-21battery_remaining: check for division by zeroAaron Marcher
2018-05-21battery_remaining: Change float to doubleAaron Marcher
2018-05-21battery: Minor coding style fixesAaron Marcher
- Line length - Spacing and indentation - No explicit checks for NULL
2018-05-21Increase readability for load_uvmexp returnAaron Marcher
2018-05-21Remove units from numbersAaron Marcher
This is a first step to decouple formatting from information because of two reasons: 1. The components should only gather and return the values by design 2. Fine grained user control should be a focus Scaling will be implemented in a different way in a later commit.
2018-05-21swap_perc: check for division by zero on obsd tooAaron Marcher
2018-05-20swap_perc: check for division by zeroAaron Marcher
2018-05-20Add David Demelier to LICENSEAaron Marcher
2018-05-20Support energy_now/power_now in battery_remainingDavid Demelier
On some laptops (mostly thinkpads), the remaining time may be expressed in µWh using energy_now and power_now files rather than µAh for charge_now and current_now. Add pick function to conditionally select appropriate one.
2018-05-20ip: fixed memory leakTobias Tschinkowitz
free the interface list before returning from the function
2018-05-20Check return value of pclose()Laslo Hunhold
2018-05-20Refactor ram.cAaron Marcher
2018-05-20Make temp more readable on LinuxAaron Marcher
2018-05-20Refactor entropy.cLaslo Hunhold
2018-05-20Remove initialization to 0 for static varsAaron Marcher
2018-05-20Remove unnecessary "valid" variable in cpu_percAaron Marcher
2018-05-20Add unit to temperatureAaron Marcher
2018-05-19Implement scaling for cpu_freqAaron Marcher
2018-05-19Implement fmt_human_2() and fmt_human_10()Laslo Hunhold
These functions take the raw number and a unit and automatically print it out "scaled down" to a proper SI-prefix, for powers of 2 and 10 respectively. Apply them to the 2-power cases and keep the 10-power for a later commit.
2018-05-19Add the percent sign to *_perc functionsAaron Marcher
Units should be added to the corresponding numbers
2018-05-19Increase precision in netspeeds.cLaslo Hunhold
First dividing by interval before multiplying with 1000 decreases the precision by +-(interval - 1) * 1000, as interval arithmetic always applies the Gauß-function to the result. This is not necessary and simply reordering the operations mitigates this.
2018-05-19Implement esnprintf() and make formatted calls more efficientLaslo Hunhold
Within the components, snprintf() was unchecked and had inefficient calls in some places. We implement esnprintf() that does all the dirty laundry for us and use it exclusively now.
2018-05-19Simplify ipv* functionsAaron Marcher
2018-05-19Use `int` for flagsAaron Marcher
2018-05-19Revert aac29e2 as it is nonsenseAaron Marcher
2018-05-19Set {r,t}xbytes 0 before incrementing them on OBSDAaron Marcher
2018-05-19Missing assignment for last commitAaron Marcher
2018-05-19Unify and simplify netspeed logic and typesAaron Marcher
2018-05-19netspeeds: added error condition for openbsdTobias Tschinkowitz
implemented additional error condition for openbsd netstat in case the interface could not be found in the interface list or if_data is not readable.
2018-05-19uptime: Format function is staticAaron Marcher
2018-05-19battery: Move out struct as common codeAaron Marcher
2018-05-19implemented openbsd netspeed functionsTobias Tschinkowitz
implemented the netspeed functionality for openbsd. furthermore the static keyword was removed of the interval variable in config.def.h for usage as extern variable.
2018-05-19Add netspeeds to config.def.hAaron Marcher
2018-05-19Add network speed functionsAaron Marcher
2018-05-18Implement fmt_scaled for ram_* functionsAaron Marcher
2018-05-18Fix ram_free for LinuxAaron Marcher
2018-05-18Implement fmt_scaled for swap_* functionsAaron Marcher
2018-05-18Implement fmt_scaled for disk_* functionsAaron Marcher
2018-05-18Add fmt_scaled util functionAaron Marcher
2018-05-18Use %d instead of accidentally %iAaron Marcher
2018-05-18Port battery_remaining to LinuxAaron Marcher
Additionally unify the format of battery_state and uptime
2018-05-18Fix memory leakAaron Marcher
2018-05-18battery: fixed remaining time on connected ACTobias Tschinkowitz
when an AC is connected apm_info shows a non-valid value for remaining minutes. it was decided that in that case the function should return an empty string.
2018-05-18Fix indentationAaron Marcher
Tabs for indentation, spaces for alignment
2018-05-18Add battery_remaining function on OpenBSDTobias Tschinkowitz
Implementation of a battery_remaining function which returns the remaining battery time in HH:MM format. Linux function still needs implementation. Move common code to load_apm_power_info