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
55source " $CURRENT_DIR /../helpers.sh"
66source " $CURRENT_DIR /../variables.sh"
77
88template () {
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,35 +32,37 @@ template() {
3232 </dict>
3333 </plist>
3434 EOF
35- echo " $content "
35+ echo " $content "
3636}
3737
3838get_iterm_or_teminal_option_value () {
39- local options=" $1 "
40- if [[ " $options " =~ " iterm" ]]; then
41- echo " iterm"
42- else
43- # Terminal.app is the default console app
44- echo " terminal"
45- 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
4648}
4749
4850get_fullscreen_option_value () {
49- local options=" $1 "
50- if [[ " $options " =~ " fullscreen" ]]; then
51- echo " true"
52- else
53- echo " false"
54- fi
51+ local options=" $1 "
52+ if [[ " $options " =~ " fullscreen" ]]; then
53+ echo " true"
54+ else
55+ echo " false"
56+ fi
5557}
5658
5759main () {
58- local options=" $( get_tmux_option " $auto_start_config_option " " $auto_start_config_default " ) "
59- local iterm_or_terminal_value=" $( get_iterm_or_teminal_option_value " $options " ) "
60- local fullscreen_option_value=" $( get_fullscreen_option_value " $options " ) "
61- 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"
6264
63- local launchd_plist_file_content=" $( template " $tmux_start_script_path " " $fullscreen_option_value " ) "
64- 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 "
6567}
6668main
0 commit comments