From 7809bc591104fb5f2b37539e7336c80c7051c5f5 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Tue, 11 Apr 2017 10:47:40 +0100 Subject: [PATCH 1/3] Tweak other window activity colors Thanks to the currently active window and other windows with activity colors being very similar, it was often quite hard to see which window is currently active. This changes activity color in other windows to just be gray, rather than the specific color of the theme, allowing the currently active window to stand out more. --- powerline/block/gray.tmuxtheme | 2 +- powerline/default/blue.tmuxtheme | 2 +- powerline/default/cyan.tmuxtheme | 2 +- powerline/default/green.tmuxtheme | 2 +- powerline/default/magenta.tmuxtheme | 2 +- powerline/default/orange.tmuxtheme | 2 +- powerline/default/red.tmuxtheme | 2 +- powerline/default/yellow.tmuxtheme | 2 +- powerline/double/blue.tmuxtheme | 2 +- powerline/double/cyan.tmuxtheme | 2 +- powerline/double/green.tmuxtheme | 2 +- powerline/double/magenta.tmuxtheme | 2 +- powerline/double/orange.tmuxtheme | 2 +- powerline/double/red.tmuxtheme | 2 +- powerline/double/yellow.tmuxtheme | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) 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/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 From 6ae659d768200d7e40fe2ca3950d3c9564566637 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Tue, 11 Apr 2017 10:49:48 +0100 Subject: [PATCH 2/3] Slightly tweak colors in powerline/block/magenta theme --- powerline/block/magenta.tmuxtheme | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 From 027009b18b61323fbf4e06c39c15da30595bb5b6 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Thu, 13 Apr 2017 00:17:17 +0100 Subject: [PATCH 3/3] Enable loading non-powerline themes via TMP Without break backwards compatibility. Should fix issue #6. --- README.md | 9 +++++---- themepack.tmux | 28 +++++++++++++++++----------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 623ae40..b3b22ef 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/megenta'` +- `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/megenta'` - `...` ## Themes 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