summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 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
* corrected calculation for swap on openbsdTobias Tschinkowitz2018-05-161-7/+5
| | | | | | 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.
* consistent calculation of ram_* on openbsdTobias Tschinkowitz2018-05-161-4/+4
|
* Add he4d to LICENSEAaron Marcher2018-05-161-0/+1
|
* updated ram_total and ram_free (obsd)Tobias Tschinkowitz2018-05-161-4/+4
|
* Cast CPU percentage to int and fix indenationAaron Marcher2018-05-141-11/+11
|
* fflush(stdout) to print line by line if stdout is not a ttyJosuah Demangeon2018-05-081-0/+1
| | | | | | | | | | 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
* Add josuah to LICENSEAaron Marcher2018-05-081-0/+1
|
* include <sys/time.h> before <sys/sensors.h> for time struct timevalJosuah Demangeon2018-05-081-1/+1
| | | | | | | | | | sys/sensors.h has two structs struct timeval: sensor and ksensor: struct sensor { ... struct timeval tv; /* sensor value last change time */ ... };
* Only variable declarations at top of blockAaron Marcher2018-05-071-1/+2
|
* Fix indents (spaces for alignment)Aaron Marcher2018-05-071-1/+1
|
* wifi_perc: SimplifyAaron Marcher2018-05-071-4/+1
|
* num_files: Variable declarations at top of blockAaron Marcher2018-05-071-1/+2
|
* Fix disk_perc by casting it to intAaron Marcher2018-05-071-2/+2
|
* disk_perc: SimplifyAaron Marcher2018-05-071-4/+2
|
* cpu: Simplify functionsAaron Marcher2018-05-071-16/+14
|
* Unify header includesAaron Marcher2018-05-076-11/+11
| | | | | - Sort Alphabetically - Same indentation for preprocessor clauses
* entropy: Small fixAaron Marcher2018-05-061-1/+2
|
* entropy: Port to OpenBSDAaron Marcher2018-05-062-2/+5
| | | | OpenBSD's entropy design is superior to Linux.
* datetime: Add <stdio.h> for fprintfAaron Marcher2018-05-061-0/+1
|
* datetime: Add error messageAaron Marcher2018-05-061-0/+1
|
* Fix coding styleAaron Marcher2018-05-0615-66/+91
| | | | | | | | | - Use block for single statement ifs - Keep lines to reasonable length (current debate as to reasonable) - When functions return -1 for error test against 0 not -1 - Do not indent cases another level - Do not test against NULL and 0 explicitly - Use tabs for indentation, use spaces for alignment
* Remove cpu_iowaitAaron Marcher2018-05-064-29/+0
| | | | | | The third value from load_avg (idle) gives us almost the same information as cpu_iowait. Plus OpenBSD does not offer an iowait value as Linux and thus the corresponding function would not be portable.
* cpu_perc: Documentation and readbility improvementsAaron Marcher2018-05-061-9/+9
|
* cpu_perc: Port to OpenBSDAaron Marcher2018-05-062-1/+36
| | | | | In OpenBSD the CPU usage in percent is now computed using KERN_CPTIME sysctl.
* swap_*: Port to OpenBSDAaron Marcher2018-05-062-7/+84
|
* battery: Remove full indicatorAaron Marcher2018-05-041-1/+0
| | | | | It does not respect charging thresholds and it is not trivial to implement the indicator in OpenBSD.
* wifi_perc: Fix file descriptor leakAaron Marcher2018-05-021-2/+3
|
* Add examples to config.def.hAaron Marcher2018-05-021-14/+17
|