fd/screencast.sh

50 lines
475 B
Bash
Raw Normal View History

2018-01-20 20:47:29 +01:00
#!/bin/sh
set -e
PROMPT="▶"
2018-01-26 12:43:06 +01:00
enter() {
prompt
2018-01-26 12:43:06 +01:00
type $1
sleep 0.5
2018-01-26 12:50:49 +01:00
printf '%b' " ⏎\n"
2018-01-20 20:47:29 +01:00
eval $1
2018-01-26 12:43:06 +01:00
type "\n"
}
prompt() {
printf $PROMPT
type " "
2018-01-26 12:43:06 +01:00
}
type() {
printf '%b' $1 | pv -qL $[10+(-2 + RANDOM%5)]
2018-01-20 20:47:29 +01:00
}
main() {
IFS='%'
enter "fd"
enter "fd -e md"
2018-01-20 20:47:29 +01:00
enter "fd -e md --exec wc -l"
2018-01-26 12:50:49 +01:00
enter "fd mod"
2018-01-26 12:50:49 +01:00
enter "fd sh"
2018-01-20 20:47:29 +01:00
enter "fd -H sample"
2018-01-20 20:47:29 +01:00
enter "fd -h"
prompt
sleep 3
unset IFS
echo ""
}
2018-01-20 20:47:29 +01:00
main