<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slstatus/util.c, branch master</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>verr: Remove special "usage" case</title>
<updated>2022-12-19T01:44:21+00:00</updated>
<author>
<name>planet36</name>
<email>planet36@users.noreply.github.com</email>
</author>
<published>2021-03-05T19:20:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=0e2ff8dc1009dccab4d2e17ed53ba65c4e99450e'/>
<id>0e2ff8dc1009dccab4d2e17ed53ba65c4e99450e</id>
<content type='text'>
In function verr, remove special case for "usage"
string

Co-authored-by: drkhsh &lt;me@drkhsh.at&gt;
Signed-off-by: drkhsh &lt;me@drkhsh.at&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In function verr, remove special case for "usage"
string

Co-authored-by: drkhsh &lt;me@drkhsh.at&gt;
Signed-off-by: drkhsh &lt;me@drkhsh.at&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>radical re-formatting 2/3: Fix blocks</title>
<updated>2022-10-27T23:03:38+00:00</updated>
<author>
<name>drkhsh</name>
<email>me@drkhsh.at</email>
</author>
<published>2022-10-27T22:51:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=3251e911878b78b0aad8fc09c782f8d81c878f75'/>
<id>3251e911878b78b0aad8fc09c782f8d81c878f75</id>
<content type='text'>
Fixes coding style. Formatting commits suck, incoherent coding style
sucks more.
https://suckless.org/coding_style/
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes coding style. Formatting commits suck, incoherent coding style
sucks more.
https://suckless.org/coding_style/
</pre>
</div>
</content>
</entry>
<entry>
<title>Follow International System of Units spacing rules</title>
<updated>2019-02-17T15:53:56+00:00</updated>
<author>
<name>Ingo Feinerer</name>
<email>feinerer@logic.at</email>
</author>
<published>2019-02-16T16:59:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=b14e039639ed28005fbb8bddeb5b5fa0c93475ac'/>
<id>b14e039639ed28005fbb8bddeb5b5fa0c93475ac</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Consistency with 80 char limit and breaks</title>
<updated>2018-07-08T15:42:58+00:00</updated>
<author>
<name>Aaron Marcher</name>
<email>me@drkhsh.at</email>
</author>
<published>2018-07-08T15:42:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=96ddf4e1dee808d6ae8162fc1a13126a3d4c77dc'/>
<id>96ddf4e1dee808d6ae8162fc1a13126a3d4c77dc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</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>Refactor snprintf-usage in util.c</title>
<updated>2018-05-23T17:56:04+00:00</updated>
<author>
<name>Laslo Hunhold</name>
<email>dev@frign.de</email>
</author>
<published>2018-05-23T11:51:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sobczak.family/slstatus/commit/?id=13d77cd268bade5e9ee9c07d9b94ca7c733cbe3d'/>
<id>13d77cd268bade5e9ee9c07d9b94ca7c733cbe3d</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</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>
</feed>
