Post Your dwm Bar - Desktop Customization & Workflow

Users browsing this thread: 1 Guest(s)
ZdenoCharest
Members
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") },


Messages In This Thread
Post Your dwm Bar - by ZdenoCharest - 01-08-2013, 01:40 AM
RE: Post Your dwm Bar - by kirby - 01-08-2013, 06:44 AM