1. Jhonny5
  2. dwm

Commits

Jhonny5  committed e56aef0

New info at bar: see ToDo list

  • Participants
  • Parent commits b091929
  • Branches master

Comments (0)

Files changed (3)

File ToDo

View file
  • Ignore whitespace
 [X] Add more layouts.
 [X] Add bottom bar.
-[1/2] Set bottom bar info values.
-[X] Fix bottom bar - fit window size.
+    [X] Add Volume Bar info
+    [X] Add Battery Bar info
+    [X] Add Network Bar info
+[X] Bottom bar padding - fit window size.
 [ ] Add system tray at right down corner: tryer.
 [ ] Set at top bar more information: mp3, email. 
 [ ] Hide bottom bar with top bar (MODKEY+b).
+[ ] Msg. Notifications 

File dzen2/startdzen

View file
  • Ignore whitespace
 #!/bin/sh
 
-SLEEP=2
+SLEEP=1
 ICON_PATH="$HOME/.dwm/dzen2/xbm"
 ICON_COLOR='#224488'
 BG='#101010'
 Y=1060
 HEIGHT=15
 WIDTH=1920
-FONT='-*-terminus-medium-r-*-*-16-*-*-*-*-*-*-*'
+FONT='-*-terminus-medium-r-*-*-15-*-*-*-*-*-*-*'
 
 #WIDTH=1000
 #FONT='-*-monaco-medium-r-*-*-16-*-*-*-*-*-*-*'
     echo "$USED * 100 / $TOTAL" | bc
 }
 
