mirror of
https://github.com/theniceboy/.config.git
synced 2025-12-26 14:44:57 +08:00
tmux configurable theme color part 2
This commit is contained in:
parent
87274915bf
commit
08d3e1e8a7
2 changed files with 28 additions and 5 deletions
22
tmux/scripts/update_theme_color.sh
Executable file
22
tmux/scripts/update_theme_color.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Determine theme color from tmux environments with fallback
|
||||
# Prefer session env, then global env, else default.
|
||||
theme_line=$(tmux show-environment TMUX_THEME_COLOR 2>/dev/null || true)
|
||||
if [[ "$theme_line" == TMUX_THEME_COLOR=* ]]; then
|
||||
theme="${theme_line#TMUX_THEME_COLOR=}"
|
||||
else
|
||||
theme_line=$(tmux show-environment -g TMUX_THEME_COLOR 2>/dev/null || true)
|
||||
if [[ "$theme_line" == TMUX_THEME_COLOR=* ]]; then
|
||||
theme="${theme_line#TMUX_THEME_COLOR=}"
|
||||
else
|
||||
theme="#b294bb"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Cache as a user option and apply to border style
|
||||
tmux set -g @theme_color "$theme"
|
||||
tmux set -g pane-active-border-style "fg=$theme"
|
||||
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue