local/bin/i3-binds

   1 #!/bin/bash
   2 
   3 grep '^bind\|^# \w' ~/.config/i3/config |
   4 sed '$d' | sed '
   5     1d; $d
   6     s/"//g
   7     s/$\?exec//
   8     s/$start //
   9     s/$notify //
  10     s/--release//
  11     s/Mod1+/Alt+/
  12     s/Mod4+/Win+/
  13     s/Super_L/Win/
  14     s/+grave/+`/
  15     s/+space/+Space/
  16     s/+Shift+slash/+?/
  17     s/Sys_Req/Print/
  18     s/+Shift+\(\w\) /+\u\1 /
  19     s/Control+/^+/
  20     s/Shift+/<>+/
  21 ' | while read _ k v; do
  22     [[ $v == \{\{\{ ]] &&
  23     printf '\n\e[1;33m%21s:\e[0m\n' ${k^^} ||
  24     printf '  \e[33m%20s\e[0m %s\n' $k "$v"
  25 done | less -r