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 bottom
  22. RULES=( index=11 )
  23. #spawn_with_rules urxvt -e env DISPLAY=:99 bash -c 'echo -n "hc> "
  24. #                                                   while read line; do
  25. #                                                       herbstclient $line
  26. #                                                       echo -n "hc> "
  27. #                                                   done'
  28. spawn_with_rules urxvt -e env DISPLAY=:99 "$SHELL"
  29.  
  30. # Xephyr
  31. herbstclient rule once maxage=10 class=Xephyr pseudotile=on index=10
  32. Xephyr :99 -screen 800x600 &
  33. xpid=$!
  34.  
  35. # Terminals on the left
  36. RULES=( index=0 )
  37. spawn_with_rules urxvt -e tail -f "$tmpfile"
  38. spawn_with_rules urxvt -e env DISPLAY=:99 gdb /usr/bin/herbstluftwm -ex \
  39.     "set args -c share/autostart --verbose >& $tmpfile"
  40. wait $!
  41. kill "$xpid"
  42.  
  43. rm -f "$tmpfile"