2015-02-17 16:13:21 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
|
|
|
|
source "$CURRENT_DIR/helpers.sh"
|
|
|
|
source "$CURRENT_DIR/variables.sh"
|
|
|
|
|
|
|
|
is_tmux_automatic_start_enabled() {
|
|
|
|
local auto_start_value="$(get_tmux_option "$auto_start_option" "$auto_start_default")"
|
|
|
|
[ "$auto_start_value" == "on" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
is_osx() {
|
|
|
|
[ $(uname) == "Darwin" ]
|
|
|
|
}
|
|
|
|
|
2015-11-23 18:28:38 +00:00
|
|
|
is_systemd() {
|
|
|
|
[ $(ps -o comm= -p1) == 'systemd' ]
|
|
|
|
}
|
|
|
|
|
2015-02-17 16:13:21 +00:00
|
|
|
main() {
|
|
|
|
if is_tmux_automatic_start_enabled; then
|
|
|
|
if is_osx; then
|
2015-02-20 14:48:36 +00:00
|
|
|
"$CURRENT_DIR/handle_tmux_automatic_start/osx_enable.sh"
|
2015-11-23 18:28:38 +00:00
|
|
|
elif is_systemd; then
|
|
|
|
"$CURRENT_DIR/handle_tmux_automatic_start/systemd_enable.sh"
|
2015-02-17 16:13:21 +00:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
if is_osx; then
|
2015-02-20 14:48:36 +00:00
|
|
|
"$CURRENT_DIR/handle_tmux_automatic_start/osx_disable.sh"
|
2015-11-23 18:28:38 +00:00
|
|
|
elif is_systemd; then
|
|
|
|
"$CURRENT_DIR/handle_tmux_automatic_start/systemd_disable.sh"
|
2015-02-17 16:13:21 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
main
|