sites

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

index.md (5459B)


      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 Set The Status Using A Shell Script
     14 -----------------------------------
     15 	while true; do
     16 		xsetroot -name "$(date)"
     17 		sleep 2
     18 	done
     19 
     20 Set The Status Using Other Methods
     21 ----------------------------------
     22 There are two status monitors maintained at suckless:
     23 
     24 slstatus - suckless status
     25 --------------------------
     26 A somewhat complex status monitor which includes all batteries.
     27 
     28 You can read more [on the project page](//tools.suckless.org/slstatus/).
     29 
     30 dwmstatus
     31 ---------
     32 Barebone status monitor with basic functions written in C. This follows the
     33 suckless philosophy, to give you an easy way to extend the source code to your
     34 needs. See the helper functions for C below, to extend it to your needs. Just
     35 check it out and keep on hacking.
     36 
     37 	git clone git://git.suckless.org/dwmstatus
     38 	cd dwmstatus
     39 	make
     40 	make PREFIX=/usr install
     41 	# add »dwmstatus 2>&1 >/dev/null &« to your .xinitrc
     42 
     43 Status Monitors Submitted By Others
     44 -----------------------------------
     45 Feel free to add your own status monitors here (keeping the list sorted).
     46 
     47 * [barM](barM.c) - can display all, time/date, ram usage, output of commands (the New BarMonitor).
     48 * [dstat](https://www.umaxx.net/dl)
     49   [Screenshot](https://www.umaxx.net/dstat.png) - displays the current network
     50   throughput, CPU usage, performance settings, battery status, temperature,
     51   volume settings, as well as the current date and time (OpenBSD only, no support
     52   for Linux).
     53 * [dwm-bar](https://github.com/joestandring/dwm-bar) - modular status bar.
     54   modules for date/time, alsa volume, cmus track, countdown timer,
     55   current keyboard layout, mail count, system resources, and weather.
     56 * [dwmblocks](https://github.com/torrinfail/dwmblocks) - i3blocks-like
     57   status bar where you can refresh each "block" independently by update time
     58   or signal.
     59 * [dwms](https://github.com/ianremmler/dwms) - displays time, network, audio,
     60   and battery status, written in Go using XGB.
     61 * [dwmsd](https://github.com/johnko/dwmsd) - a daemon that listens on localhost
     62   tcp (may be useful as a base for asynchronous updates)
     63 * [dwm-sss](https://github.com/roadkillcat/dwm_sss) - shell script providing
     64   date, time and CPU temperature
     65 * [dwmstat](https://notabug.org/kl3/dwmstat) - small and simple | IP, CPU
     66   temperature, system volume, current local time (and more) | config.h | OpenBSD
     67 * [go-dwmstatus](https://github.com/oniichaNj/go-dwmstatus) - A Go bar that
     68   prints current MPD song, load averages, time/date and battery percentage.
     69 * [gods](https://github.com/schachmat/gods) - implemented in Go. prints network
     70   speed, cpu, ram, date/time
     71 * [profil-dwmstatus-1.0.c](profil-dwmstatus-1.0.c) - cpufreq, battery percent
     72   and date/time
     73 * [suspend-statusbar.c](https://github.com/snobb/dwm-statusbar) - date,
     74   loadavg, battery and more. If battery goes below threshold - run suspend
     75   command
     76 
     77 Helper Functions In The Shell
     78 -----------------------------
     79 * [posix scripts](https://notabug.org/kl3/scripts) - basic collection of simple, fully POSIX sh compliant scripts to get various system information
     80 * [i3blocks-contrib](https://github.com/vivien/i3blocks-contrib) - collection of python, perl and shell scripts
     81 * Free memory: `free -h | awk '(NR==2){ print $3 }'`
     82 * Volume (device Master): `amixer get Master | awk -F'[][]' 'END{ print $4":"$2 }'`
     83 * Keyboard layout: `setxkbmap -query | awk '/layout/{ print $2 }'`
     84 * Empty disk space (mountpoint /home): `df -h | awk '{ if ($6 == "/home") print $4 }'`
     85 * wifi status (interface wlp3s0): `cat /sys/class/net/wlp3s0/opestate`
     86 * CPU temperature: `sed 's/000$/°C/' /sys/class/thermal/thermal_zone0/temp`.
     87   Alternatively you can use `acpi -t` or `sensors` from lm-sensors package. For
     88   older systems you can get the cpu temperature from
     89   `/proc/acpi/thermal_zone/THM0/temperature`
     90 * Remaining battery: `cat /sys/class/power_supply/BAT0/capacity`. Alternatively
     91   you can use `acpi -b`. For older systems you can get the battery capacity from
     92   `/proc/acpi/battery/BAT0/state`.
     93 
     94 Using shell scripts very well leads to big scripts, which pull in unneeded
     95 dependencies. One solution for this is to write everything in C, which is much
     96 more efficient.
     97 
     98 Helper Functions In C (for dwmstatus or slstatus etc.)
     99 ------------------------------------------------------
    100 If you have simple C functions for gathering system information, feel free to
    101 add them here (keeping the list sorted).
    102 
    103 * [ACPI battery status on Linux](new-acpi-battery.c)
    104 * [Battery on Linux](batterystatus.c): Battery percentage and status. + if
    105   charging, - if discharging, = if full.
    106 * [Detecting Man-In-The-Middle](dwmstatus-mitm.c)
    107 * [Disk usage and execute some check at different moments](diskspace_timechk.c)
    108 * [FIFO info](fifo.c): Replaces dynamic_info.
    109 * [Line per line the content of a file](dynamic_info.c): See
    110   tmpinfo function. It prints line after line the content of
    111   /tmp/dwmbuf.
    112 * [MPD title/artist](mpdstatus.c)
    113 * [Number of new mails in a Maildir](mail_counter.c)
    114 * [Temperature from /sys on Linux](dwmstatus-temperature.c)
    115 * [Uptime](uptime.c)
    116 * [Up-, and downspeeds of all network interfaces from /proc/net on Linux](dwmstatus-netusage.c)
    117 * [Volume via ALSA API](getvol.c)