A nice spectrwm.conf file

Submitted by Fekete Zoltán on

This is my ~/.spectrwm.conf

modkey = Mod4

bar_action = ~/bin/print_status.sh

bar_font_color = gray
bar_font_color_selected = yellow
bar_font = Mono:bold:pixelsize=13:antialias=true:hinting:true

bar_format = +I. +D +S +<|+< +C +W +<|+< +A  +<|+< %Y.%m.%d  %H:%M | +V

program[lock] = xclock
program[term] = urxvtc

bind[focus_main]        = MOD+m
bind[focus_next]        = Mod1+Tab
bind[focus_prev]        = Mod1+Shift+Tab
bind[fullscreen_toggle] = MOD+Shift+f
bind[master_grow]       = MOD+i
bind[maximize_toggle]   = MOD+Shift+m
bind[menu]              = MOD+r
# bind[stack_reset]       = MOD+Shift+Space
bind[swap_main]         = MOD+Shift+Return
bind[term]              = MOD+Return

quirk[Emacs:emacs]       = WS[3] + FULLSCREEN
quirk[Firefox:Navigator] = WS[2] + FULLSCREEN
quirk[Firefox:firefox]   = FLOAT + TRANSSZ
quirk[Soffice:soffice]   = FLOAT + TRANSSZ
quirk[Xmessage:xmessage] = FLOAT + TRANSSZ + FOCUSONMAP_SINGLE

dialog_ratio = 0.6

autorun = ws[1]:urxvtc

name = ws[1]:email
name = ws[2]:www
name = ws[3]:dev
name = ws[4]:term
name = ws[5]:ssh
name = ws[6]:office
name = ws[7]:media

workspace_limit = 9

And this one is the print_status.sh
#!/bin/sh

while [ 1 ];
      do
      CHARGE=`/usr/sbin/envstat -s acpibat0:charge | grep "(" | awk -F "(" '{print $2}' | awk -F ')' '{print $1}'`
      CHARGING=`/usr/sbin/envstat -s acpibat0:charging | grep "charging" | awk -F ' ' '{print $2}'`
      CHSYM='(+)'
      if [ ${CHARGING} = "FALSE" ]
      then
         CHSYM='(-)';
      fi
      echo $CHARGE $CHSYM

      LEVEL=`echo $CHARGE | awk -F '.' '{print $1}'`

      if [ ${LEVEL} -lt 20 ] && [ ${CHARGING} = "FALSE" ]
         then
         xmessage "Battery low: " $CHARGE;
      fi
      sleep 30
      
done