summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Add basic backlight percentage supportDavid Demelier2018-05-22
| | | | At the moment linux only, but will add support for OpenBSD as well.
* Change to fmt_human in netspeeds on OpenBSDAaron Marcher2018-05-22
| | | | Thanks to Hiltjo
* swap.c: Refactor getstats() and its usageLaslo Hunhold2018-05-21
| | | | | 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.
* Refactor fmt_human() and fix a bugLaslo Hunhold2018-05-21
| | | | | | | | | | 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.
* Merge fmt_human_2 and fmt_human_10 to one functionAaron Marcher2018-05-21
| | | | Now only one function, fmt_human, takes an additional argument "base".
* Remove fmt from load_avgs for consistencyAaron Marcher2018-05-21
| | | | | In a later commit something like that will be enabled for every component
* Add option to output only once and exitAaron Marcher2018-05-21
|
* battery_remaining: check for division by zeroAaron Marcher2018-05-21
|
* battery_remaining: Change float to doubleAaron Marcher2018-05-21
|
* battery: Minor coding style fixesAaron Marcher2018-05-21
| | | | | | - Line length - Spacing and indentation - No explicit checks for NULL
* Increase readability for load_uvmexp returnAaron Marcher2018-05-21
|
* Remove units from numbersAaron Marcher2018-05-21
| | | | | | | | | | 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.
* swap_perc: check for division by zero on obsd tooAaron Marcher2018-05-21
|
* swap_perc: check for division by zeroAaron Marcher2018-05-20
|
* Add David Demelier to LICENSEAaron Marcher2018-05-20
|
* Support energy_now/power_now in battery_remainingDavid Demelier2018-05-20
| | | | | | | | 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.
* ip: fixed memory leakTobias Tschinkowitz2018-05-20
| | | | free the interface list before returning from the function
* Check return value of pclose()Laslo Hunhold2018-05-20
|
* Refactor ram.cAaron Marcher2018-05-20
|
* Make temp more readable on LinuxAaron Marcher2018-05-20
|
* Refactor entropy.cLaslo Hunhold2018-05-20
|
* Remove initialization to 0 for static varsAaron Marcher2018-05-20
|
* Remove unnecessary "valid" variable in cpu_percAaron Marcher2018-05-20
|
* Add unit to temperatureAaron Marcher2018-05-20
|
* Implement scaling for cpu_freqAaron Marcher2018-05-19
|
* Implement fmt_human_2() and fmt_human_10()Laslo Hunhold2018-05-19
| | | | | | | | | 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.
* Add the percent sign to *_perc functionsAaron Marcher2018-05-19
| | | | Units should be added to the corresponding numbers
* Increase precision in netspeeds.cLaslo Hunhold2018-05-19
| | | | | | | | | 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.
* Implement esnprintf() and make formatted calls more efficientLaslo Hunhold2018-05-19
| | | | | | | 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.
* Simplify ipv* functionsAaron Marcher2018-05-19
|
* Use `int` for flagsAaron Marcher2018-05-19
|
* Revert aac29e2 as it is nonsenseAaron Marcher2018-05-19
|
* Set {r,t}xbytes 0 before incrementing them on OBSDAaron Marcher2018-05-19
|
* Missing assignment for last commitAaron Marcher2018-05-19
|
* Unify and simplify netspeed logic and typesAaron Marcher2018-05-19
|
* netspeeds: added error condition for openbsdTobias Tschinkowitz2018-05-19
| | | | | | 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.
* uptime: Format function is staticAaron Marcher2018-05-19
|
* battery: Move out struct as common codeAaron Marcher2018-05-19
|
* implemented openbsd netspeed functionsTobias Tschinkowitz2018-05-19
| | | | | | 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.
* Add netspeeds to config.def.hAaron Marcher2018-05-19
|
* Add network speed functionsAaron Marcher2018-05-19
|
* Implement fmt_scaled for ram_* functionsAaron Marcher2018-05-18
|
* Fix ram_free for LinuxAaron Marcher2018-05-18
|
* Implement fmt_scaled for swap_* functionsAaron Marcher2018-05-18
|
* Implement fmt_scaled for disk_* functionsAaron Marcher2018-05-18
|
* Add fmt_scaled util functionAaron Marcher2018-05-18
|
* Use %d instead of accidentally %iAaron Marcher2018-05-18
|
* Port battery_remaining to LinuxAaron Marcher2018-05-18
| | | | Additionally unify the format of battery_state and uptime
* Fix memory leakAaron Marcher2018-05-18
|
* battery: fixed remaining time on connected ACTobias Tschinkowitz2018-05-18
| | | | | | 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.