Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- IP="/home/zeus/.xmonad/icons/thayer"
- FONT="-*montecarlo-medium-r-normal-*-11-*-*-*-*-*-*"
- DZEN_BG="#161616"
- DZEN_FG="#9d9d9d"
- DZEN_FG2="#444444"
- DZEN_W="600"
- DZEN_H="16"
- DZEN_X="766"
- DZEN_Y="0"
- GFX_FG="#04c656"
- #0087cb
- GFX_BG="#363636"
- CRIT="#FF6600"
- GFX_H="9"
- GFX_W="65"
- INTERVAL="1"
- printBattery()
- {
- BatPresent=$(acpi -b | wc -l)
- ACPresent=$(acpi -a | grep -c on-line)
- if [[ $BatPresent == "0" ]]; then
- echo -n "^fg($DZEN_FG2)AC ^fg($GFX_FG)on ^fg($DZEN_FG2)BAT ^fg($GFX_FG)off"
- return
- else
- RPERC=$(acpi -b | awk '{print $4}' | tr -d "%,")
- echo -n " ^fg($DZEN_FG2)^i($IP/../bat_full_01.xbm) "
- if [[ $ACPresent == "1" ]]; then
- echo -n "$(echo $RPERC | gdbar -fg $GFX_FG -bg $GFX_BG -h $GFX_H -w $GFX_W -s o -ss 1 -sw 2 -nonl)"
- else
- echo -n "$(echo $RPERC | gdbar -fg $CRIT -bg $GFX_BG -h $GFX_H -w $GFX_W -s o -ss 1 -sw 2 -nonl)"
- fi
- echo -n " ^fg()$RPERC% "
- fi
- return
- }
- printVolume()
- {
- Perc=$(amixer get Master | grep "Mono:" | awk '{print $4}' | tr -d '[]%')
- Mute=$(amixer get Master | grep "Mono:" | awk '{print $6}')
- echo -n " ^fg($DZEN_FG2)^i($IP/../spkr_01.xbm) "
- if [[ $Mute == "[off]" ]]; then
- echo -n "$(echo $Perc | gdbar -fg $CRIT -bg $GFX_BG -h $GFX_H -w $GFX_W -s o -ss 1 -sw 2 -nonl) "
- echo -n "^fg()off"
- else
- echo -n "$(echo $Perc | gdbar -fg $GFX_FG -bg $GFX_BG -h $GFX_H -w $GFX_W -s o -ss 1 -sw 2 -nonl) "
- echo -n "^fg()${Perc}% "
- fi
- return
- }
- printWifi()
- {
- WIFIDOWN=$(wicd-cli --wireless -d | wc -l)
- WIFISIGNAL=0
- echo -n "^fg($DZEN_FG2)^i($IP/../wifi_01.xbm) "
- if [[ $WIFIDOWN -ne "1" ]]; then
- WIFISIGNAL=$(wicd-cli --wireless -d | grep Quality | awk '{print $2}')
- echo -n "$(echo $WIFISIGNAL | gdbar -fg $GFX_FG -bg $GFX_BG -h $GFX_H -w $GFX_W -s o -ss 1 -sw 2 -nonl) "
- echo -n "^fg()$WIFISIGNAL% "
- else
- echo -n "^fg($CRIT)N/A "
- fi
- return
- }
- printTime() {
- echo -n " ^fg()$(date '+^fg()%A %d/%m ^fg(#44ddff)%H:%M') "
- return
- }
- printSep()
- {
- echo -n "^fg($DZEN_FG2)|"
- return
- }
- #spkr_01.xbm
- printBar()
- {
- while true; do
- printWifi
- printSep
- printBattery
- printSep
- printVolume
- printSep
- printTime
- echo
- sleep $INTERVAL
- done
- return
- }
- printBar | dzen2 -x $DZEN_X -y $DZEN_Y -w $DZEN_W -h $DZEN_H -fn $FONT -ta 'r' -bg $DZEN_BG -fg $DZEN_FG -p -e ''
Advertisement
Add Comment
Please, Sign In to add comment