o0th.tmux-nova/scripts/load_plugin_variables.sh
Simão Neves 7b1f898145 Load plugin variables
This commit enables a tmux config to load plugin variables to be used in
tmux-nova segments.
This works by loading a file before plugin declarations that sets up a
status-left option with the variables we want to load, then after the
plugins are sourced we load those values into tmux environment
variables to be used in segments.
2023-03-05 23:26:37 +00:00

15 lines
278 B
Bash
Executable file

#!/usr/bin/env bash
export LC_ALL=en_US.UTF-8
tmux set-option -g status-left ""
tmux set-environment -g @nova-load-variables ""
all=""
for var in "$@"
do
tmux set-option -ga status-left "#{$var}*"
all+="$var "
done
tmux set-environment -g @nova-load-variables "$all"