Skip to content

Commit cf5715d

Browse files
Dillon Leesbruno-
authored andcommitted
chore: use tabs instead of spaces for formatting
1 parent 9f0cf65 commit cf5715d

File tree

2 files changed

+61
-61
lines changed

2 files changed

+61
-61
lines changed
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
#!/usr/bin/env bash
22

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

55
source "$CURRENT_DIR/../helpers.sh"
66
source "$CURRENT_DIR/../variables.sh"
77

88
template() {
9-
local tmux_start_script="$1"
10-
local is_fullscreen="$2"
9+
local tmux_start_script="$1"
10+
local is_fullscreen="$2"
1111

12-
local fullscreen_tag=""
13-
if [ "$is_fullscreen" == "true" ]; then
14-
# newline and spacing so tag is aligned with other tags in template
15-
fullscreen_tag=$'\n <string>fullscreen</string>'
16-
fi
12+
local fullscreen_tag=""
13+
if [ "$is_fullscreen" == "true" ]; then
14+
# newline and spacing so tag is aligned with other tags in template
15+
fullscreen_tag=$'\n <string>fullscreen</string>'
16+
fi
1717

18-
local content
19-
read -r -d '' content <<- EOF
18+
local content
19+
read -r -d '' content <<-EOF
2020
<?xml version="1.0" encoding="UTF-8"?>
2121
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
2222
<plist version="1.0">
@@ -32,37 +32,37 @@ template() {
3232
</dict>
3333
</plist>
3434
EOF
35-
echo "$content"
35+
echo "$content"
3636
}
3737

3838
get_iterm_or_teminal_option_value() {
39-
local options="$1"
40-
if [[ "$options" =~ "iterm" ]]; then
41-
echo "iterm"
42-
elif [[ "$options" =~ "kitty" ]]; then
43-
echo "kitty"
44-
else
45-
# Terminal.app is the default console app
46-
echo "terminal"
47-
fi
39+
local options="$1"
40+
if [[ "$options" =~ "iterm" ]]; then
41+
echo "iterm"
42+
elif [[ "$options" =~ "kitty" ]]; then
43+
echo "kitty"
44+
else
45+
# Terminal.app is the default console app
46+
echo "terminal"
47+
fi
4848
}
4949

5050
get_fullscreen_option_value() {
51-
local options="$1"
52-
if [[ "$options" =~ "fullscreen" ]]; then
53-
echo "true"
54-
else
55-
echo "false"
56-
fi
51+
local options="$1"
52+
if [[ "$options" =~ "fullscreen" ]]; then
53+
echo "true"
54+
else
55+
echo "false"
56+
fi
5757
}
5858

5959
main() {
60-
local options="$(get_tmux_option "$auto_start_config_option" "$auto_start_config_default")"
61-
local iterm_or_terminal_value="$(get_iterm_or_teminal_option_value "$options")"
62-
local fullscreen_option_value="$(get_fullscreen_option_value "$options")"
63-
local tmux_start_script_path="${CURRENT_DIR}/osx_${iterm_or_terminal_value}_start_tmux.sh"
60+
local options="$(get_tmux_option "$auto_start_config_option" "$auto_start_config_default")"
61+
local iterm_or_terminal_value="$(get_iterm_or_teminal_option_value "$options")"
62+
local fullscreen_option_value="$(get_fullscreen_option_value "$options")"
63+
local tmux_start_script_path="${CURRENT_DIR}/osx_${iterm_or_terminal_value}_start_tmux.sh"
6464

65-
local launchd_plist_file_content="$(template "$tmux_start_script_path" "$fullscreen_option_value")"
66-
echo "$launchd_plist_file_content" > "$osx_auto_start_file_path"
65+
local launchd_plist_file_content="$(template "$tmux_start_script_path" "$fullscreen_option_value")"
66+
echo "$launchd_plist_file_content" > "$osx_auto_start_file_path"
6767
}
6868
main

scripts/handle_tmux_automatic_start/osx_kitty_start_tmux.sh

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,44 @@
44
TRUE_FULL_SCREEN="$1"
55

66
start_terminal_and_run_tmux() {
7-
osascript <<- EOF
7+
osascript <<-EOF
88
tell application "kitty"
99
activate
10-
delay 5
11-
tell application "System Events" to tell process "kitty"
12-
set frontmost to true
13-
keystroke "tmux"
14-
key code 36
15-
end tell
10+
delay 5
11+
tell application "System Events" to tell process "kitty"
12+
set frontmost to true
13+
keystroke "tmux"
14+
key code 36
15+
end tell
1616
end tell
1717
EOF
1818
}
1919

2020
resize_window_to_full_screen() {
21-
osascript <<- EOF
22-
tell application "kitty"
23-
activate
24-
tell application "System Events"
25-
if (every window of process "kitty") is {} then
26-
keystroke "n" using command down
27-
end if
21+
osascript <<-EOF
22+
tell application "kitty"
23+
activate
24+
tell application "System Events"
25+
if (every window of process "kitty") is {} then
26+
keystroke "n" using command down
27+
end if
2828
29-
tell application "Finder"
30-
set desktopSize to bounds of window of desktop
31-
end tell
29+
tell application "Finder"
30+
set desktopSize to bounds of window of desktop
31+
end tell
3232
33-
set position of front window of process "kitty" to {0, 0}
34-
set size of front window of process "kitty" to {item 3 of desktopSize, item 4 of desktopSize}
33+
set position of front window of process "kitty" to {0, 0}
34+
set size of front window of process "kitty" to {item 3 of desktopSize, item 4 of desktopSize}
35+
end tell
3536
end tell
36-
end tell
37-
EOF
37+
EOF
3838
}
3939

4040
resize_to_true_full_screen() {
41-
osascript <<- EOF
41+
osascript <<-EOF
4242
tell application "kitty"
4343
activate
44-
delay 1
44+
delay 1
4545
tell application "System Events" to tell process "kitty"
4646
keystroke "f" using {control down, command down}
4747
end tell
@@ -50,11 +50,11 @@ resize_to_true_full_screen() {
5050
}
5151

5252
main() {
53-
start_terminal_and_run_tmux
54-
if [ "$TRUE_FULL_SCREEN" == "fullscreen" ]; then
55-
resize_to_true_full_screen
56-
else
57-
resize_window_to_full_screen
58-
fi
53+
start_terminal_and_run_tmux
54+
if [ "$TRUE_FULL_SCREEN" == "fullscreen" ]; then
55+
resize_to_true_full_screen
56+
else
57+
resize_window_to_full_screen
58+
fi
5959
}
6060
main

0 commit comments

Comments
 (0)