-
Notifications
You must be signed in to change notification settings - Fork 4
/
demo.sh
executable file
·75 lines (61 loc) · 1.11 KB
/
demo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# This script sends predefined input to another tmux session
# To showcase usage of application
# Before running script you need to start a tmux session:
# tmux new -s spacedisplay-demo
#
# To convert recorded mp4 its best to use gifski:
# ffmpeg -i spacedisplay.mp4 frame%04d.png
# gifski -o demo.gif -Q 20 frame*.png
#disable status bar
tmux set -g status off
# Ctrl+L
# Useful aliases for sending keys
shopt -s expand_aliases
alias tsend="tmux send-keys -t spacedisplay-demo.0"
alias tsendd="sleep 0.5 && tmux send-keys -t spacedisplay-demo.0"
# Clear screen
tsend C-l
# Run app
tsend "cargo r --release" Enter
sleep 3
# Start new scan
tsendd "n"
tsendd Enter
# Show statistics while scanning
tsendd "s"
sleep 5
# Close statistics
tsend "s"
# Navigate tree
tsendd Down
tsendd Down
tsendd Up
tsendd Up
tsendd Up
tsendd Enter
tsendd Enter
tsendd Down
tsendd Down
sleep 0.5
tsendd Left
tsendd Enter
sleep 0.5
tsendd Left
tsendd Left
sleep 1
# Show delete dialog
tsendd "d"
sleep 0.5
# Cancel deletion
tsendd "n"
sleep 0.5
# Rescan
tsendd "r"
# Show Stats
tsendd "s"
sleep 4
tsendd "s"
# Quit app
sleep 5
tsend "q"