[download]

config/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 bh=$(awk '/\s*height\s*[0-9]+/ { print $NF }' ~/.config/i3/config)
  15 
  16 echo "Dmenu.height: ${bh:-18}" | xrdb -m
  17 
  18 while read i; do
  19     update
  20 
  21     title=${mod[title]}
  22     title_len=${#title}
  23     status_len=${#status}
  24     fill=$(( w - status_len + title_len / 2 ))
  25 
  26     printf '%d\t%s\t%s' $fill "$title" "$status" |
  27     awk -F \\t ' { printf "%-"$1"s%s\n", $2, $3 }'
  28 done < $f