summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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
2018-05-18Add warn() and die()Laslo Hunhold
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.
2018-05-18Audit slstatus.cLaslo Hunhold
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).
2018-05-17Properly handle *snprintf() errorsLaslo Hunhold
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.
2018-05-17Remove UNUSED macroAaron Marcher
Use variables named unused instead which is simpler
2018-05-17Mark unused parameters, fix compiler warningsAaron Marcher
2018-05-17wifi: Fix order and add missing headerAaron Marcher
<sys/select.h> is needed before <net80211/ieee80211_ioctl.h> on OpenBSD to define NBBY and shut up compiler warnings.
2018-05-17wifi: Change memmove to memcpy on OpenBSDAaron Marcher
2018-05-17Unify type of in for loopsAaron Marcher
2018-05-17wifi_essid: Fix coding styleAaron Marcher
Only initialize variables at the beginning of a block
2018-05-17Unify type of `i` in for loopsAaron Marcher
int for normal indexes size_t for usage with the LEN macro
2018-05-17Change done to int as it is the CPU's natural typeAaron Marcher
2018-05-17Change interval to unsigned intAaron Marcher
2018-05-17Add comments for battery_* functions on OpenBSDAaron Marcher
2018-05-17added comment for temp function (openbsd)Tobias Tschinkowitz
2018-05-17corrected calculations for disk space on openbsdTobias Tschinkowitz
2018-05-16Update READMEAaron Marcher
2018-05-16wifi: Fix coding styleAaron Marcher
Use block for single statement ifs When functions return -1 for error test against 0 not -1 Newlines
2018-05-16load_ieee80211_nodereq: Fix typoAaron Marcher
2018-05-16wifi: Move out common headersAaron Marcher
2018-05-16added wifi functionality for openbsdTobias Tschinkowitz
display ESSID and signal strength percentage
2018-05-16corrected calculation for swap on openbsdTobias Tschinkowitz
The swapctl(2) function fills the swapent struct with 512KB blocks. As we want to display in GB, i just modified the calculation for this to get the expected output.
2018-05-16consistent calculation of ram_* on openbsdTobias Tschinkowitz
2018-05-16Add he4d to LICENSEAaron Marcher
2018-05-16updated ram_total and ram_free (obsd)Tobias Tschinkowitz
2018-05-14Cast CPU percentage to int and fix indenationAaron Marcher
2018-05-08fflush(stdout) to print line by line if stdout is not a ttyJosuah Demangeon
To reproduce the issue: $ slstatus -s | tee then it would print only when the stdout buffer is full, by block of multiple lines. fflush() makes sure the line is printed at every loop iteration
2018-05-08Add josuah to LICENSEAaron Marcher
2018-05-08include <sys/time.h> before <sys/sensors.h> for time struct timevalJosuah Demangeon
sys/sensors.h has two structs struct timeval: sensor and ksensor: struct sensor { ... struct timeval tv; /* sensor value last change time */ ... };
2018-05-07Only variable declarations at top of blockAaron Marcher
2018-05-07Fix indents (spaces for alignment)Aaron Marcher
2018-05-07wifi_perc: SimplifyAaron Marcher