dwm-xsetroot based status bar

For those who might be looking for an xsetroot approach for use on their dwm status bar, I made some mods (to a script from clusterF on BunsenLabs).  The below script reflects my (peculiar) needs and are running on my dwm (MX-Linux 21 b2) setup.

Included below is a requisite scrot for ‘proof-of-life’.

MX21-dwm-no-compositor-rofi-st-2conkies

The xsetroot script I use follows (note: the ? are missing glyphs) :

#!/usr/bin/env bash
# original script created by clusterF modified
# by ManyRoads
#

while true; do

        date '+?  %a. %d %b. ?  %R ' > /tmp/CurTime.tmp

        sleep 60s
done &

while true; do

        LOCALTIME=$(< /tmp/CurTime.tmp)
        DB=$(dropbox status)
        VOL=$(pamixer --get-volume-human)
        MEM=$(free -h --kilo | awk '/^Mem:/ {print $3 "/" $2}')
        CPU=$(top -bn1 | grep "Cpu(s)" | sed "s/.*, *\([0-9.]*\)%* id.*/\1/" | awk '{print 100 - $1}' )
        TEMP=$(sensors|grep 'Core 0'|awk '{print $3}' )
        DISK=$(df -Ph | grep "/dev/nvme0n1p2" | awk {'print $5'})
        WIFI=$(nmcli -f ACTIVE,SIGNAL dev wifi list | awk '$1=="yes" {print $2}')
        xsetroot -name " ? $MEM ? ? $CPU% ?? $TEMP ? ? $DISK ? ?  $VOL ? ? $WIFI% ? ? $DB ? $LOCALTIME ? ? ? ?"
        sleep 10s
done &

Because the glyphs (fontawesome) get hosed up on this site, here is my xsetroot script (complete).

The script is called from my dwm-autoart script:

! /bin/sh
#
#        dwm autostart, etc.
#
# Numerous functions (autostart) are located in .xsessionrc (Debian) .xprofile (arch)
# including power management, polkit, dropbox, f.lux, dunst etc.

# slstatus
# slstatus &

# conky 
pkill conky 
conky -c ~/.local/bin/Suckless/dwm/conky/.dwm-1rc &
conky -c ~/.local/bin/Suckless/dwm/conky/.dwm-2rc &
~/.local/share/scripts/xsetroot.sh &

#start dwm
exec dwm

 

Remember, like with all of my work, I am able to provide the following assurance(s):
  • It is almost certainly going to work until it breaks; although I have to admit it may never work and that would be sad.
  • When/if it does break, you may keep all of the pieces.
  • If you find my materials helpful, both you & I will be happy, at least for a little while.
  • My advice is worth every penny you paid for it!