1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
<!doctype html>
<html lang="EN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/style.css">
<title>DWM slstatus</title>
</head>
<body>
<header>
<h1>Bloggings</h1>
<a href="/index.php">Back</a>
</header>
<main>
<article>
<h2>DWM slstatus</h2>
<h3>2025-04-25</h3>
<h4>KISS</h4>
<p><img src="/images/blog/slstatus.png" alt="slstatus bar image"></p>
<p><a href="https://tools.suckless.org/slstatus/">https://tools.suckless.org/slstatus/</a></p>
<p>After fiddling with dwm-blocks and dwm-bar, I decided that the only thing I want to see
in my status bar is battery info and date/time. The rest can be done with btop and alerts.</p>
<p>So I cloned the slstatus source code from suckless.org and added the following in slstatus/config.h</p>
<pre>
static const struct arg args[] = {
/* function format argument */
{ battery_remaining, "%s", "BAT0" },
{ battery_state, " %s", "BAT0" },
{ battery_perc, " %s%%", "BAT0" },
{ datetime, " | %s", "%a %d-%m %T" },
};
</pre>
<p>As I'm using the Jetbrains mono nerdfont in DWM I added some icons in slstatus/components/battery.c</p>
<p><img src="/images/blog/battery.c.png" alt="battery code"></p>
</article>
</main>
<footer>
<p> </p>
<p>§</p>
</footer>
</body>
</html>
|