A modular status bar for window managers written in C (fork of dwmblocks).
- Blocks are implemented as C functions or shell scripts.
- Only updates the statusbar when no change has occured.
- Improved input validation and error handling for signals.
- Monitors CPU and Nvidia GPU temperature, usage, VRAM usage, and power usage.
- Avoids using printf and scanf-like functions, which avoids the runtime overhead of format parsing.
- Sorts blocks according to their intervals and signals, while maintaining the original print order, which improves branch prediction and cache locality.
$ git clone https://aur.archlinux.org/packages/dwmblocks-fast-git
$ cd dwmblocks-fast-git
$ makepkg --nobuild --nodeps
Folow the additional instructions from makepkg. Optionally, manually configure config.h, blocks.h, and config.mk.
$ cd src/dwmblocks-fast/src
And return to the directory of the PKGBUILD.
$ cd ../../..
$ makepkg -si -f
Or for a custom configuration:
$ DWMBLOCKS_FAST_OPTIONS='disable-some-library' makepkg -si -f
Install the dependencies with your package manager. These can be excluded with make config.
$ make config
Follow the additional instructions from make.
$ cd src
Optionally, manually configure config.h, blocks.h, and config.mk.
$ cd ..
$ make
$ sudo make install
- alsa-lib: audio monitoring
- cuda: GPU temperature monitoring with NVML
- libx11: printing to the status bar
- dwm: window manager
- gst-plugins-base-libs: sound notifications
- dunst: popup notifications
- pamixer: audio control
- procps: send signals with pkill
dwmblocks-fast >>/tmp/dwmblocks-fast.log 2>>/tmp/dwmblocks-fast.log &
dwmblocks -p # | some_window_manager
#define SIG_SH 11
static struct Block g_blocks[] = {
/* Update_interval Signal Label Function Command*/
{ 0, SIG_SH, "", b_write_shell, "my_shell_script" },
}
static struct Block g_blocks[] = {
/* Update_interval Signal Label Function Command*/
{ 2, 0, "", write_my, NULL },
}
static char *
write_my(char *dst, unsigned int dst_len, const char *unused, unsigned int *interval)
{
/* Do something, output to dst. */
return dst;
}
SIG_SH=11
pkill -RTMIN+"$SIG_SH" dwmblocks-fast
To enable or disable certain features or libraries, comment them out in the config.h and config.mk. For example, to disable NVML:
Some features can be configured automatically with make (which is useful for automation).
$ make config # prints the available options
For example, to exclude CUDA from the dependencies:
$ make disable-cuda
# NVML (comment to disable)
# NVMLLIB = /opt/cuda/lib64
# LDFLAGS += -L$(NVMLLIB) -lnvidia-ml
# NVML (comment to disable)
# NVMLLIB = /opt/cuda/lib64
# LDFLAGS += -L$(NVMLLIB) -lnvidia-ml
/* Monitor Nvidia GPU, requires CUDA. Comment to disable. */
/* #define USE_CUDA 1 */
