From cf8baeade0f71241391256bba526c9dbb900957f Mon Sep 17 00:00:00 2001 From: Dimitar Nizamov Date: Sat, 20 Jan 2024 16:57:15 +0100 Subject: [PATCH] refactor kitty,alacritty,warp startup scripts to same implementation --- .../osx_alacritty_start_tmux.sh | 18 +++++------------- .../osx_kitty_start_tmux.sh | 2 +- .../osx_warp_start_tmux.sh | 2 +- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/scripts/handle_tmux_automatic_start/osx_alacritty_start_tmux.sh b/scripts/handle_tmux_automatic_start/osx_alacritty_start_tmux.sh index e9f09c6..8842cf0 100755 --- a/scripts/handle_tmux_automatic_start/osx_alacritty_start_tmux.sh +++ b/scripts/handle_tmux_automatic_start/osx_alacritty_start_tmux.sh @@ -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" @@ -39,19 +39,11 @@ resize_window_to_full_screen() { resize_to_true_full_screen() { osascript <<-EOF - tell application "Alacritty" + tell application "alacritty" activate - delay 0.5 - tell application "System Events" to tell process "Alacritty" - if front window exists then - tell front window - if value of attribute "AXFullScreen" then - set value of attribute "AXFullScreen" to false - else - set value of attribute "AXFullScreen" to true - end if - end tell - end if + delay 1 + tell application "System Events" to tell process "alacritty" + keystroke "f" using {control down, command down} end tell end tell EOF diff --git a/scripts/handle_tmux_automatic_start/osx_kitty_start_tmux.sh b/scripts/handle_tmux_automatic_start/osx_kitty_start_tmux.sh index 94c1d2b..4a08626 100755 --- a/scripts/handle_tmux_automatic_start/osx_kitty_start_tmux.sh +++ b/scripts/handle_tmux_automatic_start/osx_kitty_start_tmux.sh @@ -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" diff --git a/scripts/handle_tmux_automatic_start/osx_warp_start_tmux.sh b/scripts/handle_tmux_automatic_start/osx_warp_start_tmux.sh index 44705df..940d630 100755 --- a/scripts/handle_tmux_automatic_start/osx_warp_start_tmux.sh +++ b/scripts/handle_tmux_automatic_start/osx_warp_start_tmux.sh @@ -9,7 +9,7 @@ start_terminal_and_run_tmux() { osascript <<-EOF tell application "Warp" activate - delay 5 + delay 1 tell application "System Events" to tell process "Warp" set frontmost to true keystroke "tmux"