index.md - sites - public wiki contents of suckless.org
(HTM) git clone git://git.suckless.org/sites
(DIR) Log
(DIR) Files
(DIR) Refs
---
index.md (9039B)
---
1 status monitor
2 ==============
3 The status bar text of dwm is stored in the WM\_NAME X11 property of the
4 root window, which is managed by dwm.
5
6 It can be easily set and retrieved using standard Unix tools.
7
8 xsetroot -name $status
9
10 xprop -root -notype -f WM_NAME "8u" \
11 | sed -n -r 's/WM_NAME = \"(.*)\"/\1/p'
12
13 Alternatively, instead of xsetroot also xprop can be used to set the
14 status-bar-text.
15
16 xprop -root -set WM_NAME $status
17
18 Set The Status Using A Shell Script
19 -----------------------------------
20 while true; do
21 xsetroot -name "$(date)"
22 sleep 2
23 done
24
25 Set The Status Using Other Methods
26 ----------------------------------
27 There are two status monitors maintained at suckless:
28
29 slstatus - suckless status
30 --------------------------
31 A somewhat complex status monitor which includes all batteries.
32
33 You can read more [on the project page](//tools.suckless.org/slstatus/).
34
35 dwmstatus
36 ---------
37 Barebone status monitor with basic functions written in C. This follows the
38 suckless philosophy, to give you an easy way to extend the source code to your
39 needs. See the helper functions for C below, to extend it to your needs. Just
40 check it out and keep on hacking.
41
42 git clone git://git.suckless.org/dwmstatus
43 cd dwmstatus
44 make
45 make PREFIX=/usr install
46 # add »dwmstatus 2>&1 >/dev/null &« to your .xinitrc
47
48 Status Monitors Submitted By Others
49 -----------------------------------
50 Feel free to add your own status monitors here (keeping the list sorted).
51
52 * [akuma-v-dwm](https://gitlab.com/narvin/avd) - event driven, modular,
53 and extensible with date/time, all batteries, volume (amixer), backlight,
54 memory and cpu usage out of the box.
55 * [babashka-status-bar](https://github.com/perpen/babashka-status-bar) - dynamic
56 status bar for dwm/tmux/etc, written in clojure. Supports external triggers.
57 * [barM](barM.c) - can display all, time/date, ram usage, output of commands (the New BarMonitor).
58 * [dsblocks](https://github.com/ashish-yadav11/dsblocks) - modular status
59 monitor, written and meant to be configured in C, with support for signaling,
60 clickability, cursor hinting and color.
61 * [dstat](https://www.umaxx.net/dl)
62 [Screenshot](https://www.umaxx.net/dstat.png) - displays the current network
63 throughput, CPU usage, performance settings, battery status, temperature,
64 volume settings, as well as the current date and time (OpenBSD only, no support
65 for Linux).
66 * [dwm-bar](https://github.com/joestandring/dwm-bar) - modular status bar.
67 modules for date/time, alsa volume, cmus track, countdown timer,
68 current keyboard layout, mail count, system resources, and weather.
69 * [dwmblocks](https://github.com/torrinfail/dwmblocks) - i3blocks-like
70 status bar where you can refresh each "block" independently by update time
71 or signal.
72 * [dwmblocks](https://github.com/ashish-yadav11/dwmblocks) - rewrite of
73 dwmblocks with added features including clickability, cursor hinting and
74 color.
75 * [dwmblocks-async](https://github.com/UtkarshVerma/dwmblocks-async) - Asynchronous version of
76 dwmblocks with support for clickability. Unlike dwmblocks, each block is executed
77 asynchronously so that the status bar never goes stale when a block takes time to execute.
78 * [dwms](https://github.com/ianremmler/dwms) - displays time, network, audio,
79 and battery status, written in Go using XGB.
80 * [dwmsd](https://github.com/johnko/dwmsd) - a daemon that listens on localhost
81 tcp (may be useful as a base for asynchronous updates)
82 * [dwm-sss](https://github.com/roadkillcat/dwm_sss) - shell script providing
83 date, time and CPU temperature
84 * [dwmstat](https://notabug.org/kl3/dwmstat) - small and simple | IP, CPU
85 temperature, system volume, current local time (and more) | config.h | OpenBSD
86 * [estadobar](https://lee-phillips.org/estadobarpage/) - Volume, CPU load, Wifi, free memory, battery charge, +
87 colored icon warnings on high temperature, high load, and low or charging battery. Needs
88 'statuscolors' patch; written in Python.
89 * [goblocks](https://github.com/Stargarth/Goblocks) - Partially inspired by dwmblocks,
90 Go status bar that allows you to refresh each block independently. Includes built in
91 features for frequently refreshed blocks.
92 * [gocaudices](https://github.com/lordrusk/gocaudices) - dwmblocks alternative written in go,
93 Gocaudices is a dwmblocks replacement meant to be simple, fast, and elegant. It tries to
94 adhere to the suckless philosophy.
95 * [go-dwmstatus](https://github.com/oniichaNj/go-dwmstatus) - A Go bar that
96 prints current MPD song, load averages, time/date and battery percentage.
97 * [gods](https://github.com/schachmat/gods) - implemented in Go. prints network
98 speed, cpu, ram, date/time
99 * [integrated-status-text](../patches/integrated-status-text) - A patch to have
100 dwm itself handle the blocks asynchronously: this way we can handle mouse
101 clicks, colors, etc. much easier.
102 * [mblocks](https://gitlab.com/mhdy/mblocks) - A multi-threaded, memory-safe and elegant status monitor written in Rust.
103 * [modbar](https://github.com/shirozuki/modbar) - A modular status bar. Each module can be updated independently of the others based on a given time interval or by passing module name to a named pipe. Simple and cpu-efficient. Linux-only (for now).
104 * [mtstatus](https://gitlab.com/mhdy/mtstatus) - A multi-threaded status monitor for X written in C.
105 * [profil-dwmstatus-1.0.c](profil-dwmstatus-1.0.c) - cpufreq, battery percent
106 and date/time
107 * [rsblocks](https://github.com/MustafaSalih1993/rsblocks) - A fast multi threaded status bar written in Rust, configurable with a yaml file.
108 * [sb](https://git.ckyln.com/sb/log.html) - another modular bar written in POSIX
109 shell
110 * [sdwmbar](https://github.com/sakhmatd/sdwmbar) - Simple DWM Bar written in
111 pure C; written for FreeBSD and OpenBSD, can be easily modified to work for
112 Linux
113 * [spoon](https://git.2f30.org/spoon/) - set dwm status. Supports battery,
114 cpu freq, date, file, load avg, keyboard layout, mpd, network speed,
115 screen brightness, temperature, wifi, volume mixer.
116 Works well on OpenBSD and Linux.
117 * [suspend-statusbar.c](https://github.com/snobb/dwm-statusbar) - date,
118 loadavg, battery and more. If battery goes below threshold - run suspend
119 command
120 * [sysmon](https://github.com/blmayer/sysmon) - Net in/out, mem, swap, CPU and
121 date info. Written in go using xgb and xproto to not spawn other processes.
122 * [zara](https://github.com/lordrusk/zara) - Extremely simple status bar modeled after [gocaudices](https://github.com/lordrusk/gocaudices) expandable in Go through an interface. Modules include, beyond the basics, corona stats, weather, cpubars, network traffic, moonphase, and many more.
123 * [ztatus](https://git.noxz.tech/ztatus/log.html) - simple statusbar and
124 notification daemon (through fifo). Displays only date and time normally.
125 Configured to work with 'statuscolors' patch by default.
126
127 Helper Functions In The Shell
128 -----------------------------
129 * [i3blocks-contrib](https://github.com/vivien/i3blocks-contrib) - collection of python, perl and shell scripts
130 * Free memory: `free -h | awk '(NR==2){ print $4 }'`
131 * Volume (device Master): `amixer get Master | awk -F'[][]' 'END{ print $4":"$2 }'`
132 * Keyboard layout: `setxkbmap -query | awk '/layout/{ print $2 }'`
133 * Empty disk space (mountpoint /home): `df -h | awk '{ if ($6 == "/home") print $4 }'`
134 * wifi status (interface wlp3s0): `cat /sys/class/net/wlp3s0/operstate`
135 * CPU temperature: `sed 's/000$/°C/' /sys/class/thermal/thermal_zone0/temp`.
136 Alternatively you can use `acpi -t` or `sensors` from lm-sensors package. For
137 older systems you can get the cpu temperature from
138 `/proc/acpi/thermal_zone/THM0/temperature`
139 * Remaining battery: `cat /sys/class/power_supply/BAT0/capacity`. Alternatively
140 you can use `acpi -b`. For older systems you can get the battery capacity from
141 `/proc/acpi/battery/BAT0/state`.
142
143 Using shell scripts very well leads to big scripts, which pull in unneeded
144 dependencies. One solution for this is to write everything in C, which is much
145 more efficient.
146
147 Helper Functions In C (for dwmstatus or slstatus etc.)
148 ------------------------------------------------------
149 If you have simple C functions for gathering system information, feel free to
150 add them here (keeping the list sorted).
151
152 * [ACPI battery status on Linux](new-acpi-battery.c)
153 * [Battery on Linux](batterystatus.c): Battery percentage and status. + if
154 charging, - if discharging, = if full.
155 * [Detecting Man-In-The-Middle](dwmstatus-mitm.c)
156 * [Disk usage and execute some check at different moments](diskspace_timechk.c)
157 * [FIFO info](fifo.c): Replaces dynamic_info.
158 * [Line per line the content of a file](dynamic_info.c): See
159 tmpinfo function. It prints line after line the content of
160 /tmp/dwmbuf.
161 * [MPD title/artist](mpdstatus.c)
162 * [Number of new mails in a Maildir](mail_counter.c)
163 * [Temperature from /sys on Linux](dwmstatus-temperature.c)
164 * [Uptime](uptime.c)
165 * [Up-, and downspeeds of all network interfaces from /proc/net on Linux](dwmstatus-netusage.c)
166 * [Volume via ALSA API](getvol.c)