[download]

local/bin/i3-status

   1 #!/bin/bash
   2 
   3 source dwm-status
   4 
   5 xprop -root -spy | while read; do
   6     n=$(xprop -root _NET_ACTIVE_WINDOW)
   7     s=$(xprop -id ${n:40} _NET_WM_NAME)
   8     echo "title:${s:29:-1}:"
   9 done > $f &
  10 
  11 ################################################################################
  12 
  13 w=$(xrandr | awk '/\*/ { print int($0) / 6 / 2 }')
  14 
  15 while read i; do
  16     status= && update
  17 
  18     title=${mod[title]}
  19     title_len=${#title}
  20     status_len=${#status}
  21     fill=$(( w - status_len + title_len / 2 ))
  22 
  23     printf '%d\t%s\t%s' $fill "$title" "$status" |
  24     awk -F \\t ' { printf "%-"$1"s%s\n", $2, $3 }'
  25 done < $f