Skip to content

Commit d0d7348

Browse files
author
Bruno Sutic
committed
Extract all the variables in one place
1 parent 7d3135b commit d0d7348

File tree

3 files changed

+28
-15
lines changed

3 files changed

+28
-15
lines changed

scripts/save_complete_history.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
44

5-
# Functions defined in capture_pane_helpers are customized via below variables.
6-
default_path="$HOME"
7-
default_name="tmux-history-#{session_name}-#{window_index}-#{pane_index}-%Y%m%dT%H%M%S.log"
8-
9-
path_option="@save-complete-history-path"
10-
name_option="@save-complete-history-filename"
11-
125
source "$CURRENT_DIR/variables.sh"
136
source "$CURRENT_DIR/shared.sh"
147
source "$CURRENT_DIR/capture_pane_helpers.sh"
158

9+
# Functions defined in capture_pane_helpers are customized via below variables.
10+
default_path="$default_save_complete_history_path"
11+
default_name="$default_save_complete_history_filename"
12+
13+
path_option="$save_complete_history_path_option"
14+
name_option="$save_complete_history_filename_option"
15+
1616
main() {
1717
if supported_tmux_version_ok; then
1818
capture_pane "History"

scripts/screen_capture.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
44

5-
# Functions defined in capture_pane_helpers are customized via below variables.
6-
default_path="$HOME"
7-
default_name="tmux-screen-capture-#{session_name}-#{window_index}-#{pane_index}-%Y%m%dT%H%M%S.log"
8-
9-
path_option="@screen-capture-path"
10-
name_option="@screen-capture-filename"
11-
125
source "$CURRENT_DIR/variables.sh"
136
source "$CURRENT_DIR/shared.sh"
147
source "$CURRENT_DIR/capture_pane_helpers.sh"
158

9+
# Functions defined in capture_pane_helpers are customized via below variables.
10+
default_path="$default_screen_capture_path"
11+
default_name="$default_screen_capture_filename"
12+
13+
path_option="$screen_capture_path_option"
14+
name_option="$screen_capture_filename_option"
15+
1616
main() {
1717
if supported_tmux_version_ok; then
1818
capture_pane "Screen capture"

scripts/variables.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,22 @@ clear_history_key_option="@clear-history-key"
1515
default_clear_history_key="M-c" # Alt-c
1616

1717
# Logging options
18-
1918
logging_path_option="@logging-path"
2019
default_logging_path="$HOME"
2120

2221
logging_filename_option="@logging-filename"
2322
default_logging_filename="tmux-#{session_name}-#{window_index}-#{pane_index}-%Y%m%dT%H%M%S.log"
23+
24+
# Screen capture options
25+
screen_capture_path_option="@screen-capture-path"
26+
default_screen_capture_path="$HOME"
27+
28+
screen_capture_filename_option="@screen-capture-filename"
29+
default_screen_capture_filename="tmux-screen-capture-#{session_name}-#{window_index}-#{pane_index}-%Y%m%dT%H%M%S.log"
30+
31+
# Save complete history options
32+
save_complete_history_path_option="@save-complete-history-path"
33+
default_save_complete_history_path="$HOME"
34+
35+
save_complete_history_filename_option="@save-complete-history-filename"
36+
default_save_complete_history_filename="tmux-history-#{session_name}-#{window_index}-#{pane_index}-%Y%m%dT%H%M%S.log"

0 commit comments

Comments
 (0)