[download]

local/bin/awesome-status

   1 #!/bin/bash
   2 
   3 export ICON_FIX=1
   4 source dwm-status
   5 source ~/.theme/sh
   6 
   7 tail -F ~/.cache/volume{,.ico} | while read; do
   8     awk -v i="$(icon mixer)" '{ # {{{
   9         n = 20
  10         a = int($1 * n / 100)
  11         b = int(n - a)
  12 
  13         printf "volumebar:%s %%{T3}", i
  14 
  15         if (i == "婢")
  16             printf "%%{F'$black2'}"
  17 
  18         for (i = 0; i < a; i++)
  19             printf "%s", "•"
  20 
  21         printf "|"
  22 
  23         if (i != "婢")
  24             printf "%%{F'$black2'}"
  25 
  26         for (i = 0; i < b; i++)
  27             printf "%s", "•"
  28 
  29         printf "%%{F-}"
  30         printf "%%{T-}:\n"
  31     }' ~/.cache/volume # }}}
  32 done > $f &
  33 
  34 return 2>&-
  35 
  36 ################################################################################
  37 
  38 bw=$(awk -F '[ =;]+' '/wibar_width\s*=/  { print $2 }' ~/.config/awesome/rc.lua)
  39 bh=$(awk -F '[ =;]+' '/wibar_height\s*=/ { print $2 }' ~/.config/awesome/rc.lua)
  40 w=$(xrandr | awk -v n=$bw '/\*/ { print int(int($0) * (1 - n)) }')
  41 x=$(xrandr | awk -v n=$bw '/\*/ { print int(int($0) * n) }')
  42 
  43 while read i; do
  44     [[ $i == volume:*: ]] && continue
  45     mod[volume]=${mod[volumebar]}
  46 
  47     status= && update
  48     echo "%{r}$status"
  49 done < $f |
  50 lemonbar -g ${w}x${bh}+${x}+0 -B '#00000000' -F $foreground \
  51 -f Terminus-9 -f Nerdfont-9 -f Ubuntu-8:antialias=false