Skip to content
Open
3 changes: 3 additions & 0 deletions docs/automatic_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Config options:
- `set -g @continuum-boot-options 'alacritty'` - start [alacritty](https://github.com/alacritty/alacritty) instead of `Terminal.app`
- `set -g @continuum-boot-options 'alacritty,fullscreen'` - start `alacritty`
in fullscreen
- `set -g @continuum-boot-options 'warp'` - start [warp](https://github.com/warpdotdev/Warp) instead of `Terminal.app`
- `set -g @continuum-boot-options 'warp,fullscreen'` - start `warp`
in fullscreen

Note: The first time you reboot your machine and activate this feature you may be prompted about a script requiring
access to a system program (i.e. - System Events). If this happens tmux will not start automatically and you will need
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ start_terminal_and_run_tmux() {
osascript <<-EOF
tell application "alacritty"
activate
delay 0.5
delay 1
tell application "System Events" to tell process "alacritty"
set frontmost to true
keystroke "tmux"
Expand Down Expand Up @@ -40,8 +40,11 @@ resize_window_to_full_screen() {
resize_to_true_full_screen() {
osascript <<-EOF
tell application "Alacritty"
# wait for alacritty to start
delay 1
activate
delay 0.5
# short wait for alacritty to gain focus
delay 0.1
tell application "System Events" to tell process "Alacritty"
if front window exists then
tell front window
Expand Down
2 changes: 2 additions & 0 deletions scripts/handle_tmux_automatic_start/osx_enable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ get_strategy() {
echo "kitty"
elif [[ "$options" =~ "alacritty" ]]; then
echo "alacritty"
elif [[ "$options" =~ "warp" ]]; then
echo "warp"
else
# Terminal.app is the default console app
echo "terminal"
Expand Down
7 changes: 5 additions & 2 deletions scripts/handle_tmux_automatic_start/osx_kitty_start_tmux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ start_terminal_and_run_tmux() {
osascript <<-EOF
tell application "kitty"
activate
delay 5
delay 1
tell application "System Events" to tell process "kitty"
set frontmost to true
keystroke "tmux"
Expand Down Expand Up @@ -40,8 +40,11 @@ resize_window_to_full_screen() {
resize_to_true_full_screen() {
osascript <<-EOF
tell application "kitty"
activate
# wait for kitty to start
delay 1
activate
# short wait for kitty to gain focus
delay 0.1
tell application "System Events" to tell process "kitty"
keystroke "f" using {control down, command down}
end tell
Expand Down
65 changes: 65 additions & 0 deletions scripts/handle_tmux_automatic_start/osx_warp_start_tmux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Maintainer: Dimitar Nizamov @dimitur2204
# Contact maintainer for any change to this file.
#!/usr/bin/env bash

# for "true full screen" call the script with "fullscreen" as the first argument
TRUE_FULL_SCREEN="$1"

start_terminal_and_run_tmux() {
osascript <<-EOF
tell application "Warp"
activate
delay 1
tell application "System Events" to tell process "Warp"
set frontmost to true
keystroke "tmux"
key code 36
end tell
end tell
EOF
}

resize_window_to_full_screen() {
osascript <<-EOF
tell application "Warp"
activate
tell application "System Events"
if (every window of process "Warp") is {} then
keystroke "n" using command down
end if

tell application "Finder"
set desktopSize to bounds of window of desktop
end tell

set position of front window of process "Warp" to {0, 0}
set size of front window of process "Warp" to {item 3 of desktopSize, item 4 of desktopSize}
end tell
end tell
EOF
}

resize_to_true_full_screen() {
osascript <<-EOF
tell application "Warp"
# wait for Warp to start
delay 1
activate
# short wait for Warp to gain focus
delay 0.1
tell application "System Events" to tell process "Warp"
keystroke "f" using {control down, command down}
end tell
end tell
EOF
}

main() {
start_terminal_and_run_tmux
if [ "$TRUE_FULL_SCREEN" == "fullscreen" ]; then
resize_to_true_full_screen
else
resize_window_to_full_screen
fi
}
main