> What external commands are in your status-{left,right}?

set-option -g status-left 
"#[default,bold]#(tmux-mail)#[default,dim]#(tmux-date)#[default,bold]#(tmux-bat)"
set-option -g status-right "#100T #(tmux-disk)#(tmux-wifi)#(tmux-mpc)"

I've attached the scripts below, but I haven't changed anything with regards
to either the .conf file or the scripts themselves since July 28 as well.


tmux-mail:
#!/bin/sh

if [[ $HOSTNAME == "trillap" ]]; then
        exit
fi

STATUS=$(notmuch count tag:inbox and tag:unread and not tag:new)
echo "$STATUS"

--

tmux-date:

#!/bin/sh

date=$(date +%-l%M%a%-d)
date="${date/Sun/u}"
date="${date/Mon/m}"
date="${date/Tue/t}"
date="${date/Wed/w}"
date="${date/Thu/r}"
date="${date/Fri/f}"
date="${date/Sat/s}"

if [[ $1 == "-notmux" ]]; then
  echo "$date"
  exit;
fi

if [[ $(grep -c -e today /home/peterjh/.when.today) -gt 0 ]]; then
  echo "#[fg=red]$date#[default]"
  exit
fi

if [[ $(grep -c -e tomorrow /home/peterjh/.when.today) -gt 0 ]]; then
  echo "#[fg=yellow]$date#[default]"
  exit
fi

echo "#[fg=white]$date#[default]"

--

tmux-bat:

#!/bin/sh
TMUX="tmux -Lmain"
BAT=`yacpi -p -b`
PERCENT=`echo $BAT | awk '{print $4}' | sed 's/\%//' | sed 's/100/99/'`
STATUS=`echo $BAT | awk '{print $5}'`
RTIME=`echo $BAT | awk '{print $7}' | cut -c 2-5 | sed 's/://'`

if [[ $1 == "-notmux" ]]; then
  echo ${PERCENT}
  exit
fi

case $STATUS in
"charged")
  echo ""
  ;;
"charging")
  if [[ ${PERCENT:0:2} -lt 20 ]]; then
    echo "#[fg=red]${PERCENT}+#[default]"
  else
    echo "#[fg=white]$PERCENT#[default]"
  fi
  ;;
*)
  if [[ ${PERCENT:0:2} -lt 20 ]]; then
    echo "#[fg=red]${PERCENT}-#[default]"
  else
    echo "#[fg=yellow]${PERCENT}#[default]"
  fi
  ;;
esac

--

tmux-disk:

#!/bin/sh
var=$(df /dev/root | tail -n1| awk -F ' ' '{print $5}' | sed 's/%//')
if [[ $var -gt 95 ]]; then
  echo "#[fg=red]$var#[default]"
fi

--

tmux-wifi:
#!/bin/sh
. ~/.bash_functions
iwconfig=$(/sbin/iwconfig ${WLAN} 2>/dev/null)

if [[ $iwconfig != "" ]]; then
        bitrate=$(echo "$iwconfig" | grep "Bit Rate=" | cut -d'=' -f2 | cut -d' 
' -f1)
        [ -z "$bitrate" ] && bitrate="0"
        quality=$(echo "$iwconfig" | grep "Link Quality=" | cut -d'=' -f2 | cut 
-d'/' -f1 | sed 's/100/00/' )
        wstat=$(sudo wpa_cli -i${WLAN} stat 2>/dev/null)
        ip=$(echo "$wstat" | grep ^ip_address | cut -d'=' -f2)
        stat=$(echo "$wstat" | grep ^wpa_state | cut -d'=' -f2)
        ap=$(echo "$wstat" | grep ^ssid | cut -d'=' -f2 | cut -c 1-3)
        if [[ $ip != "" ]]; then
                ipsign="+"
        else
                ipsign="-"
        fi
        if [[ $stat == "COMPLETED" ]]; then
                statsign="C"
        elif [[ $stat == "SCANNING" ]]; then
                statsign="S"
        elif [[ $stat == "DISCONNECTED" ]]; then
                statsign="D"
        elif [[ $stat == "ASSOCIATING" ]]; then
                statsign="A"
        else
                statsign=$stat
        fi

        echo "${statsign}${bitrate}${ipsign}${quality}${ap}"
else
        wifi_disabled=1
        echo "*"
fi

--
tmux-mpc:
#!/bin/sh
mpc | head -1 | sed 's/.*-.//' | sed 's/^volume:.*//' | cut -c 1-20


-- 
sic dicit magister P
Collaborative Programme in Ancient and Medieval Philosophy
University of Toronto
http://individual.utoronto.ca/peterjh

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to