E 369 B

123456789101112131415161718192021
  1. #!/bin/sh
  2. # run B but then wait for the file to change.
  3. # great to set as $EDITOR.
  4. # the notion of a file changing is a little weak.
  5. filename="$(echo "$1" | cut -d':' -f1)"
  6. stat=$(sha1sum "$filename")
  7. xdotool key super+5
  8. B "$@"
  9. echo editing "$@"
  10. while sleep 1
  11. do
  12. nstat=$(sha1sum "$filename")
  13. if [ "x$stat" != "x$nstat" ]
  14. then
  15. xdotool key super+2
  16. exit
  17. fi
  18. done