Advertising

Welcome to SparkyLinux forums
Zapraszamy również na polsko-języczne Forum Linuxiarze.pl

Author Topic: dwm statusbar  (Read 3681 times)

Offline 0day

  • Jr. Member
  • **
  • Posts: 53
  • Karma: 0
dwm statusbar
« on: April 14, 2015, 09:59:30 pm »
how to for add wifi in dwm status bar?
This is my start script:

#!/bin/bash

#start dwm

# Show memory use, volume %, battery % and time in status bar
while xsetroot -name "RAM:$(free -m | awk '/cache:/ { print $3"MB" }')  Vol:$(amixer get Master | tail -1 | awk '{ print $5 }' | tr -d '[]')  Batt:$(acpi | awk '{ print $4 }' | tr -d ',')  $(date '+%e %b %Y %a %k:%M')"
    do
        sleep 1
    done &

synclient VertEdgeScroll=1 &

exec dwm

Offline 0day

  • Jr. Member
  • **
  • Posts: 53
  • Karma: 0
Re: dwm statusbar
« Reply #1 on: April 14, 2015, 10:26:48 pm »
try...

#!/bin/bash

#start 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'`"
      echo " $ESSID:$LINK"
      fi
    }

# Show memory use, volume %, battery %, wifi status and time in status bar
while xsetroot -name "`wifi` RAM:$(free -m | awk '/cache:/ { print $3"MB" }')  Vol:$(amixer get Master | tail -1 | awk '{ print $5 }' | tr -d '[]')  Batt:$(acpi | awk '{ print $4 }' | tr -d ',')  $(date '+%e %b %Y %a %k:%M')"
    do
        sleep 1
    done &

synclient VertEdgeScroll=1 &

exec dwm