feat(auto-theme): improve tmux theme setup

This commit is contained in:
Barrett Ruth 2025-12-14 17:16:01 -06:00
parent ed829f9e8e
commit 494ec8ea6a

View file

@ -72,7 +72,7 @@ Unfortunately, the following programs I've found nearly impossible to dynamicall
9. ripgrep: I use the default theme. The ripgrep global configuration file does not support environment variables, exterminating the option to provide a `${THEME}`-based path in the global configuration file.
10. zsh: it's impossible to update `$THEME` across all existing shells (simply a limit of posix). However, all affected _programs_ will read the proper `$THEME`--I'm fine compromising here.
### UPD: fzf, ripgrep, fzf-lua, and shell improvements <span class="date">30/11/2025</span>
### upd: fzf, ripgrep, fzf-lua, and shell improvements <span class="date">30/11/2025</span>
After some _extreme_ amounts of finagling I'm now able to automatically update fzf and ripgrep themes both in the shell (after re-rendering the prompt\*) and in new fzf-lua instances. I consider this a 99% win.
@ -158,3 +158,12 @@ if -F '#{==:#{client_theme},light}' {
# set light mode
}
```
## upd: improve tmux theme updating <span class="date">14/12/2025</span>
The above config does not update the tmux theme in tandem with the system theme. I switched to sourcing a theme file (`$XDG_CONFIG_HOME/tmux/themes/{midnight,daylight}.conf`) and hooking into tmux's internal system theme (the `client-{light,dark}-theme` hook) as follows:
```tmux
set-hook -g client-light-theme 'source $XDG_CONFIG_HOME/tmux/themes/daylight.conf'
set-hook -g client-dark-theme 'source $XDG_CONFIG_HOME/tmux/themes/midnight.conf'
```