Merge pull request #2 from wfxr/master

Add Tmux Plugin Manager Support
This commit is contained in:
2015-10-27 13:07:42 +00:00
2 changed files with 40 additions and 0 deletions

View File

@@ -5,6 +5,8 @@ A pack of various themes for Tmux.
## Installation
### Install manually
1. Clone repo to local machine:
git clone https://github.com/jimeh/tmux-themepack.git ~/.tmux-themepack
@@ -13,6 +15,21 @@ A pack of various themes for Tmux.
source-file "${HOME}/.tmux-themepack/powerline/block/green.tmuxtheme"
### Install using [Tmux Plugin Manager](https://github.com/tmux-plugins/tpm)
1. Add plugin to the list of TPM plugins in `.tmux.conf`:
set -g @plugin 'jimeh/tmux-themepack'
2. Hit `prefix + I` to fetch the plugin and source it. The plugin should now be working.
You can pick and choose a theme via `.tmux.conf` option:
- `set -g @themepack 'block/blue'` (default)
- `set -g @themepack 'block/cyan'`
- `set -g @themepack 'default/gray'`
- `set -g @themepack 'double/megenta'`
- `...`
## Themes

23
themepack.tmux Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
theme_option="@themepack"
default_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