summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Nebl <hello@mario-nebl.de>2018-01-26 12:43:06 +0100
committerDavid Peter <sharkdp@users.noreply.github.com>2018-01-28 12:59:27 +0100
commit33791d8400edba47831517cab72835d6279fa37c (patch)
tree66988839d14f2bd4cd4be4b56cba4f60c05ff717
parent4e737b4b44a14d114dde80d252bdbeb0cc37c67f (diff)
Use ▶ prompt
-rw-r--r--screencast.sh31
1 files changed, 21 insertions, 10 deletions
diff --git a/screencast.sh b/screencast.sh
index 819827c..490046c 100644
--- a/screencast.sh
+++ b/screencast.sh
@@ -1,20 +1,31 @@
#!/bin/sh
set -e
-type() {
- printf '\e[32m%s\e[m' "λ "
- echo $1 | pv -qL $[10+(-2 + RANDOM%5)]
- sleep 0.75
+PROMPT="▶ "
+
+enter() {
+ IFS='%'
+ type $PROMPT
+ type $1
+ sleep 0.5
+ type " "
+ sleep 0.25
+ type "\n"
eval $1
- echo ""
+ type "\n"
+ unset IFS
+}
+
+type() {
+ printf '%b' $1 | pv -qL $[10+(-2 + RANDOM%5)]
}
-type "fd"
+enter "fd"
-type "fd mod"
+enter "fd mod"
-type "fd sh$"
+enter "fd sh"
-type "fd -H sample"
+enter "fd -H sample"
-type "fd -h" \ No newline at end of file
+enter "fd -h" \ No newline at end of file