618 Commits

Author SHA1 Message Date
lucy
774894486f add configs 2026-02-26 11:58:38 +01:00
drkhsh
614c275b42 license: bump copyright year 2026-02-12 22:54:11 +01:00
drkhsh
98769dfed7 fix buffer overflow in battery state parsing
"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.
2026-02-12 22:52:21 +01:00
drkhsh
4f61bbbd8e wifi: always retry ioctl for ifindex
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
2026-02-12 22:46:02 +01:00
Chris Billington
6fa36bad9f volume: avoid NULL dereference in onval() on sndio device switch 2026-02-12 22:45:28 +01:00
drkhsh
8723e8b8c6 more concise memory calculation on Linux
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
2025-07-24 22:41:25 +02:00
drkhsh
6eb7887853 fix name confusion in LICENSE
thanks for reporting, dsp
2025-07-16 18:21:43 +02:00
drkhsh
f5c4e634cd bump version to 1.1 2025-04-30 04:00:57 +02:00
drkhsh
3db023f13b refactor wifi on linux 2025-04-30 04:00:53 +02:00
drkhsh
a0f960c16f update LICENSE and README 2025-04-30 03:13:41 +02:00
drkhsh
57a7653632 fix compiler warning with newer gcc 2025-04-30 03:11:53 +02:00
sewn
af508f0b4c add 'up' for whether a interface is up or down 2025-04-30 03:09:55 +02:00
Al
b6267f7d0b Add underscore to separators in strtok() call in keymap.c 2025-04-30 03:08:02 +02:00
Joakim Sindholt
0b00c0319c wifi: switch to nl80211 interface 2025-04-30 02:59:42 +02:00
drkhsh
f68f49273e Release stable 1.0 version 2023-07-04 20:47:18 +02:00
drkhsh
86c7a84c23 Add back version flag to prepare for release 2023-05-15 19:16:12 +02:00
drkhsh
483169021b Fix release tarball to prepare for release
Correctly copies components to sub-directory, adds all required files
2023-05-15 19:11:39 +02:00
drkhsh
e0c155e9ab README: Sync description from manpage 2023-04-23 23:48:47 +02:00
drkhsh
ee586cfea9 manpage: Quality improvements
Adds signals section to the manpage and generally improves contents and
wording
2023-04-23 23:43:14 +02:00
drkhsh
c919def84f More LICENSE updates
Regarding 305aa5138add5971456c880219fe859cd4189624
2022-12-19 22:04:07 +01:00
drkhsh
034c591a95 Revert "config.mk: Fix PREFIX assignment"
"?=" is not POSIX, packagers should use "make PREFIX=".
This reverts commit c225c4315161a992b9e44dd990d083ee57f7f713.
2022-12-19 19:26:57 +01:00
drkhsh
305aa5138a Update LICENSE
Real names should be used if possible, as the license is legally binding
2022-12-19 19:26:18 +01:00
drkhsh
1ae616190c Update LICENSE 2022-12-19 02:44:21 +01:00
planet36
581d937e51 entropy: Use Unicode escape sequence in string
Signed-off-by: drkhsh <me@drkhsh.at>
2022-12-19 02:44:21 +01:00
planet36
c225c43151 config.mk: Fix PREFIX assignment
Signed-off-by: drkhsh <me@drkhsh.at>
2022-12-19 02:44:21 +01:00
planet36
984f45719e num_files: opendir() returns a directory stream
opendir() returns a directory stream, not a file descriptor

