Files
tmux-themepack/themepack.tmux
wfxr ba6cb6821e add plugin manager support
Add TPM(a plugin manager for tmux) support.  Now we can install and manage it by 'TPM'.

Details:
    Add plugin to the list of TPM plugins in .tmux.conf:
        set -g @plugin 'wfxr/tmux-themepack'
    Hit prefix + I to fetch the plugin and source it. The plugin should now be working.
    now we can pick and choose a theme via .tmux.conf option:
        set -g @themepack 'block/blue'  (the default) or
        set -g @themepack 'block/cyan'          or
        set -g @themepack 'default/gray'        or
        set -g @themepack 'double/megenta'      or
        ...
2015-10-27 19:36:24 +08:00

24 lines
500 B
Bash
Executable File

#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
theme_option="@themepack"
defalut_theme='block/blue'
get_tmux_option() {
local option="$1"
local default_value="$2"
local option_value="$(tmux show-option -gqv "$option")"
if [ -z "$option_value" ]; then
echo "$default_value"
else
echo "$option_value"
fi
}
main() {
local theme="$(get_tmux_option "$theme_option" "$default_theme")"
tmux source-file "$CURRENT_DIR/powerline/${theme}.tmuxtheme"
}
main