<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slstatus/util.h, branch native-functions</title>
<subtitle>A custom configuration of the suckless status utility</subtitle>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/'/>
<entry>
<title>more concise memory calculation on Linux</title>
<updated>2025-07-24T20:41:25+00:00</updated>
<author>
<name>drkhsh</name>
<email>me@drkhsh.at</email>
</author>
<published>2025-07-24T20:41:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=8723e8b8c69c08bae8abe02ea1f4a49758b8bdfc'/>
<id>8723e8b8c69c08bae8abe02ea1f4a49758b8bdfc</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>Make LEN macro consistent with other suckless repos</title>
<updated>2022-12-19T01:44:21+00:00</updated>
<author>
<name>planet36</name>
<email>planet36@users.noreply.github.com</email>
</author>
<published>2021-04-13T16:43:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=c432c981df97f786c683435a4a06bd58fc9a7b18'/>
<id>c432c981df97f786c683435a4a06bd58fc9a7b18</id>
<content type='text'>
Signed-off-by: drkhsh &lt;me@drkhsh.at&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: drkhsh &lt;me@drkhsh.at&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Change uint64_t to uintmax_t</title>
<updated>2018-07-07T08:50:25+00:00</updated>
<author>
<name>Aaron Marcher</name>
<email>me@drkhsh.at</email>
</author>
<published>2018-07-07T08:50:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=43a12832a343747b7317987b552a87eb8ed5b42d'/>
<id>43a12832a343747b7317987b552a87eb8ed5b42d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>fmt_human: Improve types</title>
<updated>2018-07-06T05:56:46+00:00</updated>
<author>
<name>Aaron Marcher</name>
<email>me@drkhsh.at</email>
</author>
<published>2018-07-06T05:56:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=381c2fa12a82948318ddcc7bc8c26b60c3b20081'/>
<id>381c2fa12a82948318ddcc7bc8c26b60c3b20081</id>
<content type='text'>
size_t may not be enough, use 64 bit integers
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
size_t may not be enough, use 64 bit integers
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "Add basic backlight percentage support"</title>
<updated>2018-05-27T14:46:03+00:00</updated>
<author>
<name>Aaron Marcher</name>
<email>me@drkhsh.at</email>
</author>
<published>2018-05-27T14:46:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=c28643ce5bc8c7fd825e4eabbd915bad2b91dbd0'/>
<id>c28643ce5bc8c7fd825e4eabbd915bad2b91dbd0</id>
<content type='text'>
On OpenBSD the backlight percentage cannot be retrieved in a simple way.
The only two solutions we are aware of for now are:

 - reading from /dev/ttyC0: which isn't possible without changing
 permissions or running slstatus as root
 - linking against xcb-xrandr: which is bloat and does not work in every
 case appearently

This reverts commit 37724ac2c3f496f4736223d0d8e5d8fecb933590 for now.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On OpenBSD the backlight percentage cannot be retrieved in a simple way.
The only two solutions we are aware of for now are:

 - reading from /dev/ttyC0: which isn't possible without changing
 permissions or running slstatus as root
 - linking against xcb-xrandr: which is bloat and does not work in every
 case appearently

This reverts commit 37724ac2c3f496f4736223d0d8e5d8fecb933590 for now.
</pre>
</div>
</content>
</entry>
<entry>
<title>Add basic backlight percentage support</title>
<updated>2018-05-22T10:40:31+00:00</updated>
<author>
<name>David Demelier</name>
<email>markand@malikania.fr</email>
</author>
<published>2018-05-22T07:23:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=37724ac2c3f496f4736223d0d8e5d8fecb933590'/>
<id>37724ac2c3f496f4736223d0d8e5d8fecb933590</id>
<content type='text'>
At the moment linux only, but will add support for OpenBSD as well.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
At the moment linux only, but will add support for OpenBSD as well.
</pre>
</div>
</content>
</entry>
<entry>
<title>Refactor fmt_human() and fix a bug</title>
<updated>2018-05-21T18:28:57+00:00</updated>
<author>
<name>Laslo Hunhold</name>
<email>dev@frign.de</email>
</author>
<published>2018-05-21T18:08:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=ceb13206a4d9f410ab49c3824c487658c341d8c8'/>
<id>ceb13206a4d9f410ab49c3824c487658c341d8c8</id>
<content type='text'>
It is not necessary to copy memory or anything. Just keep a pointer to
the active prefix-array and assign the length of the arrays to a
variable.

Make the code more readable by using a switch, be more strict when an
invalid base is passed to it and fix a small oversight in the bottom of
the code where the base 1024 was forgotten to generalized.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is not necessary to copy memory or anything. Just keep a pointer to
the active prefix-array and assign the length of the arrays to a
variable.

Make the code more readable by using a switch, be more strict when an
invalid base is passed to it and fix a small oversight in the bottom of
the code where the base 1024 was forgotten to generalized.
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge fmt_human_2 and fmt_human_10 to one function</title>
<updated>2018-05-21T12:44:21+00:00</updated>
<author>
<name>Aaron Marcher</name>
<email>me@drkhsh.at</email>
</author>
<published>2018-05-21T12:44:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=10dbc9543edd5b5a7929dd8fa87ed33dd545375c'/>
<id>10dbc9543edd5b5a7929dd8fa87ed33dd545375c</id>
<content type='text'>
Now only one function, fmt_human, takes an additional argument "base".
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now only one function, fmt_human, takes an additional argument "base".
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove units from numbers</title>
<updated>2018-05-20T22:16:54+00:00</updated>
<author>
<name>Aaron Marcher</name>
<email>me@drkhsh.at</email>
</author>
<published>2018-05-20T22:16:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=ec5c35ec9f23254f09e734d0c1880559774dfa52'/>
<id>ec5c35ec9f23254f09e734d0c1880559774dfa52</id>
<content type='text'>
This is a first step to decouple formatting from information because of
two reasons:

 1. The components should only gather and return the values by design
 2. Fine grained user control should be a focus

Scaling will be implemented in a different way in a later commit.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a first step to decouple formatting from information because of
two reasons:

 1. The components should only gather and return the values by design
 2. Fine grained user control should be a focus

Scaling will be implemented in a different way in a later commit.
</pre>
</div>
</content>
</entry>
<entry>
<title>Implement fmt_human_2() and fmt_human_10()</title>
<updated>2018-05-19T20:58:21+00:00</updated>
<author>
<name>Laslo Hunhold</name>
<email>dev@frign.de</email>
</author>
<published>2018-05-19T20:52:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=46c4540dd2f6181e77b0800a4e007d78d0162487'/>
<id>46c4540dd2f6181e77b0800a4e007d78d0162487</id>
<content type='text'>
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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.
</pre>
</div>
</content>
</entry>
</feed>