Co-authored-by: drkhsh <me@drkhsh.at>
Signed-off-by: drkhsh <me@drkhsh.at>
2022-12-19 02:44:21 +01:00
planet36
c432c981df Make LEN macro consistent with other suckless repos
Signed-off-by: drkhsh <me@drkhsh.at>
2022-12-19 02:44:21 +01:00
planet36
87c3dd2c36 battery: Consistent naming for capacity percentage
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>
2022-12-19 02:44:21 +01:00
planet36
d77f216fae Sort functions by name
Co-authored-by: drkhsh <me@drkhsh.at>
Signed-off-by: drkhsh <me@drkhsh.at>
2022-12-19 02:44:21 +01:00
planet36
40f13be551 uptime: Use sizeof instead of repeating the size
Signed-off-by: drkhsh <me@drkhsh.at>
2022-12-19 02:44:21 +01:00
planet36
c75cb9ad7a keymap: Variable "layout" should be const
Signed-off-by: drkhsh <me@drkhsh.at>
2022-12-19 02:44:21 +01:00
planet36
89f8476110 disk: Cast fsblkcnt_t to double instead of float
Signed-off-by: drkhsh <me@drkhsh.at>
2022-12-19 02:44:21 +01:00
planet36
0e2ff8dc10 verr: Remove special "usage" case
In function verr, remove special case for "usage"
string

Co-authored-by: drkhsh <me@drkhsh.at>
Signed-off-by: drkhsh <me@drkhsh.at>
2022-12-19 02:44:21 +01:00
planet36
e22d447684 config.def.h: Remove stray double quote in comment
Signed-off-by: drkhsh <me@drkhsh.at>
2022-12-19 02:44:21 +01:00
drkhsh
173b03417d Update README 2022-12-19 02:44:21 +01:00
Patrick Iacob
982eb223a0 battery: Fix remaining on Linux
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.
2022-12-01 09:04:32 +01:00
drkhsh
57c6e7340d New component: cat
Generically reads an arbitrary file natively.

Saves a few layers of execution in comparison to using `run_command`
with an argument like `cat ./file`.
2022-11-24 00:01:52 +01:00
drkhsh
4bd78c94ba README: Add note about FreeBSD sndio dep 2022-10-28 01:03:56 +02:00
drkhsh
cce2e5ecb0 radical re-formatting 3/3: Error checks
Check for `< 0` instead of `== -1`.

Fixes coding style. Formatting commits suck, incoherent coding style
sucks more.
https://suckless.org/coding_style/
2022-10-28 01:03:46 +02:00
drkhsh
3251e91187 radical re-formatting 2/3: Fix blocks
Fixes coding style. Formatting commits suck, incoherent coding style
sucks more.
https://suckless.org/coding_style/
2022-10-28 01:03:38 +02:00
drkhsh
2104dc362c radical re-formatting 1/3: Fix spacing
Fixes coding style. Formatting commits suck, incoherent coding style
sucks more.
https://suckless.org/coding_style/
2022-10-28 01:03:31 +02:00
drkhsh
0696635bcb radical re-formatting 0/3: Alphabetic headers
Except stated otherwise in comment.

Fixes coding style. Formatting commits suck, incoherent coding style
sucks more.
https://suckless.org/coding_style/
2022-10-28 01:03:20 +02:00
drkhsh
826a5dc862 ram: Refactor on OpenBSD
Fixes up overly complicated lines, by splitting up logic
2022-10-28 01:03:20 +02:00
drkhsh
d7ea986299 ram: Refactor Linux perc/used
Fixes up overly complicated line, by splitting up logic
2022-10-28 01:03:20 +02:00
drkhsh
3b86e4b5ef battery: Refactor remaining on OpenBSD
Fixes up overly complicated line, by splitting up logic
2022-10-28 01:03:20 +02:00
drkhsh
21327e0373 temp: Put sysctl into define to avoid line wraps
Long, wrapped, multi-line if statements suck to read.
This fixes readability.
2022-10-28 01:02:58 +02:00
drkhsh
69b2487650 various: Put paths into defines to avoid line wraps
Long, wrapped, multi-line if statements suck to read.
This fixes readability in the worst places by packing format strings for
paths into defines.
2022-10-28 01:01:10 +02:00
drkhsh
c46c1487a9 separator: kill that useless thing
Just use the format strings dude. :)
2022-10-28 01:00:40 +02:00
NRK
0c2b3e5b5c do not rely on obsolete feature
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.
2022-10-26 23:32:43 +02:00
NRK
28ef0b242c components/*.c: include slstatus.h
this gives the compiler a chance to check weather the prototype and
definiton matches or not, which would catch issues like 3c47701.
2022-10-26 23:32:07 +02:00