Change themes at runtime #4280
-
I use light and dark themes but prefer to change them throughout the day with my custom A hacky way to accomplish such tasks is to rewrite the config file with my shell functions and force a config reload with a Can we force a configuration to reload programmatically or change a setting programmatically for an already running Ghostty application? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
there is no way to programmatically control ghostty yet. This is planned though take a look at (#2353) here for example |
Beta Was this translation helpful? Give feedback.
-
For others looking to script the Ghostty config reload, here is how to reload the config with AppleScript on macOS. Run it with tell application "System Events"
tell application "Ghostty" to activate
delay 0.5
tell process "Ghostty"
click menu item "Reload configuration" of menu "Ghostty" of menu bar 1
end tell
end tell |
Beta Was this translation helpful? Give feedback.
-
++Subscribed For reference, i do the following with Maybe some combination of setting # ~/.zshrc
if [[ -n $SSH_CONNECTION ]]; then
echo -e "\033]50;SetProfile=remote\a"
else
echo -e "\033]50;SetProfile=local\a"
fi # ~/.zlogout
echo -e "\033]50;SetProfile=local\a" Heres my temporary hack. (Mac only)
Trigger between the two # .zshrc
function rg(){
# path to optional config
local file="$HOME/.dotfiles/config/ghostty/remote_config"
local file_off="${file}_off"
# rename file on/off
[ -f "$file" ] && mv "$file" "$file_off" || mv "$file_off" "$file"
# mac: trigger reload_config
osascript -e 'tell application "System Events" to keystroke "," using {command down, shift down}'
} |
Beta Was this translation helpful? Give feedback.
there is no way to programmatically control ghostty yet. This is planned though take a look at (#2353) here for example