| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
pass sizeof(struct sockaddr_in) for AF_INET instead of always using
sizeof(struct sockaddr_in6). also skip getnameinfo entirely for
non-matching interfaces rather than calling it for every entry.
|
| |
|
|
|
|
| |
replace strcpy of interface name into ifr_name (IFNAMSIZ=16) with
bounds-checked snprintf. add one byte to resp buffer so NUL-terminating
the SSID at resp boundary does not write out of bounds.
|
| |
|
|
|
| |
if no "vol" device exists in the mixer, v was used uninitialized.
return early on match and return NULL with a warning otherwise.
|
| |
|
|
|
|
| |
the swap entry loop read the first entry repeatedly instead of
iterating with sep[i]. also free the allocation on error paths
and fix "SWAP_STATA" typo in the warning message.
|
| |
|
|
|
|
| |
"Not charging" is 12 characters; %12[a-zA-Z ] reads up to 12 chars
plus a NUL terminator (13 bytes) into a 12-byte buffer. Increase
state buffer to 13 in both battery_state and battery_remaining.
|
| |
|
|
|
|
|
|
|
|
|
| |
ifindex() caches the result of ioctl(SIOCGIFINDEX) and never
retries it, since the interface name strcmp succeeds after the
first call. if the interface does not exist when slstatus starts
(e.g. iwd with default config destroys/recreates interfaces
depending on service state), the ioctl fails and the stale
result is returned on all subsequent calls.
based on a patch by ryhpez, with input from Taha Medhous
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
more flexible parsing for /proc/meminfo to take shared and reclaimable
memory into account. this matches the output with free(1).
additionally this could fix some corner cases, as the order of fields in
/proc/meminfo is not strictly defined.
slstatus:
percent 81% free 2.5 Gi total 23.4 Gi used 19.0 Gi
free(1):
total used free shared buff/cache available
Mem: 23Gi 19Gi 2.5Gi 1.3Gi 3.2Gi 3.6Gi
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Signed-off-by: drkhsh <me@drkhsh.at>
|
| |
|
|
|
|
|
| |
opendir() returns a directory stream, not a file descriptor
Co-authored-by: drkhsh <me@drkhsh.at>
Signed-off-by: drkhsh <me@drkhsh.at>
|
| |
|
|
|
|
|
| |
https://www.kernel.org/doc/html/latest/power/power_supply_class.html
Co-authored-by: drkhsh <me@drkhsh.at>
Signed-off-by: drkhsh <me@drkhsh.at>
|
| |
|
|
| |
Signed-off-by: drkhsh <me@drkhsh.at>
|
| |
|
|
| |
Signed-off-by: drkhsh <me@drkhsh.at>
|
| |
|
|
| |
Signed-off-by: drkhsh <me@drkhsh.at>
|
| |
|
|
|
|
|
|
| |
The current version displays the remaining time as 'n/a'.
Fixes this regression introduced in 69b2487650782f135db76078c4a7fb841cb936ac
where current_now and power_now were incorrectly replaced with current and
power when they were moved to a macro.
|
| |
|
|
|
|
|
| |
Generically reads an arbitrary file natively.
Saves a few layers of execution in comparison to using `run_command`
with an argument like `cat ./file`.
|
| |
|
|
|
|
|
|
| |
Check for `< 0` instead of `== -1`.
Fixes coding style. Formatting commits suck, incoherent coding style
sucks more.
https://suckless.org/coding_style/
|
| |
|
|
|
|
| |
Fixes coding style. Formatting commits suck, incoherent coding style
sucks more.
https://suckless.org/coding_style/
|
| |
|
|
|
|
| |
Fixes coding style. Formatting commits suck, incoherent coding style
sucks more.
https://suckless.org/coding_style/
|
| |
|
|
|
|
|
|
| |
Except stated otherwise in comment.
Fixes coding style. Formatting commits suck, incoherent coding style
sucks more.
https://suckless.org/coding_style/
|
| |
|
|
| |
Fixes up overly complicated lines, by splitting up logic
|
| |
|
|
| |
Fixes up overly complicated line, by splitting up logic
|
| |
|
|
| |
Fixes up overly complicated line, by splitting up logic
|
| |
|
|
|
| |
Long, wrapped, multi-line if statements suck to read.
This fixes readability.
|
| |
|
|
|
|
| |
Long, wrapped, multi-line if statements suck to read.
This fixes readability in the worst places by packing format strings for
paths into defines.
|
| |
|
|
| |
Just use the format strings dude. :)
|
| |
|
|
|
|
|
|
|
|
| |
function prototype with unspecified argument is obsolete since c99.
additionally some of these function which don't take any argument were
being called with a `const char *` arg, which is UB.
fix both these issues by declararing ALL the components to accept a
`const char *`, and name the arg "unused" if it's meant to be ignored.
|
| |
|
|
|
| |
this gives the compiler a chance to check weather the prototype and
definiton matches or not, which would catch issues like 3c47701.
|
| |
|
|
|
|
|
|
| |
Exists on various ThinkPads. Seems to be both a synonym for "full".
Tested on:
- ThinkPad T500 (Spenser Truex <truex@equwal.com)
- ThinkPad T420 (drkhsh <me@drkhsh.at)
|
| |
|
|
|
| |
If the connection is lost to the sndiod(8) daemon reset the
initialization to allow for a graceful restart.
|
| |
|
|
|
| |
- Edit compile instructions
- Reuse OpenBSD sndio implementation
|
| |
|
|
|
|
|
| |
The current implementation uses the wrong type for
given sysctl calls leading to overflow and incorrectly
reported RAM usage. The fix is to use 'unsigned int'
which is what FreeBSD expects.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Starting with OpenBSD 6.7 regular users cannot access raw audio devices
anymore, for improved security.
Instead use the sioctl_open(3) API to access and manipulate audio
controls exposed by sndiod(8). On the first call a permanent connection
is established with the running sndiod daemon, and call-back functions
are registered which are triggered when audio controls are changed
(e.g., a USB headset is attached) or when the volume is modified. On
subsequent calls we poll for changes; if there are no volume changes
this costs virtually nothing.
Joint work with Alexandre Ratchov
|
| |
|
|
|
|
| |
On OpenBSD although the formula is correct due to integer division a
temperature of for example 54 celsius appears as 5. this patch first
treats it as a floating point op before retaining the non decimal digits
|
| |
|
|
|
|
| |
When you reach full charge the symbol would change
to a question mark "?" as "Full" was not defined,
now it changes to an "o" instead.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Based on functionality in dstat by Joerg Jung.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|