unreadable (scrot, raw, dl)
Neuromatic Aug 03, 2013 (info/dzen2)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | #!/bin/env bash
function statusbar {
function desk() {
DESKTOP=$(xprop -root _NET_CURRENT_DESKTOP | awk '{print $3}')
case $DESKTOP in
0) echo "main"
;;
1) echo "www"
;;
2) echo "irc"
;;
3) echo "foo"
;;
4) echo "bar"
;;
*) echo "error"
esac
}
function clock() {
time=$(date "+%e.%m %R")
echo $time
}
function link() {
AP=$(iwconfig wlp3s3 | grep "Quality" | awk '/Quality/ {print $2}' | sed 's/Quality//g;s/=//g;s/\///g;s/100//g')
echo $AP
}
function mem() {
free=$(free -m | grep Mem: | awk '{print $3}')
echo $free
}
function temp() {
tem=$(acpi -t | awk '{print $4}')
echo $tem
}
function sda() {
dfh=$(dfc | grep "/dev/sda1" | awk '{print $3}')
echo $dfh
}
function vol() {
ami="$(amixer get Master | awk '/Front Left:/ {print $5}' | tr -d "[]")"
echo $ami
}
function ncc() {
mus=$(mpc current)
echo $mus
}
echo "^fg(#8A2F58):bspwm = _"$(desk)"_ ^fg(#AAAAAA) (^fg(#287373) :gen^fg(#AAAAAA) ((^fg(#914E89):mem $(mem)M^fg(#98CBFE) :sda $(sda) ^fg(#AAAAAA))(^fg(#2B7694):link{$(link)%}^fg(#AAAAAA) (^fg(#5E468C)temp: $(temp)°C^fg(#AAAAAA) ))^fg(#E5B0FF)(load $(ncc)) (^fg(#395573) :sy^fg(#AAAAAA)(^fg(#CF4F88)^fg(AAAAAA) )^fg(#47959E)[setf *alsa*] :vol $(vol)^fg(#AAAAAA) ))(^fg(#FFFFFF)cons '$(clock)')^fg(#AAAAAA))"
}
while true
do
echo "$(statusbar)"
sleep 0.5
done | dzen2 -bg '#000000' -fn '-*-terminus-medium-r-*-*-13-*-*-*-*-*-*-*' -tw 1160 -x 240 -ta r -p &
|
x
Notes
This is based on milomouse’s bar. Visit him at github.