diff --git a/README.md b/README.md index d447c65..f57884b 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,11 @@ A pack of various themes for Tmux. 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/magenta'` +- `set -g @themepack 'basic'` (default) +- `set -g @themepack 'powerline/block/blue'` +- `set -g @themepack 'powerline/block/cyan'` +- `set -g @themepack 'powerline/default/gray'` +- `set -g @themepack 'powerline/double/magenta'` - `...` ## Themes diff --git a/powerline/block/gray.tmuxtheme b/powerline/block/gray.tmuxtheme index be2a396..fcbe863 100644 --- a/powerline/block/gray.tmuxtheme +++ b/powerline/block/gray.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour245 set -g window-status-current-fg colour232 # Window with activity status -set -g window-status-activity-bg colour243 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/powerline/block/magenta.tmuxtheme b/powerline/block/magenta.tmuxtheme index d682e46..0c72c65 100644 --- a/powerline/block/magenta.tmuxtheme +++ b/powerline/block/magenta.tmuxtheme @@ -32,7 +32,7 @@ set -g window-status-format " #I:#W#F " set -g window-status-current-format " #I:#W#F " # Current window status -set -g window-status-current-bg colour89 +set -g window-status-current-bg colour90 set -g window-status-current-fg colour232 # Window with activity status @@ -51,18 +51,18 @@ set -g pane-border-fg colour238 # Active pane border set -g pane-active-border-bg default -set -g pane-active-border-fg colour89 +set -g pane-active-border-fg colour90 # Pane number indicator set -g display-panes-colour colour233 set -g display-panes-active-colour colour245 # Clock mode -set -g clock-mode-colour colour89 +set -g clock-mode-colour colour90 set -g clock-mode-style 24 # Message -set -g message-bg colour89 +set -g message-bg colour90 set -g message-fg black # Command message diff --git a/powerline/default/blue.tmuxtheme b/powerline/default/blue.tmuxtheme index dc09a4b..ad8301a 100644 --- a/powerline/default/blue.tmuxtheme +++ b/powerline/default/blue.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour100 set -g window-status-current-fg colour235 # Window with activity status -set -g window-status-activity-bg colour31 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/powerline/default/cyan.tmuxtheme b/powerline/default/cyan.tmuxtheme index a9b3436..9cbb50f 100644 --- a/powerline/default/cyan.tmuxtheme +++ b/powerline/default/cyan.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour39 set -g window-status-current-fg colour235 # Window with activity status -set -g window-status-activity-bg colour75 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/powerline/default/green.tmuxtheme b/powerline/default/green.tmuxtheme index d439f3f..0ce3c02 100644 --- a/powerline/default/green.tmuxtheme +++ b/powerline/default/green.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour100 set -g window-status-current-fg colour235 # Window with activity status -set -g window-status-activity-bg colour107 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/powerline/default/magenta.tmuxtheme b/powerline/default/magenta.tmuxtheme index 51c65de..e2f39a8 100644 --- a/powerline/default/magenta.tmuxtheme +++ b/powerline/default/magenta.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour125 set -g window-status-current-fg colour235 # Window with activity status -set -g window-status-activity-bg colour141 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/powerline/default/orange.tmuxtheme b/powerline/default/orange.tmuxtheme index 13b0e77..a2f50da 100644 --- a/powerline/default/orange.tmuxtheme +++ b/powerline/default/orange.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour130 set -g window-status-current-fg colour235 # Window with activity status -set -g window-status-activity-bg colour130 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/powerline/default/red.tmuxtheme b/powerline/default/red.tmuxtheme index bf1b140..fe6bb59 100644 --- a/powerline/default/red.tmuxtheme +++ b/powerline/default/red.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour88 set -g window-status-current-fg colour16 # Window with activity status -set -g window-status-activity-bg colour88 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/powerline/default/yellow.tmuxtheme b/powerline/default/yellow.tmuxtheme index a3800f8..41e9a48 100644 --- a/powerline/default/yellow.tmuxtheme +++ b/powerline/default/yellow.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour227 set -g window-status-current-fg colour235 # Window with activity status -set -g window-status-activity-bg colour229 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/powerline/double/blue.tmuxtheme b/powerline/double/blue.tmuxtheme index 2fc2ba3..54bcf36 100644 --- a/powerline/double/blue.tmuxtheme +++ b/powerline/double/blue.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour24 set -g window-status-current-fg colour233 # Window with activity status -set -g window-status-activity-bg colour31 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/powerline/double/cyan.tmuxtheme b/powerline/double/cyan.tmuxtheme index a861a44..1d68cc4 100644 --- a/powerline/double/cyan.tmuxtheme +++ b/powerline/double/cyan.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour39 set -g window-status-current-fg colour235 # Window with activity status -set -g window-status-activity-bg colour75 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/powerline/double/green.tmuxtheme b/powerline/double/green.tmuxtheme index 5c73f3b..e759822 100644 --- a/powerline/double/green.tmuxtheme +++ b/powerline/double/green.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour100 set -g window-status-current-fg colour235 # Window with activity status -set -g window-status-activity-bg colour107 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/powerline/double/magenta.tmuxtheme b/powerline/double/magenta.tmuxtheme index 2dc3dbf..c508f8e 100644 --- a/powerline/double/magenta.tmuxtheme +++ b/powerline/double/magenta.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour125 set -g window-status-current-fg colour235 # Window with activity status -set -g window-status-activity-bg colour141 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/powerline/double/orange.tmuxtheme b/powerline/double/orange.tmuxtheme index 0a8055c..3545da5 100644 --- a/powerline/double/orange.tmuxtheme +++ b/powerline/double/orange.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour130 set -g window-status-current-fg colour235 # Window with activity status -set -g window-status-activity-bg colour130 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/powerline/double/red.tmuxtheme b/powerline/double/red.tmuxtheme index 5355e01..c1eb3cc 100644 --- a/powerline/double/red.tmuxtheme +++ b/powerline/double/red.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour88 set -g window-status-current-fg colour16 # Window with activity status -set -g window-status-activity-bg colour88 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/powerline/double/yellow.tmuxtheme b/powerline/double/yellow.tmuxtheme index 4926511..694b680 100644 --- a/powerline/double/yellow.tmuxtheme +++ b/powerline/double/yellow.tmuxtheme @@ -36,7 +36,7 @@ set -g window-status-current-bg colour227 set -g window-status-current-fg colour235 # Window with activity status -set -g window-status-activity-bg colour229 # fg and bg are flipped here due to +set -g window-status-activity-bg colour245 # fg and bg are flipped here due to set -g window-status-activity-fg colour233 # a bug in tmux # Window separator diff --git a/themepack.tmux b/themepack.tmux index ff18863..dd2a455 100755 --- a/themepack.tmux +++ b/themepack.tmux @@ -3,21 +3,27 @@ CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" theme_option="@themepack" -default_theme='block/blue' +default_theme='basic' 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 + local option="$1" + local default_value="$2" + local option_value="$(tmux show-option -gqv "$option")" + + if [ -n "$option_value" ]; then + echo "$option_value" + else + echo "$default_value" + fi } main() { - local theme="$(get_tmux_option "$theme_option" "$default_theme")" - tmux source-file "$CURRENT_DIR/powerline/${theme}.tmuxtheme" + local theme="$(get_tmux_option "$theme_option" "$default_theme")" + if [ -f "$CURRENT_DIR/${theme}.tmuxtheme" ]; then + tmux source-file "$CURRENT_DIR/${theme}.tmuxtheme" + else + tmux source-file "$CURRENT_DIR/powerline/${theme}.tmuxtheme" + fi } + main