mirror of
https://github.com/tmux-plugins/tmux-continuum.git
synced 2025-09-09 16:47:19 +00:00
feat: add kitty to the list of supported terminals for automatic start
This commit is contained in:
@ -16,10 +16,19 @@ Next time the computer is started:
|
|||||||
Config options:
|
Config options:
|
||||||
- `set -g @continuum-boot-options 'fullscreen'` - terminal window
|
- `set -g @continuum-boot-options 'fullscreen'` - terminal window
|
||||||
will go fullscreen
|
will go fullscreen
|
||||||
- `set -g @continuum-boot-options 'iterm'` - start `iTerm` instead
|
- `set -g @continuum-boot-options 'iterm'` - start [iTerm](https://www.iterm2.com) instead
|
||||||
of `Terminal.app`
|
of `Terminal.app`
|
||||||
- `set -g @continuum-boot-options 'iterm,fullscreen'` - start `iTerm`
|
- `set -g @continuum-boot-options 'iterm,fullscreen'` - start `iTerm`
|
||||||
in fullscreen
|
in fullscreen
|
||||||
|
- `set -g @continuum-boot-options 'kitty'` - start [kitty](https://sw.kovidgoyal.net/kitty) instead
|
||||||
|
of `Terminal.app`
|
||||||
|
- `set -g @continuum-boot-options 'kitty,fullscreen'` - start `kitty`
|
||||||
|
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
|
||||||
|
to go to `System Preferences -> Security & Privacy -> Accessability` and add the script to the list of apps that are
|
||||||
|
allowed to control your computer.
|
||||||
|
|
||||||
### Linux
|
### Linux
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
source "$CURRENT_DIR/../helpers.sh"
|
source "$CURRENT_DIR/../helpers.sh"
|
||||||
source "$CURRENT_DIR/../variables.sh"
|
source "$CURRENT_DIR/../variables.sh"
|
||||||
@ -16,7 +16,7 @@ template() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
local content
|
local content
|
||||||
read -r -d '' content <<-EOF
|
read -r -d '' content <<- EOF
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
@ -39,6 +39,8 @@ get_iterm_or_teminal_option_value() {
|
|||||||
local options="$1"
|
local options="$1"
|
||||||
if [[ "$options" =~ "iterm" ]]; then
|
if [[ "$options" =~ "iterm" ]]; then
|
||||||
echo "iterm"
|
echo "iterm"
|
||||||
|
elif [[ "$options" =~ "kitty" ]]; then
|
||||||
|
echo "kitty"
|
||||||
else
|
else
|
||||||
# Terminal.app is the default console app
|
# Terminal.app is the default console app
|
||||||
echo "terminal"
|
echo "terminal"
|
||||||
|
60
scripts/handle_tmux_automatic_start/osx_kitty_start_tmux.sh
Executable file
60
scripts/handle_tmux_automatic_start/osx_kitty_start_tmux.sh
Executable file
@ -0,0 +1,60 @@
|
|||||||
|
#!/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 "kitty"
|
||||||
|
activate
|
||||||
|
delay 5
|
||||||
|
tell application "System Events" to tell process "kitty"
|
||||||
|
set frontmost to true
|
||||||
|
keystroke "tmux"
|
||||||
|
key code 36
|
||||||
|
end tell
|
||||||
|
end tell
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
resize_window_to_full_screen() {
|
||||||
|
osascript <<- EOF
|
||||||
|
tell application "kitty"
|
||||||
|
activate
|
||||||
|
tell application "System Events"
|
||||||
|
if (every window of process "kitty") 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 "kitty" to {0, 0}
|
||||||
|
set size of front window of process "kitty" to {item 3 of desktopSize, item 4 of desktopSize}
|
||||||
|
end tell
|
||||||
|
end tell
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
resize_to_true_full_screen() {
|
||||||
|
osascript <<- EOF
|
||||||
|
tell application "kitty"
|
||||||
|
activate
|
||||||
|
delay 1
|
||||||
|
tell application "System Events" to tell process "kitty"
|
||||||
|
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
|
Reference in New Issue
Block a user