nixers
Post Your dwm Bar - Printable Version
+- nixers (https://nixers.net)
+-- Forum: Desktop Customization, Efficiency, and Aesthetics (https://nixers.net/Forum-Desktop-Customization-Efficiency-and-Aesthetics)
+--- Forum: Desktop Customization & Workflow (https://nixers.net/Forum-Desktop-Customization-Workflow)
+--- Thread: Post Your dwm Bar (/Thread-Post-Your-dwm-Bar)


Post Your dwm Bar - ZdenoCharest - 01-08-2013

After a quick visit to IRC, it seems that a lot of people here use dwm.

Here's what I use instead of conky under Arch Linux.

Code:
### DWM

wifi(){
      STATUS="X`/sbin/iwgetid`"
      if test "$STATUS" != "X" ; then
        ESSID="`/sbin/iwgetid |awk -F ":" '{print $2}'|sed -e 's/"//g'`"
        LINK="`awk '/wlan0:/ {print $3}' /proc/net/wireless |sed -e 's/\.//g'`"
        IP_ADDRESS="`hostname -i`"

      echo "$ESSID $IP_ADDRESS $LINK%"
      fi
    }

batt(){
        BATTERY_STATUS="`acpi -b | awk '{print $3}' | awk 'sub(".$", "")'`"
        BATTERY_PERCENT="`acpi -b | awk '{print $4}' | awk 'sub("..$", "")'`"

        if [ "$BATTERY_PERCENT" -gt "0" ]
        then
          echo "$BATTERY_PERCENT% $BATTERY_STATUS"
        else
          echo " AC"
        fi
    }

volume(){
      STATUS="`amixer get Master | awk '/Mono:/ {print $4}'`"
      if test "$STATUS" == "[0%]" ; then
        echo " Mute"
      else
        echo " `amixer get Master | awk '/Mono.+/ {print $6=="[off]"?$6:$4}' | tr -d '[]'`"
      fi
    }

kbd_layout(){
        echo "`setxkbmap -query | grep layout |cut -d ':' -f 2 | tr -d ' '`"
    }



while true; do
  xsetroot -name "`wifi`   ♪`volume`  âš¡`batt`   â–©`kbd_layout`  `date '+%A, %B %e  %R'`"
  sleep 1
done &


Adding the following two line to the buttons array in dwm's config.h file will allow you to change the volume using the mousewheel while hovering over the status bar. Very handy.

Code:
{ ClkStatusText,        0,              Button4,        spawn,          SHCMD("amixer -q set Master 2dB+ unmute") },
{ ClkStatusText,        0,              Button5,        spawn,          SHCMD("amixer -q set Master 2dB- unmute") },



RE: Post Your dwm Bar - kirby - 01-08-2013

Thinking of switching to dwm, this looks like it could be useful, thanks.