feature: Add automated colorscheme switching to Ghostty, refactor
watchman_tmux into generic utility function.
This commit is contained in:
parent
6521dedbaa
commit
a15f2238aa
7 changed files with 164 additions and 68 deletions
|
|
@ -35,7 +35,10 @@ clipboard-paste-protection = false
|
|||
window-decoration = false
|
||||
shell-integration = zsh
|
||||
|
||||
theme = Ayu Mirage
|
||||
# This is the default fallback theme. This is only used
|
||||
# if the colorsync handled theme file doesn't exist.
|
||||
theme = Ayu
|
||||
config-file = ?colorsync_ghostty_theme
|
||||
background-opacity = 1.0
|
||||
background-blur-radius = 7
|
||||
|
||||
|
|
|
|||
37
ghostty/ghostty-change-theme.sh
Executable file
37
ghostty/ghostty-change-theme.sh
Executable file
|
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
THEME=$(colorsync get)
|
||||
|
||||
OUTPUT="$HOME/.config/ghostty/colorsync_ghostty_theme"
|
||||
|
||||
default() {
|
||||
printf "theme = Ayu" > "$OUTPUT"
|
||||
}
|
||||
|
||||
case "$THEME" in
|
||||
ayudark)
|
||||
default
|
||||
;;
|
||||
ayumirage)
|
||||
printf "theme = Ayu Mirage" > "$OUTPUT"
|
||||
;;
|
||||
ayulight)
|
||||
printf "theme = ayu_light" > "$OUTPUT"
|
||||
;;
|
||||
*)
|
||||
default
|
||||
;;
|
||||
esac
|
||||
|
||||
# once SIGUSR2 is merged in Ghostty, just replace the keystroke hack with pkill -USR2 ghostty
|
||||
case "$(uname)" in
|
||||
Darwin)
|
||||
osascript -e 'tell application "System Events" to keystroke "," using {command down, shift down}'
|
||||
;;
|
||||
Linux)
|
||||
wtype -M ctrl -M shift , -m shift -m ctrl
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported OS"
|
||||
;;
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue