-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathdemo.sh
executable file
·69 lines (58 loc) · 2.43 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
#!/bin/sh
#
# Examples
#
# - 256 colors
# - 16 colors
# - 256 colors compact
# - 16 colors compact
# - 256 colors with flag
# - 16 colors with flag
# - 256 colors compact with flag
# - 16 colors compact with flag
#
# Powerline theme settings.
#export TMUX_POWERLINE_COMPACT_CURRENT="on"
#export TMUX_POWERLINE_COMPACT_OTHER="on"
#export TMUX_POWERLINE_FLAG="on"
# Path to Powerline theme.
target="$HOME/.tmux/plugins/tmux-powerline-theme/powerline-theme.tmux"
# Set static information. Restored at end of script.
sessionwindowpane="0:2:1"
hostname="esko.bar"
date="Mar 04 Fri"
time="04:20"
sed -i.bak "s/^\(tmux set-window-option -g status-right.*\)#S:#I:#P/\1${sessionwindowpane}/" "$target"
sed -i.bak "s/^\(tmux set-window-option -g status-right.*\)#H/\1${hostname}/" "$target"
sed -i.bak "s/^\(tmux set-window-option -g status-right.*\)%b %d %a/\1${date}/" "$target"
sed -i.bak "s/^\(tmux set-window-option -g status-right.*\)%H:%M/\1${time}/" "$target"
# Open windows.
tmux new-session -d -s "Demo" -n "Normal" "$SHELL"
tmux set-option -t Demo base-index 1
tmux new-window -t Demo:2 -n "Current" "$EDITOR ; $SHELL"
tmux new-window -t Demo:3 -n "Last" "$SHELL"
tmux new-window -t Demo:4 -n "Activity/Silence" "tmux set-window-option -t Demo:4 monitor-silence 1 && $SHELL"
tmux new-window -t Demo:5 -n "Bell" "sleep 1 && echo && $SHELL"
tmux new-window -t Demo:6 -n "Content" "tmux set-window-option -t Demo:6 monitor-content 'Content!' && sleep 1 && echo 'Content!' && $SHELL"
#tmux new-window -t Demo -n "~/Projects"
#tmux new-window -t Demo -n "vim .tmux.conf"
#tmux new-window -t Demo -n "CMUS"
#tmux new-window -t Demo -n "top"
#tmux new-window -t Demo -n "WeeChat" "sleep 1 && echo && $SHELL"
#tmux new-window -t Demo -n ""
#tmux new-window -t Demo -n "" "tmux set-window-option -t Demo:13 monitor-silence 1 && $SHELL"
#tmux new-window -t Demo -n ""
#tmux new-window -t Demo -n ""
tmux select-window -t Demo:3
tmux select-window -t Demo:2
# Reload Powerline theme.
source "$target"
# Restore configuration.
sed -i.bak "s/^\(tmux set-window-option -g status-right.*\)${sessionwindowpane}/\1#S:#I:#P/" "$target"
sed -i.bak "s/^\(tmux set-window-option -g status-right.*\)${hostname}/\1#H/" "$target"
sed -i.bak "s/^\(tmux set-window-option -g status-right.*\)${date}/\1%b %d %a/" "$target"
sed -i.bak "s/^\(tmux set-window-option -g status-right.*\)${time}/\1%H:%M/" "$target"
# Delete Sed's backup file.
rm "${target}.bak"
# Show everything.
tmux attach -t Demo