From 494ec8ea6ab1157a37fea6817841a8ad3c3704bc Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sun, 14 Dec 2025 17:16:01 -0600 Subject: [PATCH 1/2] feat(auto-theme): improve tmux theme setup --- src/content/git/auto-theme.nvim.mdx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/content/git/auto-theme.nvim.mdx b/src/content/git/auto-theme.nvim.mdx index 863d7dd..caa1d02 100644 --- a/src/content/git/auto-theme.nvim.mdx +++ b/src/content/git/auto-theme.nvim.mdx @@ -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 30/11/2025 +### upd: fzf, ripgrep, fzf-lua, and shell improvements 30/11/2025 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 14/12/2025 + +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' +``` From 6a5c38ae711a7f022ae151d8910d426184680e85 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sun, 14 Dec 2025 17:19:36 -0600 Subject: [PATCH 2/2] fix(git): improve phrasing --- src/content/git/auto-theme.nvim.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/content/git/auto-theme.nvim.mdx b/src/content/git/auto-theme.nvim.mdx index caa1d02..36ca475 100644 --- a/src/content/git/auto-theme.nvim.mdx +++ b/src/content/git/auto-theme.nvim.mdx @@ -161,9 +161,13 @@ if -F '#{==:#{client_theme},light}' { ## upd: improve tmux theme updating 14/12/2025 -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: +The above config does not always update the tmux theme in tandem with the system theme. For example, on system startup, the tmux theme is not set. I could only get around this by manually reloading the configuration _inside_ of tmux. + +It is simpler (and more correct) to set the theme as a function of when tmux itself detects changes to the system theme. This is possible by leveraging the exposed hooks `client-{light,dark}-theme` 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' ``` + +where the configuration files house the individual theme logic.