index.md (8149B)
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 * [goblocks](https://github.com/Stargarth/Goblocks) - Partially inspired by dwmblocks, 87 Go status bar that allows you to refresh each block independently. Includes built in 88 features for frequently refreshed blocks. 89 * [gocaudices](https://github.com/lordrusk/gocaudices) - dwmblocks alternative written in go, 90 Gocaudices is a dwmblocks replacement meant to be simple, fast, and elegant. It tries to 91 adhere to the suckless philosophy. 92 * [go-dwmstatus](https://github.com/oniichaNj/go-dwmstatus) - A Go bar that 93 prints current MPD song, load averages, time/date and battery percentage. 94 * [gods](https://github.com/schachmat/gods) - implemented in Go. prints network 95 speed, cpu, ram, date/time 96 * [integrated-status-text](../patches/integrated-status-text) - A patch to have 97 dwm itself handle the blocks asynchronously: this way we can handle mouse 98 clicks, colors, etc. much easier. 99 * [profil-dwmstatus-1.0.c](profil-dwmstatus-1.0.c) - cpufreq, battery percent 100 and date/time 101 * [rsblocks](https://github.com/MustafaSalih1993/rsblocks) - A fast multi threaded status bar written in Rust, configurable with a yaml file. 102 * [sb](https://git.ckyln.com/sb/log.html) - another modular bar written in POSIX 103 shell 104 * [spoon](https://git.2f30.org/spoon/) - set dwm status. Supports battery, 105 cpu freq, date, file, load avg, keyboard layout, mpd, network speed, 106 screen brightness, temperature, wifi, volume mixer. 107 Works well on OpenBSD and Linux. 108 * [suspend-statusbar.c](https://github.com/snobb/dwm-statusbar) - date, 109 loadavg, battery and more. If battery goes below threshold - run suspend 110 command 111 * [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. 112 * [ztatus](https://git.noxz.tech/ztatus/log.html) - simple statusbar and 113 notification daemon (through fifo). Displays only date and time normally. 114 Configured to work with 'statuscolors' patch by default. 115 116 Helper Functions In The Shell 117 ----------------------------- 118 * [posix scripts](https://notabug.org/kl3/scripts) - basic collection of simple, fully POSIX sh compliant scripts to get various system information 119 * [i3blocks-contrib](https://github.com/vivien/i3blocks-contrib) - collection of python, perl and shell scripts 120 * Free memory: `free -h | awk '(NR==2){ print $4 }'` 121 * Volume (device Master): `amixer get Master | awk -F'[][]' 'END{ print $4":"$2 }'` 122 * Keyboard layout: `setxkbmap -query | awk '/layout/{ print $2 }'` 123 * Empty disk space (mountpoint /home): `df -h | awk '{ if ($6 == "/home") print $4 }'` 124 * wifi status (interface wlp3s0): `cat /sys/class/net/wlp3s0/operstate` 125 * CPU temperature: `sed 's/000$/°C/' /sys/class/thermal/thermal_zone0/temp`. 126 Alternatively you can use `acpi -t` or `sensors` from lm-sensors package. For 127 older systems you can get the cpu temperature from 128 `/proc/acpi/thermal_zone/THM0/temperature` 129 * Remaining battery: `cat /sys/class/power_supply/BAT0/capacity`. Alternatively 130 you can use `acpi -b`. For older systems you can get the battery capacity from 131 `/proc/acpi/battery/BAT0/state`. 132 133 Using shell scripts very well leads to big scripts, which pull in unneeded 134 dependencies. One solution for this is to write everything in C, which is much 135 more efficient. 136 137 Helper Functions In C (for dwmstatus or slstatus etc.) 138 ------------------------------------------------------ 139 If you have simple C functions for gathering system information, feel free to 140 add them here (keeping the list sorted). 141 142 * [ACPI battery status on Linux](new-acpi-battery.c) 143 * [Battery on Linux](batterystatus.c): Battery percentage and status. + if 144 charging, - if discharging, = if full. 145 * [Detecting Man-In-The-Middle](dwmstatus-mitm.c) 146 * [Disk usage and execute some check at different moments](diskspace_timechk.c) 147 * [FIFO info](fifo.c): Replaces dynamic_info. 148 * [Line per line the content of a file](dynamic_info.c): See 149 tmpinfo function. It prints line after line the content of 150 /tmp/dwmbuf. 151 * [MPD title/artist](mpdstatus.c) 152 * [Number of new mails in a Maildir](mail_counter.c) 153 * [Temperature from /sys on Linux](dwmstatus-temperature.c) 154 * [Uptime](uptime.c) 155 * [Up-, and downspeeds of all network interfaces from /proc/net on Linux](dwmstatus-netusage.c) 156 * [Volume via ALSA API](getvol.c)