-getCpuload() {
+getCpuLoad() {
     STAT_AFTER=`cat /proc/stat | head -n 5`
     CORE0=`getCoreLoadPercent 0`
     CORE1=`getCoreLoadPercent 1`
     echo -n $CORE3%
 }
 
-getTemp() {
+getCpuTemp() {
     icon 'temp'
     CPU1_TEMP=`sensors|grep Core|awk 'NR==1 {print $3}'`
     CPU2_TEMP=`sensors|grep Core|awk 'NR==2 {print $3}'`
     MB_TEMP=`sensors | tail -n 6 | sed -ne 's/MB Temperature: \+[-+]\([0-9]\+\).*/\1/p'`
     
-    text 'Core 1: '
+    text '1: '
     echo -n "$CPU1_TEMP°"
-    text ' Core 2: '
+    text ' 2: '
     echo -n "$CPU2_TEMP°"
 
 
     icon 'tall'
     echo -n '^ca()'
 
-    text 'home: '
+    text 'h '
     echo -n `df -h | grep sda5 | awk '{ print $5 }'`
 
-    text ', root: '
+    text ' / '
     echo -n `df -h | grep sda6 | awk '{ print $5 }'`
 
 }
     TXR=`echo "($TXBN - $TXB) / 1024 / $SLEEP" | bc -l | xargs printf "%.2f"`
 
     icon 'wired'
+    echo -n "$(iwconfig  2>1| grep "wlan0"|awk '{print $4}'| tr '[A-Z]' '[a-z]')"
     echo -n "^fg(#67b15f)^i($ICON_PATH/net_down.xbm)^fg() $RXR kB/s ^fg(#785038)^i($ICON_PATH/net_up.xbm)^fg() $TXR kB/s"
 
     # reset old rates
 
 }
 
+getNet2 () {
+    # network interface, so says wicd
+    INTERFACE="$(dbus-send --system --print-reply --dest=org.wicd.daemon \
+    /org/wicd/daemon org.wicd.daemon.GetCurrentInterface | tail -n1 | \
+    sed 's@\s*string "\(.*\)"@\1@')"
+    # wicd knows what the wireless card is, so let's ask it!
+    WINTERFACE="$(dbus-send --system --print-reply --dest=org.wicd.daemon \
+    /org/wicd/daemon org.wicd.daemon.GetWirelessInterface | tail -n1 | \
+    sed 's@\s*string "\(.*\)"@\1@')"
+    WIRELESS="no"
+    if [ x"$INTERFACE" = x"$WINTERFACE" ]; then
+        WIRELESS="yes"
+    fi
+    # Fall back on eth0 if we aren't connected.
+    if [ x"$INTERFACE" = x ]; then
+        INTERFACE="eth0"
+    fi
+
+    # Here we remember the previous rx/tx counts
+    RXB=${RXB:-`cat /sys/class/net/${INTERFACE}/statistics/rx_bytes`}
+    TXB=${TXB:-`cat /sys/class/net/${INTERFACE}/statistics/tx_bytes`}
+
+    # get new rx/tx counts
+    RXBN=`cat /sys/class/net/${INTERFACE}/statistics/rx_bytes`
+    TXBN=`cat /sys/class/net/${INTERFACE}/statistics/tx_bytes`
+
+    # calculate the rates
+    # format the values to 4 digit fields
+    RXR=$(echo "$RXBN - $RXB" | bc)
+    if [ $RXR -gt 1024 ] ; then
+        RXR=$(printf "%4d\n" $(echo "$RXR / 1024/${SLEEP}" | bc))
+        RXRATE="kB/s"
+    else
+        RXR=$(printf "%4d\n" $(echo "$RXR / ${SLEEP}" | bc))
+        RXRATE="B/s"
+    fi
+
+    TXR=$(echo "$TXBN - $TXB" | bc)
+    if [ $TXR -gt 1024 ] ; then
+        TXR=$(printf "%4d\n" $(echo "$TXR / 1024/${SLEEP}" | bc))
+        TXRATE="kB/s"
+    else
+        TXR=$(printf "%4d\n" $(echo "$TXR / ${SLEEP}" | bc))
+        TXRATE="B/s"
+    fi
+
+    OWN_IP=$(/sbin/ifconfig $INTERFACE |
+           sed -ne '/inet addr/ s/.*addr:\([^ ]*\).*/\1/p')
+    ROUTER=$(/sbin/route -n | awk '$1 ~ /0.0.0.0/ {print $2}')
+
+    if [ x"$WIRELESS" = x"yes" ]; then
+        SIGNAL=$(dbus-send --system --print-reply --dest=org.wicd.daemon \
+        /org/wicd/daemon/wireless org.wicd.daemon.wireless.GetCurrentSignalStrength \
+        | tail -n1 | sed 's@\s*int32 \(.*\)@\1@')
+        SIGNALMETER=`echo $SIGNAL | gdbar -s v -h 15 -ss 1 -sh 2 -sw 12 -fg $BFG \
+                -bg $BBG -nonl`
+        DETAILS=$(/usr/sbin/iwconfig $INTERFACE | awk '
+        /^'$INTERFACE'/ {print gensub(":", ": ", 1, $4)}
+        /Mode/ {print "Access Point: " $6}
+            /Bit Rate/ {print "Bit Rate: " gensub(".*=(.*)", "\\1 MB/s", 1, $2)}')
+    else
+            # Can we re-purpose these for more helpful stuff for wired displays?
+            SIGNAL=""
+            SIGNALMETER=""
+            DETAILS=""
+    fi
+
+    # print out the rates with some nice formatting
+    echo -n "^tw()${INTERFACE}: \
+        ^fg(#80AA83)${RXR}${RXRATE}^p(3)^i(${ICONPATH}/arr_down.xbm)\
+        ^fg(orange)${TXR}${TXRATE}^i(${ICONPATH}/arr_up.xbm)^fg() $SIGNALMETER
+        ^cs()
+        IP: $OWN_IP
+        Router: $ROUTER
+        $DETAILS"
+    echo " *********** "
+    # reset old rates
+   # RXB=$RXBN; TXB=$TXBN
+}
 while :; do
-    getCpuload
-    getTemp
+    getCpuLoad
+    getCpuTemp
     getMem
     getFs
     getNet
-    #getWeather
-    #getMail
     getVolume
     getBattery
-    #getMpd
 
     echo ''
 

File wm/config.h

View file
  • Ignore whitespace
 
 
 /* appearance */
-#define BOTTOM_BAR_HEIGHT 13.5
+#define BOTTOM_BAR_HEIGHT 15
 
-static const char font[]            = "-*-monaco-medium-r-*-*-16-*-*-*-*-*-*-*";
+static const char font[]            = "-*-Monaco-medium-r-*-*-11-*-*-*-*-*-*-*";
 static const char normbordercolor[] = "#444444";
 static const char normbgcolor[]     = "#262626";
 static const char normfgcolor[]     = "#bbbbbb";
 
 
 /* tagging */
-static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
+static const char *tags[] = { "1", "2", "Stuff", "Mail", "IRC", "XMPP", "ToDoList", "Web2", "Web1" };
 
 static const Rule rules[] = {
 	/* class      instance    title       tags mask     isfloating   monitor */
 //shortkeys
 //static const char *termcmd[]  = { "gnome-terminal", "--hide-menubar", NULL};
 static const char *termcmd[]  = { "terminator", NULL};
+//static const char *randmusic[] = {"mp3blaster", "-p", "allrandom", "~/Music/*.mp3", NULL }
 //static const char *browsercmd[] = { "firefox", NULL };
 //static const char *pidgincmd[] = { "pidgin", NULL};
 //static const char *thunderbirdcmd[] = {"thunderbird", NULL};
     { MODKEY,                       XK_i,      incnmaster,      {.i = +1 } },
     { MODKEY,                       XK_d,      incnmaster,      {.i = -1 } },
     { MODKEY,                       XK_h,      setmfact,        {.f = -0.05} },
-    { MODKEY,                       XK_l,      setmfact,        {.f = +0.05} },
+//{ MODKEY,                       XK_l,      setmfact,        {.f = +0.05} },
     { MODKEY,                       XK_Return, zoom,            {0} },
     { MODKEY,                       XK_Tab,    view,            {0} },
     { MODKEY,                       XK_c,      killclient,      {0} },