sites

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

index.md (8837B)


      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 * [profil-dwmstatus-1.0.c](profil-dwmstatus-1.0.c) - cpufreq, battery percent
    104   and date/time
    105 * [rsblocks](https://github.com/MustafaSalih1993/rsblocks) - A fast multi threaded status bar written in Rust, configurable with a yaml file.
    106 * [sb](https://git.ckyln.com/sb/log.html) - another modular bar written in POSIX
    107   shell
    108 * [sdwmbar](https://github.com/sakhmatd/sdwmbar) - Simple DWM Bar written in 
    109   pure C; written for FreeBSD and OpenBSD, can be easily modified to work for
    110   Linux
    111 * [spoon](https://git.2f30.org/spoon/) - set dwm status. Supports battery,
    112   cpu freq, date, file, load avg, keyboard layout, mpd, network speed,
    113   screen brightness, temperature, wifi, volume mixer.
    114   Works well on OpenBSD and Linux.
    115 * [suspend-statusbar.c](https://github.com/snobb/dwm-statusbar) - date,
    116   loadavg, battery and more. If battery goes below threshold - run suspend
    117   command
    118 * [sysmon](https://github.com/blmayer/sysmon) - Net in/out, mem, swap, CPU and
    119   date info. Written in go using xgb and xproto to not spawn other processes.
    120 * [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.
    121 * [ztatus](https://git.noxz.tech/ztatus/log.html) - simple statusbar and
    122   notification daemon (through fifo). Displays only date and time normally.
    123   Configured to work with 'statuscolors' patch by default.
    124 
    125 Helper Functions In The Shell
    126 -----------------------------
    127 * [posix scripts](https://notabug.org/kl3/scripts) - basic collection of simple, fully POSIX sh compliant scripts to get various system information
    128 * [i3blocks-contrib](https://github.com/vivien/i3blocks-contrib) - collection of python, perl and shell scripts
    129 * Free memory: `free -h | awk '(NR==2){ print $4 }'`
    130 * Volume (device Master): `amixer get Master | awk -F'[][]' 'END{ print $4":"$2 }'`
    131 * Keyboard layout: `setxkbmap -query | awk '/layout/{ print $2 }'`
    132 * Empty disk space (mountpoint /home): `df -h | awk '{ if ($6 == "/home") print $4 }'`
    133 * wifi status (interface wlp3s0): `cat /sys/class/net/wlp3s0/operstate`
    134 * CPU temperature: `sed 's/000$/°C/' /sys/class/thermal/thermal_zone0/temp`.
    135   Alternatively you can use `acpi -t` or `sensors` from lm-sensors package. For
    136   older systems you can get the cpu temperature from
    137   `/proc/acpi/thermal_zone/THM0/temperature`
    138 * Remaining battery: `cat /sys/class/power_supply/BAT0/capacity`. Alternatively
    139   you can use `acpi -b`. For older systems you can get the battery capacity from
    140   `/proc/acpi/battery/BAT0/state`.
    141 
    142 Using shell scripts very well leads to big scripts, which pull in unneeded
    143 dependencies. One solution for this is to write everything in C, which is much
    144 more efficient.
    145 
    146 Helper Functions In C (for dwmstatus or slstatus etc.)
    147 ------------------------------------------------------
    148 If you have simple C functions for gathering system information, feel free to
    149 add them here (keeping the list sorted).
    150 
    151 * [ACPI battery status on Linux](new-acpi-battery.c)
    152 * [Battery on Linux](batterystatus.c): Battery percentage and status. + if
    153   charging, - if discharging, = if full.
    154 * [Detecting Man-In-The-Middle](dwmstatus-mitm.c)
    155 * [Disk usage and execute some check at different moments](diskspace_timechk.c)
    156 * [FIFO info](fifo.c): Replaces dynamic_info.
    157 * [Line per line the content of a file](dynamic_info.c): See
    158   tmpinfo function. It prints line after line the content of
    159   /tmp/dwmbuf.
    160 * [MPD title/artist](mpdstatus.c)
    161 * [Number of new mails in a Maildir](mail_counter.c)
    162 * [Temperature from /sys on Linux](dwmstatus-temperature.c)
    163 * [Uptime](uptime.c)
    164 * [Up-, and downspeeds of all network interfaces from /proc/net on Linux](dwmstatus-netusage.c)
    165 * [Volume via ALSA API](getvol.c)