tmux-catppuccin-coal/catppuccin.tmux
Roger Steve Ruiz fb4e08d66c
Plumbing through the new variable to theme files;
This is the start of plumbing things through into the theme files, but I
do think that there is a better way here. I'm open to suggestions and
will probably ask for some help in the Discord for Catppuccin.
2022-11-23 14:50:03 -05:00

27 lines
670 B
Bash
Executable file

#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
get-tmux-option() {
local option value default
option="$1"
default="$2"
value="$(tmux show-option -gqv "$option")"
if [ -n "$value" ]; then
echo "$value"
else
# README: Set the default option if it's not set originally.
tmux set-option -gq "${option}" "${default}"
echo "$default"
fi
}
main() {
local theme
local window_tabs_enabled
theme="$(get-tmux-option "@catppuccin_flavour" "mocha")"
window_tabs_enabled="$(get-tmux-option "@catppuccin_window_tabs_enabled" "false")"
tmux run -b "$CURRENT_DIR/catppuccin-${theme}.tmuxtheme"
}
main "$@"