From 4d25774a61297c21a5f99a72e2fd03435a4ea65b Mon Sep 17 00:00:00 2001 From: Ansel Santosa Date: Thu, 22 Jun 2017 09:02:00 -0700 Subject: [PATCH] Split library into separate script * Allows library to be updated by git independently of presentations * Makes presentation files more clean --- README.md | 5 +++-- presentations/example-presentation.sh | 26 ++++++++++++++++++++++++ presentation.sh => scripted-presenter.sh | 18 ---------------- 3 files changed, 29 insertions(+), 20 deletions(-) create mode 100755 presentations/example-presentation.sh rename presentation.sh => scripted-presenter.sh (82%) diff --git a/README.md b/README.md index 7650bb4..490d373 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,9 @@ Stop copying and pasting commands during presentations. Use this template. ## How to Use * Clone this repo -* Modify the examples in `presentation.sh` to suit your needs -* Run `./presentation.sh` from outside tmux +* Read comments in `scripted-presenter.sh` to understand the options +* Copy `presentations/example-presentation.sh` and modify it to suit your needs +* Run your presentation from outside tmux * Press enter to advance to next command ## How to Contribute diff --git a/presentations/example-presentation.sh b/presentations/example-presentation.sh new file mode 100755 index 0000000..ca4b3fa --- /dev/null +++ b/presentations/example-presentation.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +source "$DIR/../scripted-presenter.sh" + +################################################################################ +# copy this file and modify the section below for each presentation +################################################################################ + +prompt "This is the first step, no need to wait here" +run echo "Hello World" + +wait_and_prompt "First command done, moving on to the second one" +run echo "Example command number two" + +wait_and_prompt "Let's start a ping down below..." +run_below "-l 10" "ping localhost" + +wait_and_prompt "Now open a ping in a new window, but don't show that window" +run_background "win-name" "ping localhost" + +wait_and_prompt "Finally, run a ping next to this" +run_beside "-p 30" "ping localhost" + +wait_and_prompt "Pressing enter one more time will kill the whole demo" +terminate diff --git a/presentation.sh b/scripted-presenter.sh similarity index 82% rename from presentation.sh rename to scripted-presenter.sh index e40128a..c1ee11f 100755 --- a/presentation.sh +++ b/scripted-presenter.sh @@ -91,21 +91,3 @@ function focus_last() { function terminate() { tmux kill-session -t "${session}" } - -prompt "This is the first step, no need to wait here" -run echo "Hello World" - -wait_and_prompt "First command done, moving on to the second one" -run echo "Example command number two" - -wait_and_prompt "Let's start a ping down below..." -run_below "-l 10" "ping localhost" - -wait_and_prompt "Now open a ping in a new window, but don't show that window" -run_background "win-name" "ping localhost" - -wait_and_prompt "Finally, run a ping next to this" -run_beside "-p 30" "ping localhost" - -wait_and_prompt "Pressing enter one more time will kill the whole demo" -terminate