summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary "valid" variable in cpu_percAaron Marcher2018-05-201-6/+2
|
* Add unit to temperatureAaron Marcher2018-05-201-2/+2
|
* Implement scaling for cpu_freqAaron Marcher2018-05-191-5/+13
|
* Implement fmt_human_2() and fmt_human_10()Laslo Hunhold2018-05-196-32/+61
| | | | | | | | | 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-197-12/+12
| | | | Units should be added to the corresponding numbers
* Increase precision in netspeeds.cLaslo Hunhold2018-05-191-8/+8
| | | | | | | | | 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-196-23/+72
| | | | | | | 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-191-33/+12
|
* Use `int` for flagsAaron Marcher2018-05-191-2/+2
|
* Revert aac29e2 as it is nonsenseAaron Marcher2018-05-191-8/+14
|
* Set {r,t}xbytes 0 before incrementing them on OBSDAaron Marcher2018-05-191-2/+6
|
* Missing assignment for last commitAaron Marcher2018-05-191-0/+2
|
* Unify and simplify netspeed logic and typesAaron Marcher2018-05-191-30/+24
|
* netspeeds: added error condition for openbsdTobias Tschinkowitz2018-05-191-2/+12
| | | | | | 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-191-1/+1
|
* battery: Move out struct as common codeAaron Marcher2018-05-191-14/+8
|
* implemented openbsd netspeed functionsTobias Tschinkowitz2018-05-192-2/+60
| | | | | | 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-191-0/+2
|
* Add network speed functionsAaron Marcher2018-05-194-0/+59
|
* Implement fmt_scaled for ram_* functionsAaron Marcher2018-05-181-14/+6
|
* Fix ram_free for LinuxAaron Marcher2018-05-181-1/+5
|
* Implement fmt_scaled for swap_* functionsAaron Marcher2018-05-181-6/+6
|
* Implement fmt_scaled for disk_* functionsAaron Marcher2018-05-181-7/+3
|
* Add fmt_scaled util functionAaron Marcher2018-05-182-0/+17
|
* Use %d instead of accidentally %iAaron Marcher2018-05-182-4/+4
|
* Port battery_remaining to LinuxAaron Marcher2018-05-182-4/+32
| | | | Additionally unify the format of battery_state and uptime
* Fix memory leakAaron Marcher2018-05-181-1/+1
|
* battery: fixed remaining time on connected ACTobias Tschinkowitz2018-05-181-2/+6
| | | | | | 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.
* Fix indentationAaron Marcher2018-05-182-3/+3
| | | | Tabs for indentation, spaces for alignment
* Add battery_remaining function on OpenBSDTobias Tschinkowitz2018-05-183-25/+48
| | | | | | | 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
* Add warn() and die()Laslo Hunhold2018-05-1820-76/+99
| | | | | | | | | | | Given slstatus is a tool that runs in the background, most likely run from .xinitrc, it's important to prepend the name of the tool to error messages so it becomes clear where the error is coming from. To make this much more consistent, this commit adds warn() and die() utility functions consistent with other suckless projects and adapts all calls to fprintf(stderr, *) to the warn() and die() functions, greatly increasing the readability of the code.
* Audit slstatus.cLaslo Hunhold2018-05-181-13/+35
| | | | | | | | | | | | 1) Remove setlocale() (locales are harmful and any 'issues' shall be fixed in different ways that are expected). 2) Disable buffering on stdout with setbuf() rather than flushing it each time. 3) Make error messages more consistent. 4) Add error checks where applicable. 5) Make code a bit more readable where res is assigned. 6) Use XFlush() rather than XSync() (we don't need to wait for the XServer to react, which could lead to long hangs on our side).
* Properly handle *snprintf() errorsLaslo Hunhold2018-05-172-12/+17
| | | | | | | Posix guarantees that the resulting string is null-terminated, even if we have an overflow. Instead of doing what has already been done, properly warn when there has been an error or overflow, so the user can do something about it.
* Remove UNUSED macroAaron Marcher2018-05-173-11/+3
| | | | Use variables named unused instead which is simpler
* Mark unused parameters, fix compiler warningsAaron Marcher2018-05-173-2/+10
|
* wifi: Fix order and add missing headerAaron Marcher2018-05-171-1/+2
| | | | | <sys/select.h> is needed before <net80211/ieee80211_ioctl.h> on OpenBSD to define NBBY and shut up compiler warnings.
* wifi: Change memmove to memcpy on OpenBSDAaron Marcher2018-05-171-1/+1
|
* Unify type of in for loopsAaron Marcher2018-05-171-1/+2
|
* wifi_essid: Fix coding styleAaron Marcher2018-05-171-2/+2
| | | | Only initialize variables at the beginning of a block
* Unify type of `i` in for loopsAaron Marcher2018-05-172-4/+3
| | | | | int for normal indexes size_t for usage with the LEN macro
* Change done to int as it is the CPU's natural typeAaron Marcher2018-05-171-1/+1
|
* Change interval to unsigned intAaron Marcher2018-05-171-1/+1
|
* Add comments for battery_* functions on OpenBSDAaron Marcher2018-05-171-0/+2
|
* added comment for temp function (openbsd)Tobias Tschinkowitz2018-05-171-0/+1
|
* corrected calculations for disk space on openbsdTobias Tschinkowitz2018-05-171-4/+4
|
* Update READMEAaron Marcher2018-05-161-4/+1
|
* wifi: Fix coding styleAaron Marcher2018-05-161-7/+10
| | | | | | Use block for single statement ifs When functions return -1 for error test against 0 not -1 Newlines
* load_ieee80211_nodereq: Fix typoAaron Marcher2018-05-161-1/+1
|
* wifi: Move out common headersAaron Marcher2018-05-161-20/+12
|
* added wifi functionality for openbsdTobias Tschinkowitz2018-05-161-1/+75
| | | | display ESSID and signal strength percentage