From The Compiler, 6 Years ago, written in Bash.
Embed
  1. tmpfile=$(mktemp)
  2. trap "rm -f $tmpfile" TERM INT
  3.  
  4. spawn_with_rules() {(
  5.     # this rule also requires, that the client
  6.     # sets the _NET_WM_PID property
  7.     herbstclient rule once pid=$BASHPID maxage=10 "${RULES[@]}"
  8.     exec "$@"
  9.     ) &
  10. }
  11.  
  12. cd ~/dev/herbstluftwm/git
  13. herbstclient load '(split horizontal:0.400000:0
  14.                       (clients vertical:0)
  15.                       (split vertical:0.850000:0
  16.                           (clients grid:0)
  17.                           (clients grid:0)
  18.                       )
  19.                    )'
  20.  
  21. # Terminals on the left
  22. RULES=( index=0 )
  23. spawn_with_rules urxvt -e env DISPLAY=:99 gdb /usr/bin/herbstluftwm -ex \
  24.     "set args -c share/autostart --verbose >& $tmpfile"
  25. spawn_with_rules urxvt -e tail -f "$tmpfile"
  26.  
  27. # Terminals on bottom
  28. RULES=( index=11 )
  29. spawn_with_rules urxvt -e env DISPLAY=:99 bash -c 'echo -n "hc> "
  30.                                                   while read line; do
  31.                                                       herbstclient $line
  32.                                                       echo -n "hc> "
  33.                                                   done'
  34. spawn_with_rules urxvt -e env DISPLAY=:99 "$SHELL"
  35.  
  36. # Xephyr
  37. herbstclient rule once maxage=10 class=Xephyr pseudotile=on index=10
  38. Xephyr :99 -screen 800x600 -terminate
  39.  
  40. rm -f "$tmpfile"
  41.