sites

public wiki contents of suckless.org
git clone git://git.suckless.org/sites
Log | Files | Refs

index.md (9358B)


      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 * [dwmb](https://git.sr.ht/~jstnas/dwmb) - asynchronous status monitor with
     70   support for clickable regions.
     71 * [dwmblocks](https://github.com/torrinfail/dwmblocks) - i3blocks-like
     72   status bar where you can refresh each "block" independently by update time
     73   or signal.
     74 * [dwmblocks](https://github.com/ashish-yadav11/dwmblocks) - rewrite of
     75   dwmblocks with added features including clickability, cursor hinting and
     76   color.
     77 * [dwmblocks-async](https://github.com/UtkarshVerma/dwmblocks-async) - Asynchronous version of
     78   dwmblocks with support for clickability. Unlike dwmblocks, each block is executed
     79   asynchronously so that the status bar never goes stale when a block takes time to execute.
     80 * [dwms](https://github.com/ianremmler/dwms) - displays time, network, audio,
     81   and battery status, written in Go using XGB.
     82 * [dwmsd](https://github.com/johnko/dwmsd) - a daemon that listens on localhost
     83   tcp (may be useful as a base for asynchronous updates)
     84 * [dwm-sss](https://github.com/roadkillcat/dwm_sss) - shell script providing
     85   date, time and CPU temperature
     86 * [dwmstat](https://notabug.org/kl3/dwmstat) - small and simple | IP, CPU
     87   temperature, system volume, current local time (and more) | config.h | OpenBSD
     88 * [estadobar](https://lee-phillips.org/estadobarpage/) - Volume, CPU load, Wifi, free memory, battery charge, +
     89   colored icon warnings on high temperature, high load, and low or charging battery. Needs
     90   'statuscolors' patch; written in Python.
     91 * [goblocks](https://github.com/Stargarth/Goblocks) - Partially inspired by dwmblocks,
     92   Go status bar that allows you to refresh each block independently. Includes built in
     93   features for frequently refreshed blocks.
     94 * [gocaudices](https://github.com/lordrusk/gocaudices) - dwmblocks alternative written in go,
     95   Gocaudices is a dwmblocks replacement meant to be simple, fast, and elegant. It tries to
     96   adhere to the suckless philosophy.
     97 * [go-dwmstatus](https://github.com/oniichaNj/go-dwmstatus) - A Go bar that
     98   prints current MPD song, load averages, time/date and battery percentage.
     99 * [gods](https://github.com/schachmat/gods) - implemented in Go. prints network
    100   speed, cpu, ram, date/time
    101 * [integrated-status-text](../patches/integrated-status-text) - A patch to have
    102   dwm itself handle the blocks asynchronously: this way we can handle mouse
    103   clicks, colors, etc. much easier.
    104 * [mblocks](https://gitlab.com/mhdy/mblocks) - A multi-threaded, memory-safe and elegant status monitor written in Rust.
    105 * [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).
    106 * [mtstatus](https://gitlab.com/mhdy/mtstatus) - A multi-threaded status monitor for X written in C.
    107 * [profil-dwmstatus-1.0.c](profil-dwmstatus-1.0.c) - cpufreq, battery percent
    108   and date/time
    109 * [rsblocks](https://github.com/MustafaSalih1993/rsblocks) - A fast multi threaded status bar written in Rust, configurable with a yaml file.
    110 * [sb](https://git.ckyln.com/sb/log.html) - another modular bar written in POSIX
    111   shell
    112 * [sdwmbar](https://github.com/sakhmatd/sdwmbar) - Simple DWM Bar written in 
    113   pure C; written for FreeBSD and OpenBSD, can be easily modified to work for
    114   Linux
    115 * [spoon](https://git.2f30.org/spoon/) - set dwm status. Supports battery,
    116   cpu freq, date, file, load avg, keyboard layout, mpd, network speed,
    117   screen brightness, temperature, wifi, volume mixer.
    118   Works well on OpenBSD and Linux.
    119 * [suspend-statusbar.c](https://github.com/snobb/dwm-statusbar) - date,
    120   loadavg, battery and more. If battery goes below threshold - run suspend
    121   command
    122 * [dwmstatus](https://github.com/snobb/dwmstatus) - go port of
    123   suspend-statusbar.c - date, loadavg, battery, audio volume (C FFI) and more.
    124   Likewise - if battery goes below threshold - run suspend command.
    125 * [sysmon](https://github.com/blmayer/sysmon) - Net in/out, mem, swap, CPU and
    126   date info. Written in go using xgb and xproto to not spawn other processes.
    127 * [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.
    128 * [ztatus](https://git.noxz.tech/ztatus/log.html) - simple statusbar and
    129   notification daemon (through fifo). Displays only date and time normally.
    130   Configured to work with 'statuscolors' patch by default.
    131 
    132 Helper Functions In The Shell
    133 -----------------------------
    134 * [i3blocks-contrib](https://github.com/vivien/i3blocks-contrib) - collection of python, perl and shell scripts
    135 * Free memory: `free -h | awk '(NR==2){ print $4 }'`
    136 * Volume (device Master): `amixer get Master | awk -F'[][]' 'END{ print $4":"$2 }'`
    137 * Keyboard layout: `setxkbmap -query | awk '/layout/{ print $2 }'`
    138 * Empty disk space (mountpoint /home): `df -h | awk '{ if ($6 == "/home") print $4 }'`
    139 * wifi status (interface wlp3s0): `cat /sys/class/net/wlp3s0/operstate`
    140 * CPU temperature: `sed 's/000$/°C/' /sys/class/thermal/thermal_zone0/temp`.
    141   Alternatively you can use `acpi -t` or `sensors` from lm-sensors package. For
    142   older systems you can get the cpu temperature from
    143   `/proc/acpi/thermal_zone/THM0/temperature`
    144 * Remaining battery: `cat /sys/class/power_supply/BAT0/capacity`. Alternatively
    145   you can use `acpi -b`. For older systems you can get the battery capacity from
    146   `/proc/acpi/battery/BAT0/state`.
    147 
    148 Using shell scripts very well leads to big scripts, which pull in unneeded
    149 dependencies. One solution for this is to write everything in C, which is much
    150 more efficient.
    151 
    152 Helper Functions In C (for dwmstatus or slstatus etc.)
    153 ------------------------------------------------------
    154 If you have simple C functions for gathering system information, feel free to
    155 add them here (keeping the list sorted).
    156 
    157 * [ACPI battery status on Linux](new-acpi-battery.c)
    158 * [Battery on Linux](batterystatus.c): Battery percentage and status. + if
    159   charging, - if discharging, = if full.
    160 * [Detecting Man-In-The-Middle](dwmstatus-mitm.c)
    161 * [Disk usage and execute some check at different moments](diskspace_timechk.c)
    162 * [FIFO info](fifo.c): Replaces dynamic_info.
    163 * [Line per line the content of a file](dynamic_info.c): See
    164   tmpinfo function. It prints line after line the content of
    165   /tmp/dwmbuf.
    166 * [MPD title/artist](mpdstatus.c)
    167 * [Number of new mails in a Maildir](mail_counter.c)
    168 * [Temperature from /sys on Linux](dwmstatus-temperature.c)
    169 * [Uptime](uptime.c)
    170 * [Up-, and downspeeds of all network interfaces from /proc/net on Linux](dwmstatus-netusage.c)
    171 * [Volume via ALSA API](getvol.c)