diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0f68809 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: CI + +on: [push] + +jobs: + test: + name: Test + runs-on: ubuntu-latest + strategy: + matrix: + tmux_version: + - "2.6" + - "2.7" + - "2.8" + - "2.9a" + - "3.0a" + steps: + - name: Set up Go 1.13 + uses: actions/setup-go@v1 + with: + go-version: 1.13 + - name: Check out the code + uses: actions/checkout@v1 + - name: Install Tmux ${{ matrix.tmux_version }} + run: | + sudo apt-get update + sudo apt-get install -y bc build-essential libevent-dev libncurses5-dev + wget https://github.com/tmux/tmux/releases/download/${{ matrix.tmux_version }}/tmux-${{ matrix.tmux_version }}.tar.gz + tar -zxf tmux-${{ matrix.tmux_version }}.tar.gz + cd tmux-${{ matrix.tmux_version }} + ./configure && make && sudo make install + cd .. + - name: Run all tests + run: make test diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..fbd1a18 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +default: test + +.PHONY: lint +lint: + cd test && golangci-lint run -v + +.PHONY: test +test: + cd test && go test -v diff --git a/powerline/block/blue.tmuxtheme b/powerline/block/blue.tmuxtheme index 8a804a3..b65cc73 100644 --- a/powerline/block/blue.tmuxtheme +++ b/powerline/block/blue.tmuxtheme @@ -17,19 +17,19 @@ set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour24,bold] #S #[fg=colour24,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour24,bold] #S #[fg=colour24,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status 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-style bg=colour24,fg=colour232 +set -g window-status-current-style bg=colour24,fg=black # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour31 @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour24,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour24,fg=black # Mode -set -g mode-style bg=colour24,fg=colour231 +set -g mode-style bg=colour24,fg=black diff --git a/powerline/block/cyan.tmuxtheme b/powerline/block/cyan.tmuxtheme index 893bab0..7a64929 100644 --- a/powerline/block/cyan.tmuxtheme +++ b/powerline/block/cyan.tmuxtheme @@ -17,19 +17,19 @@ set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour39,bold] #S #[fg=colour39,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour39,bold] #S #[fg=colour39,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status 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-style bg=colour39,fg=colour232 +set -g window-status-current-style bg=colour39,fg=black # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour75 @@ -58,8 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour39,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour39,fg=black # Mode -set -g mode-style bg=colour39,fg=colour232 - +set -g mode-style bg=colour39,fg=black diff --git a/powerline/block/gray.tmuxtheme b/powerline/block/gray.tmuxtheme index ba03f56..b30baec 100644 --- a/powerline/block/gray.tmuxtheme +++ b/powerline/block/gray.tmuxtheme @@ -12,24 +12,24 @@ set -g status-interval 1 # Basic status bar colors -set -g status-style fg=colour238,bg=colour233 +set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour245,bold] #S #[fg=colour245,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour245,bold] #S #[fg=colour245,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status 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-style bg=colour245,fg=colour232 +set -g window-status-current-style bg=colour245,fg=black # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour245 @@ -41,24 +41,24 @@ set -g window-status-separator "" set -g status-justify centre # Pane border -set -g pane-border-style bg=default,fg=colour235 +set -g pane-border-style bg=default,fg=colour238 # Active pane border -set -g pane-active-border-style bg=default,fg=colour240 +set -g pane-active-border-style bg=default,fg=colour245 # Pane number indicator set -g display-panes-colour colour233 set -g display-panes-active-colour colour245 # Clock mode -set -g clock-mode-colour colour240 +set -g clock-mode-colour colour245 set -g clock-mode-style 24 # Message -set -g message-style bg=colour245,fg=colour232 +set -g message-style bg=colour245,fg=black # Command message -set -g message-command-style bg=colour233,fg=colour250 +set -g message-command-style bg=colour245,fg=black # Mode -set -g mode-style bg=colour243,fg=colour232 +set -g mode-style bg=colour245,fg=black diff --git a/powerline/block/green.tmuxtheme b/powerline/block/green.tmuxtheme index 53f2966..a4488a9 100644 --- a/powerline/block/green.tmuxtheme +++ b/powerline/block/green.tmuxtheme @@ -17,19 +17,19 @@ set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour100,bold] #S #[fg=colour100,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour100,bold] #S #[fg=colour100,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status 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-style bg=colour100,fg=colour232 +set -g window-status-current-style bg=colour100,fg=black # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour107 @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour100,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour100,fg=black # Mode -set -g mode-style bg=colour100,fg=colour235 +set -g mode-style bg=colour100,fg=black diff --git a/powerline/block/magenta.tmuxtheme b/powerline/block/magenta.tmuxtheme index cdd005a..b42b690 100644 --- a/powerline/block/magenta.tmuxtheme +++ b/powerline/block/magenta.tmuxtheme @@ -17,22 +17,22 @@ set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour125,bold] #S #[fg=colour125,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour125,bold] #S #[fg=colour125,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status 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-style bg=colour90,fg=colour232 +set -g window-status-current-style bg=colour125,fg=black # Window with activity status -set -g window-status-activity-style bg=colour233,fg=colour141 +set -g window-status-activity-style bg=colour233,fg=colour129 # Window separator set -g window-status-separator "" @@ -44,21 +44,21 @@ set -g status-justify centre set -g pane-border-style bg=default,fg=colour238 # Active pane border -set -g pane-active-border-style bg=default,fg=colour90 +set -g pane-active-border-style bg=default,fg=colour125 # Pane number indicator set -g display-panes-colour colour233 set -g display-panes-active-colour colour245 # Clock mode -set -g clock-mode-colour colour90 +set -g clock-mode-colour colour125 set -g clock-mode-style 24 # Message -set -g message-style bg=colour90,fg=black +set -g message-style bg=colour125,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour125,fg=black # Mode -set -g mode-style bg=colour125,fg=colour231 +set -g mode-style bg=colour125,fg=black diff --git a/powerline/block/orange.tmuxtheme b/powerline/block/orange.tmuxtheme index 2f5a08d..6bf3e44 100644 --- a/powerline/block/orange.tmuxtheme +++ b/powerline/block/orange.tmuxtheme @@ -17,19 +17,19 @@ set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour130,bold] #S #[fg=colour130,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour130,bold] #S #[fg=colour130,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status 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-style bg=colour130,fg=colour232 +set -g window-status-current-style bg=colour130,fg=black # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour130 @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour130,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour130,fg=black # Mode -set -g mode-style bg=colour130,fg=colour232 +set -g mode-style bg=colour130,fg=black diff --git a/powerline/block/purple.tmuxtheme b/powerline/block/purple.tmuxtheme new file mode 100644 index 0000000..7ec2406 --- /dev/null +++ b/powerline/block/purple.tmuxtheme @@ -0,0 +1,64 @@ +# +# Powerline Purple Block - Tmux Theme +# Created by Jim Myhrberg . +# +# Inspired by vim-powerline: https://github.com/Lokaltog/powerline +# +# Requires terminal to be using a powerline compatible font, find one here: +# https://github.com/Lokaltog/powerline-fonts +# + +# Status update interval +set -g status-interval 1 + +# Basic status bar colors +set -g status-style fg=colour240,bg=colour233 + +# Left side of status bar +set -g status-left-style bg=colour233,fg=colour243 +set -g status-left-length 40 +set -g status-left "#[fg=colour233,bg=colour90,bold] #S #[fg=colour90,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" + +# Right side of status bar +set -g status-right-style bg=colour233,fg=colour243 +set -g status-right-length 150 +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " + +# Window status +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-style bg=colour90,fg=black + +# Window with activity status +set -g window-status-activity-style bg=colour233,fg=colour141 + +# Window separator +set -g window-status-separator "" + +# Window status alignment +set -g status-justify centre + +# Pane border +set -g pane-border-style bg=default,fg=colour238 + +# Active pane border +set -g pane-active-border-style bg=default,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 colour90 +set -g clock-mode-style 24 + +# Message +set -g message-style bg=colour90,fg=black + +# Command message +set -g message-command-style bg=colour90,fg=black + +# Mode +set -g mode-style bg=colour90,fg=black diff --git a/powerline/block/red.tmuxtheme b/powerline/block/red.tmuxtheme index aebf1fb..a0aee26 100644 --- a/powerline/block/red.tmuxtheme +++ b/powerline/block/red.tmuxtheme @@ -17,22 +17,22 @@ set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour16,bg=colour88,bold] #S #[fg=colour88,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour88,bold] #S #[fg=colour88,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status 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-style bg=colour124,fg=colour16 +set -g window-status-current-style bg=colour88,fg=black # Window with activity status -set -g window-status-activity-style bg=colour233,fg=colour88 +set -g window-status-activity-style bg=colour233,fg=colour124 # Window separator set -g window-status-separator "" @@ -52,7 +52,7 @@ set -g display-panes-active-colour colour245 # Clock mode set -g clock-mode-colour colour88 -set -g message-style bg=colour24 +set -g clock-mode-style 24 # Message set -g message-style bg=colour88,fg=black @@ -61,4 +61,4 @@ set -g message-style bg=colour88,fg=black set -g message-command-style bg=colour88,fg=black # Mode -set -g mode-style bg=colour124,fg=colour231 +set -g mode-style bg=colour88,fg=black diff --git a/powerline/block/yellow.tmuxtheme b/powerline/block/yellow.tmuxtheme index a0115ae..d80d962 100644 --- a/powerline/block/yellow.tmuxtheme +++ b/powerline/block/yellow.tmuxtheme @@ -17,19 +17,19 @@ set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour227,bold] #S #[fg=colour227,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour227,bold] #S #[fg=colour227,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status 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-style bg=colour227,fg=colour232 +set -g window-status-current-style bg=colour227,fg=black # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour229 @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour227,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour227,fg=black # Mode -set -g mode-style bg=colour227,fg=colour235 +set -g mode-style bg=colour227,fg=black diff --git a/powerline/default/blue.tmuxtheme b/powerline/default/blue.tmuxtheme index 2c4bfeb..f5cb1bc 100644 --- a/powerline/default/blue.tmuxtheme +++ b/powerline/default/blue.tmuxtheme @@ -12,17 +12,17 @@ set -g status-interval 1 # Basic status bar colors -set -g status-style fg=colour238,bg=colour233 +set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour24,bold] #S #[fg=colour24,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour24,bold] #S #[fg=colour24,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status set -g window-status-format " #I:#W#F " @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour24,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour24,fg=black # Mode -set -g mode-style bg=colour24,fg=colour231 +set -g mode-style bg=colour24,fg=black diff --git a/powerline/default/cyan.tmuxtheme b/powerline/default/cyan.tmuxtheme index 52fab19..0987bc9 100644 --- a/powerline/default/cyan.tmuxtheme +++ b/powerline/default/cyan.tmuxtheme @@ -17,19 +17,19 @@ set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour39,bold] #S #[fg=colour39,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour39,bold] #S #[fg=colour39,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status set -g window-status-format " #I:#W#F " set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour81,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" # Current window status -set -g window-status-current-style bg=colour39,fg=colour235 +set -g window-status-current-style bg=colour100,fg=colour235 # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour245 @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour39,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour39,fg=black # Mode -set -g mode-style bg=colour39,fg=colour232 +set -g mode-style bg=colour39,fg=black diff --git a/powerline/default/gray.tmuxtheme b/powerline/default/gray.tmuxtheme index 23c61bf..2f9f0e1 100644 --- a/powerline/default/gray.tmuxtheme +++ b/powerline/default/gray.tmuxtheme @@ -12,27 +12,27 @@ set -g status-interval 1 # Basic status bar colors -set -g status-style fg=colour238,bg=colour233 +set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour245,bold] #S #[fg=colour245,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour245,bold] #S #[fg=colour245,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status set -g window-status-format " #I:#W#F " set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour250,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" # Current window status -set -g window-status-current-style bg=black,fg=colour250 +set -g window-status-current-style bg=colour100,fg=colour235 # Window with activity status -set -g window-status-activity-style bg=colour233,fg=colour243 +set -g window-status-activity-style bg=colour233,fg=colour245 # Window separator set -g window-status-separator "" @@ -41,24 +41,24 @@ set -g window-status-separator "" set -g status-justify centre # Pane border -set -g pane-border-style bg=default,fg=colour235 +set -g pane-border-style bg=default,fg=colour238 # Active pane border -set -g pane-active-border-style bg=default,fg=colour240 +set -g pane-active-border-style bg=default,fg=colour245 # Pane number indicator set -g display-panes-colour colour233 set -g display-panes-active-colour colour245 # Clock mode -set -g clock-mode-colour colour240 +set -g clock-mode-colour colour245 set -g clock-mode-style 24 # Message -set -g message-style bg=colour245,fg=colour232 +set -g message-style bg=colour245,fg=black # Command message -set -g message-command-style bg=colour233,fg=colour250 +set -g message-command-style bg=colour245,fg=black # Mode -set -g mode-style bg=colour243,fg=colour232 +set -g mode-style bg=colour245,fg=black diff --git a/powerline/default/green.tmuxtheme b/powerline/default/green.tmuxtheme index 8e372f2..b16c5b2 100644 --- a/powerline/default/green.tmuxtheme +++ b/powerline/default/green.tmuxtheme @@ -17,12 +17,12 @@ set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour100,bold] #S #[fg=colour100,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour100,bold] #S #[fg=colour100,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status set -g window-status-format " #I:#W#F " @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour100,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour100,fg=black # Mode -set -g mode-style bg=colour100,fg=colour235 +set -g mode-style bg=colour100,fg=black diff --git a/powerline/default/magenta.tmuxtheme b/powerline/default/magenta.tmuxtheme index ee2c11d..34897ca 100644 --- a/powerline/default/magenta.tmuxtheme +++ b/powerline/default/magenta.tmuxtheme @@ -17,19 +17,19 @@ set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour125,bold] #S #[fg=colour125,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour125,bold] #S #[fg=colour125,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status set -g window-status-format " #I:#W#F " -set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour129,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" +set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour127,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" # Current window status -set -g window-status-current-style bg=colour125,fg=colour235 +set -g window-status-current-style bg=colour100,fg=colour235 # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour245 @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour125,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour125,fg=black # Mode -set -g mode-style bg=colour125,fg=colour231 +set -g mode-style bg=colour125,fg=black diff --git a/powerline/default/orange.tmuxtheme b/powerline/default/orange.tmuxtheme index 66acf13..29bab59 100644 --- a/powerline/default/orange.tmuxtheme +++ b/powerline/default/orange.tmuxtheme @@ -17,19 +17,19 @@ set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour130,bold] #S #[fg=colour130,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour130,bold] #S #[fg=colour130,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status set -g window-status-format " #I:#W#F " set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour166,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" # Current window status -set -g window-status-current-style bg=colour130,fg=colour235 +set -g window-status-current-style bg=colour100,fg=colour235 # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour245 @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour130,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour130,fg=black # Mode -set -g mode-style bg=colour130,fg=colour232 +set -g mode-style bg=colour130,fg=black diff --git a/powerline/default/purple.tmuxtheme b/powerline/default/purple.tmuxtheme new file mode 100644 index 0000000..3441c76 --- /dev/null +++ b/powerline/default/purple.tmuxtheme @@ -0,0 +1,64 @@ +# +# Powerline Purple - Tmux Theme +# Created by Jim Myhrberg . +# +# Inspired by vim-powerline: https://github.com/Lokaltog/powerline +# +# Requires terminal to be using a powerline compatible font, find one here: +# https://github.com/Lokaltog/powerline-fonts +# + +# Status update interval +set -g status-interval 1 + +# Basic status bar colors +set -g status-style fg=colour240,bg=colour233 + +# Left side of status bar +set -g status-left-style bg=colour233,fg=colour243 +set -g status-left-length 40 +set -g status-left "#[fg=colour233,bg=colour90,bold] #S #[fg=colour90,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" + +# Right side of status bar +set -g status-right-style bg=colour233,fg=colour243 +set -g status-right-length 150 +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " + +# Window status +set -g window-status-format " #I:#W#F " +set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour129,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" + +# Current window status +set -g window-status-current-style bg=colour100,fg=colour235 + +# Window with activity status +set -g window-status-activity-style bg=colour233,fg=colour245 + +# Window separator +set -g window-status-separator "" + +# Window status alignment +set -g status-justify centre + +# Pane border +set -g pane-border-style bg=default,fg=colour238 + +# Active pane border +set -g pane-active-border-style bg=default,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 colour90 +set -g clock-mode-style 24 + +# Message +set -g message-style bg=colour90,fg=black + +# Command message +set -g message-command-style bg=colour90,fg=black + +# Mode +set -g mode-style bg=colour90,fg=black diff --git a/powerline/default/red.tmuxtheme b/powerline/default/red.tmuxtheme index 06a8117..f04adfd 100644 --- a/powerline/default/red.tmuxtheme +++ b/powerline/default/red.tmuxtheme @@ -12,24 +12,24 @@ set -g status-interval 1 # Basic status bar colors -set -g status-style fg=colour238,bg=colour233 +set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour16,bg=colour88,bold] #S #[fg=colour88,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour88,bold] #S #[fg=colour88,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status set -g window-status-format " #I:#W#F " -set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour160,bold] #I:#W#F #[fg=colour233,bg=black,nobold]" +set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour160,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" # Current window status -set -g window-status-current-style bg=colour88,fg=colour16 +set -g window-status-current-style bg=colour100,fg=colour235 # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour245 @@ -61,4 +61,4 @@ set -g message-style bg=colour88,fg=black set -g message-command-style bg=colour88,fg=black # Mode -set -g mode-style bg=colour124,fg=colour231 +set -g mode-style bg=colour88,fg=black diff --git a/powerline/default/yellow.tmuxtheme b/powerline/default/yellow.tmuxtheme index 5bf2d60..978d10f 100644 --- a/powerline/default/yellow.tmuxtheme +++ b/powerline/default/yellow.tmuxtheme @@ -17,19 +17,19 @@ set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour227,bold] #S #[fg=colour227,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour227,bold] #S #[fg=colour227,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour232,bg=colour245,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]#[fg=colour233,bg=colour245,bold] #H " # Window status set -g window-status-format " #I:#W#F " set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour227,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" # Current window status -set -g window-status-current-style bg=colour227,fg=colour235 +set -g window-status-current-style bg=colour100,fg=colour235 # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour245 @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour227,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour227,fg=black # Mode -set -g mode-style bg=colour227,fg=colour235 +set -g mode-style bg=colour227,fg=black diff --git a/powerline/double/blue.tmuxtheme b/powerline/double/blue.tmuxtheme index 0c6dfc9..0eda8f9 100644 --- a/powerline/double/blue.tmuxtheme +++ b/powerline/double/blue.tmuxtheme @@ -12,24 +12,24 @@ set -g status-interval 1 # Basic status bar colors -set -g status-style fg=colour238,bg=colour233 +set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour24,bold] #S #[fg=colour24,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour24,bold] #S #[fg=colour24,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour24,bg=colour240]#[fg=colour232,bg=colour24,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour24,bg=colour240]#[fg=colour233,bg=colour24,bold] #H " # Window status set -g window-status-format " #I:#W#F " set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour33,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" # Current window status -set -g window-status-current-style bg=colour24,fg=colour233 +set -g window-status-current-style bg=colour100,fg=colour235 # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour245 @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour24,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour24,fg=black # Mode -set -g mode-style bg=colour24,fg=colour231 +set -g mode-style bg=colour24,fg=black diff --git a/powerline/double/cyan.tmuxtheme b/powerline/double/cyan.tmuxtheme index f78c2ce..e5349af 100644 --- a/powerline/double/cyan.tmuxtheme +++ b/powerline/double/cyan.tmuxtheme @@ -29,7 +29,7 @@ set -g window-status-format " #I:#W#F " set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour81,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" # Current window status -set -g window-status-current-style bg=colour39,fg=colour235 +set -g window-status-current-style bg=colour100,fg=colour235 # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour245 @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour39,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour39,fg=black # Mode -set -g mode-style bg=colour39,fg=colour232 +set -g mode-style bg=colour39,fg=black diff --git a/powerline/double/green.tmuxtheme b/powerline/double/green.tmuxtheme index 7cf0f39..7a8909c 100644 --- a/powerline/double/green.tmuxtheme +++ b/powerline/double/green.tmuxtheme @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour100,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour100,fg=black # Mode -set -g mode-style bg=colour100,fg=colour235 +set -g mode-style bg=colour100,fg=black diff --git a/powerline/double/magenta.tmuxtheme b/powerline/double/magenta.tmuxtheme index bef3e7a..d9d8ac0 100644 --- a/powerline/double/magenta.tmuxtheme +++ b/powerline/double/magenta.tmuxtheme @@ -26,10 +26,10 @@ set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] # Window status set -g window-status-format " #I:#W#F " -set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour129,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" +set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour127,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" # Current window status -set -g window-status-current-style bg=colour125,fg=colour235 +set -g window-status-current-style bg=colour100,fg=colour235 # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour245 @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour125,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour125,fg=black # Mode -set -g mode-style bg=colour125,fg=colour231 +set -g mode-style bg=colour125,fg=black diff --git a/powerline/double/orange.tmuxtheme b/powerline/double/orange.tmuxtheme index f38eaf3..88cc0a9 100644 --- a/powerline/double/orange.tmuxtheme +++ b/powerline/double/orange.tmuxtheme @@ -29,7 +29,7 @@ set -g window-status-format " #I:#W#F " set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour166,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" # Current window status -set -g window-status-current-style bg=colour130,fg=colour235 +set -g window-status-current-style bg=colour100,fg=colour235 # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour245 @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour130,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour130,fg=black # Mode -set -g mode-style bg=colour130,fg=colour232 +set -g mode-style bg=colour130,fg=black diff --git a/powerline/double/purple.tmuxtheme b/powerline/double/purple.tmuxtheme new file mode 100644 index 0000000..38615b3 --- /dev/null +++ b/powerline/double/purple.tmuxtheme @@ -0,0 +1,64 @@ +# +# Powerline Double Purple - Tmux Theme +# Created by Jim Myhrberg . +# +# Inspired by vim-powerline: https://github.com/Lokaltog/powerline +# +# Requires terminal to be using a powerline compatible font, find one here: +# https://github.com/Lokaltog/powerline-fonts +# + +# Status update interval +set -g status-interval 1 + +# Basic status bar colors +set -g status-style fg=colour240,bg=colour233 + +# Left side of status bar +set -g status-left-style bg=colour233,fg=colour243 +set -g status-left-length 40 +set -g status-left "#[fg=colour233,bg=colour90,bold] #S #[fg=colour90,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" + +# Right side of status bar +set -g status-right-style bg=colour233,fg=colour243 +set -g status-right-length 150 +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour90,bg=colour240]#[fg=colour233,bg=colour90,bold] #H " + +# Window status +set -g window-status-format " #I:#W#F " +set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour129,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" + +# Current window status +set -g window-status-current-style bg=colour100,fg=colour235 + +# Window with activity status +set -g window-status-activity-style bg=colour233,fg=colour245 + +# Window separator +set -g window-status-separator "" + +# Window status alignment +set -g status-justify centre + +# Pane border +set -g pane-border-style bg=default,fg=colour238 + +# Active pane border +set -g pane-active-border-style bg=default,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 colour90 +set -g clock-mode-style 24 + +# Message +set -g message-style bg=colour90,fg=black + +# Command message +set -g message-command-style bg=colour90,fg=black + +# Mode +set -g mode-style bg=colour90,fg=black diff --git a/powerline/double/red.tmuxtheme b/powerline/double/red.tmuxtheme index ea7d53c..c234b9f 100644 --- a/powerline/double/red.tmuxtheme +++ b/powerline/double/red.tmuxtheme @@ -12,24 +12,24 @@ set -g status-interval 1 # Basic status bar colors -set -g status-style fg=colour238,bg=colour233 +set -g status-style fg=colour240,bg=colour233 # Left side of status bar set -g status-left-style bg=colour233,fg=colour243 set -g status-left-length 40 -set -g status-left "#[fg=colour232,bg=colour88,bold] #S #[fg=colour88,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" +set -g status-left "#[fg=colour233,bg=colour88,bold] #S #[fg=colour88,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]" # Right side of status bar set -g status-right-style bg=colour233,fg=colour243 set -g status-right-length 150 -set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour88,bg=colour240]#[fg=colour232,bg=colour88,bold] #H " +set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour88,bg=colour240]#[fg=colour233,bg=colour88,bold] #H " # Window status set -g window-status-format " #I:#W#F " -set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour160,bold] #I:#W#F #[fg=colour233,bg=black,nobold]" +set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour160,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" # Current window status -set -g window-status-current-style bg=colour88,fg=colour16 +set -g window-status-current-style bg=colour100,fg=colour235 # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour245 @@ -61,4 +61,4 @@ set -g message-style bg=colour88,fg=black set -g message-command-style bg=colour88,fg=black # Mode -set -g mode-style bg=colour124,fg=colour231 +set -g mode-style bg=colour88,fg=black diff --git a/powerline/double/yellow.tmuxtheme b/powerline/double/yellow.tmuxtheme index 451a940..6234126 100644 --- a/powerline/double/yellow.tmuxtheme +++ b/powerline/double/yellow.tmuxtheme @@ -29,7 +29,7 @@ set -g window-status-format " #I:#W#F " set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour227,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]" # Current window status -set -g window-status-current-style bg=colour227,fg=colour235 +set -g window-status-current-style bg=colour100,fg=colour235 # Window with activity status set -g window-status-activity-style bg=colour233,fg=colour245 @@ -58,7 +58,7 @@ set -g clock-mode-style 24 set -g message-style bg=colour227,fg=black # Command message -set -g message-command-style bg=colour233,fg=black +set -g message-command-style bg=colour227,fg=black # Mode -set -g mode-style bg=colour227,fg=colour235 +set -g mode-style bg=colour227,fg=black diff --git a/test/basic_test.go b/test/basic_test.go new file mode 100644 index 0000000..7f0f80a --- /dev/null +++ b/test/basic_test.go @@ -0,0 +1,47 @@ +package test + +import ( + "testing" + + "github.com/jimeh/go-tmux" + "github.com/stretchr/testify/assert" +) + +func TestBasicTheme(t *testing.T) { + tmuxSetup() + defer tmuxTearDown() + + theme := "../basic.tmuxtheme" + + _, err := tm.Exec("source-file", theme) + assert.NoErrorf(t, err, `%s: Failed to load theme`, theme) + + tmuxHasOptions(t, theme, tmux.GlobalWindow, tmux.Options{ + "clock-mode-colour": "red", + "clock-mode-style": "24", + "mode-style": "bg=red", + "pane-active-border-style": "fg=green", + "pane-border-style": "default", + "window-status-activity-style": "fg=yellow,bg=black", + "window-status-current-format": " #I:#W#F ", + "window-status-current-style": "fg=black,bg=red", + "window-status-format": " #I:#W#F ", + "window-status-separator": "", + }) + + tmuxHasOptions(t, theme, tmux.GlobalSession, tmux.Options{ + "display-panes-active-colour": "default", + "display-panes-colour": "default", + "message-command-style": "default", + "message-style": "default", + "status-interval": "1", + "status-justify": "centre", + "status-left": "#S #[fg=white]» #[fg=yellow]#I #[fg=cyan]#P", + "status-left-length": "40", + "status-left-style": "fg=green,bg=black", + "status-right": "#H #[fg=white]« #[fg=yellow]%H:%M:%S #[fg=green]%d-%b-%y", + "status-right-length": "40", + "status-right-style": "fg=cyan,bg=black", + "status-style": "fg=cyan,bg=black", + }) +} diff --git a/test/default_test.go b/test/default_test.go new file mode 100644 index 0000000..73c397b --- /dev/null +++ b/test/default_test.go @@ -0,0 +1,46 @@ +package test + +import ( + "testing" + + "github.com/jimeh/go-tmux" + "github.com/stretchr/testify/assert" +) + +func TestDefaultTheme(t *testing.T) { + tmuxSetup() + defer tmuxTearDown() + theme := "../default.tmuxtheme" + + _, err := tm.Exec("source-file", theme) + assert.NoErrorf(t, err, `%s: Failed to load theme`, theme) + + tmuxHasOptions(t, theme, tmux.GlobalWindow, tmux.Options{ + "clock-mode-colour": "blue", + "clock-mode-style": "24", + "mode-style": "fg=black,bg=yellow", + "pane-active-border-style": "fg=green", + "pane-border-style": "fg=white", + "window-status-activity-style": "fg=green,bg=black", + "window-status-current-format": "#I:#W#F", + "window-status-current-style": "fg=black,bg=green", + "window-status-format": "#I:#W#F", + "window-status-separator": " ", + }) + + tmuxHasOptions(t, theme, tmux.GlobalSession, tmux.Options{ + "display-panes-active-colour": "red", + "display-panes-colour": "blue", + "message-command-style": "fg=black,bg=green", + "message-style": "fg=black,bg=yellow", + "status-interval": "15", + "status-justify": "left", + "status-left": "[#S]", + "status-left-length": "10", + "status-left-style": "fg=black,bg=green", + "status-right": "\"#H\" %H:%M %d-%b-%y", + "status-right-length": "40", + "status-right-style": "fg=black,bg=green", + "status-style": "fg=black,bg=green", + }) +} diff --git a/test/go.mod b/test/go.mod new file mode 100644 index 0000000..1fc9fc0 --- /dev/null +++ b/test/go.mod @@ -0,0 +1,8 @@ +module github.com/jimeh/tmux-themepack/test + +go 1.13 + +require ( + github.com/jimeh/go-tmux v0.0.2 + github.com/stretchr/testify v1.4.0 +) diff --git a/test/go.sum b/test/go.sum new file mode 100644 index 0000000..6922439 --- /dev/null +++ b/test/go.sum @@ -0,0 +1,14 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/jimeh/go-tmux v0.0.2 h1:oKM7E2kn+1A11XLWIZD7xVBskynkCX4ouBKcELMuzXY= +github.com/jimeh/go-tmux v0.0.2/go.mod h1:KqcevyuQeWQwdokZLQ2RisV/PYqAXoWVyzhf0ciICbw= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/test/powerline_block_test.go b/test/powerline_block_test.go new file mode 100644 index 0000000..423380d --- /dev/null +++ b/test/powerline_block_test.go @@ -0,0 +1,100 @@ +package test + +import ( + "testing" + + "github.com/jimeh/go-tmux" + "github.com/stretchr/testify/assert" +) + +func TestPowerlineBlockThemes(t *testing.T) { + tests := []struct { + filename string + color1 string + color2 string + }{ + { + filename: "../powerline/block/blue.tmuxtheme", + color1: "colour24", + color2: "colour31", + }, + { + filename: "../powerline/block/cyan.tmuxtheme", + color1: "colour39", + color2: "colour75", + }, + { + filename: "../powerline/block/gray.tmuxtheme", + color1: "colour245", + color2: "colour245", + }, + { + filename: "../powerline/block/green.tmuxtheme", + color1: "colour100", + color2: "colour107", + }, + { + filename: "../powerline/block/magenta.tmuxtheme", + color1: "colour125", + color2: "colour129", + }, + { + filename: "../powerline/block/orange.tmuxtheme", + color1: "colour130", + color2: "colour130", + }, + { + filename: "../powerline/block/purple.tmuxtheme", + color1: "colour90", + color2: "colour141", + }, + { + filename: "../powerline/block/red.tmuxtheme", + color1: "colour88", + color2: "colour124", + }, + { + filename: "../powerline/block/yellow.tmuxtheme", + color1: "colour227", + color2: "colour229", + }, + } + + for _, tt := range tests { + tmuxSetup() + + _, err := tm.Exec("source-file", tt.filename) + assert.NoErrorf(t, err, `%s: Failed to load theme`, tt.filename) + + tmuxHasOptions(t, tt.filename, tmux.GlobalWindow, tmux.Options{ + "clock-mode-colour": tt.color1, + "clock-mode-style": "24", + "mode-style": "fg=black,bg=" + tt.color1, + "pane-active-border-style": "fg=" + tt.color1, + "pane-border-style": "fg=colour238", + "window-status-activity-style": "fg=" + tt.color2 + ",bg=colour233", + "window-status-current-format": " #I:#W#F ", + "window-status-current-style": "fg=black,bg=" + tt.color1, + "window-status-format": " #I:#W#F ", + "window-status-separator": "", + }) + + tmuxHasOptions(t, tt.filename, tmux.GlobalSession, tmux.Options{ + "display-panes-active-colour": "colour245", + "display-panes-colour": "colour233", + "message-command-style": "fg=black,bg=" + tt.color1, + "message-style": "fg=black,bg=" + tt.color1, + "status-interval": "1", + "status-justify": "centre", + "status-left": "#[fg=colour233,bg=" + tt.color1 + ",bold] #S #[fg=" + tt.color1 + ",bg=colour240,nobold]\ue0b0#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]\ue0b0#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]\ue0b0", + "status-left-length": "40", + "status-left-style": "fg=colour243,bg=colour233", + "status-right": "#[fg=colour235,bg=colour233]\ue0b2#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]\ue0b2#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]\ue0b2#[fg=colour233,bg=colour245,bold] #H ", + "status-right-length": "150", + "status-right-style": "fg=colour243,bg=colour233", + "status-style": "fg=colour240,bg=colour233", + }) + + tmuxTearDown() + } +} diff --git a/test/powerline_default_test.go b/test/powerline_default_test.go new file mode 100644 index 0000000..08acab6 --- /dev/null +++ b/test/powerline_default_test.go @@ -0,0 +1,100 @@ +package test + +import ( + "testing" + + "github.com/jimeh/go-tmux" + "github.com/stretchr/testify/assert" +) + +func TestPowerlineDefaultThemes(t *testing.T) { + tests := []struct { + filename string + color1 string + color2 string + }{ + { + filename: "../powerline/default/blue.tmuxtheme", + color1: "colour24", + color2: "colour33", + }, + { + filename: "../powerline/default/cyan.tmuxtheme", + color1: "colour39", + color2: "colour81", + }, + { + filename: "../powerline/default/gray.tmuxtheme", + color1: "colour245", + color2: "colour250", + }, + { + filename: "../powerline/default/green.tmuxtheme", + color1: "colour100", + color2: "colour190", + }, + { + filename: "../powerline/default/magenta.tmuxtheme", + color1: "colour125", + color2: "colour127", + }, + { + filename: "../powerline/default/orange.tmuxtheme", + color1: "colour130", + color2: "colour166", + }, + { + filename: "../powerline/default/purple.tmuxtheme", + color1: "colour90", + color2: "colour129", + }, + { + filename: "../powerline/default/red.tmuxtheme", + color1: "colour88", + color2: "colour160", + }, + { + filename: "../powerline/default/yellow.tmuxtheme", + color1: "colour227", + color2: "colour227", + }, + } + + for _, tt := range tests { + tmuxSetup() + + _, err := tm.Exec("source-file", tt.filename) + assert.NoErrorf(t, err, `%s: Failed to load theme`, tt.filename) + + tmuxHasOptions(t, tt.filename, tmux.GlobalWindow, tmux.Options{ + "clock-mode-colour": tt.color1, + "clock-mode-style": "24", + "mode-style": "fg=black,bg=" + tt.color1, + "pane-active-border-style": "fg=" + tt.color1, + "pane-border-style": "fg=colour238", + "window-status-activity-style": "fg=colour245,bg=colour233", + "window-status-current-format": "#[fg=colour233,bg=black]\ue0b0#[fg=" + tt.color2 + ",nobold] #I:#W#F #[fg=colour233,bg=black,nobold]\ue0b2", + "window-status-current-style": "fg=colour235,bg=colour100", + "window-status-format": " #I:#W#F ", + "window-status-separator": "", + }) + + tmuxHasOptions(t, tt.filename, tmux.GlobalSession, tmux.Options{ + "display-panes-active-colour": "colour245", + "display-panes-colour": "colour233", + "message-command-style": "fg=black,bg=" + tt.color1, + "message-style": "fg=black,bg=" + tt.color1, + "status-interval": "1", + "status-justify": "centre", + "status-left": "#[fg=colour233,bg=" + tt.color1 + ",bold] #S #[fg=" + tt.color1 + ",bg=colour240,nobold]\ue0b0#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]\ue0b0#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]\ue0b0", + "status-left-length": "40", + "status-left-style": "fg=colour243,bg=colour233", + "status-right": "#[fg=colour235,bg=colour233]\ue0b2#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]\ue0b2#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour245,bg=colour240]\ue0b2#[fg=colour233,bg=colour245,bold] #H ", + "status-right-length": "150", + "status-right-style": "fg=colour243,bg=colour233", + "status-style": "fg=colour240,bg=colour233", + }) + + tmuxTearDown() + } +} diff --git a/test/powerline_double_test.go b/test/powerline_double_test.go new file mode 100644 index 0000000..69849fa --- /dev/null +++ b/test/powerline_double_test.go @@ -0,0 +1,95 @@ +package test + +import ( + "testing" + + "github.com/jimeh/go-tmux" + "github.com/stretchr/testify/assert" +) + +func TestPowerlineDoubleThemes(t *testing.T) { + tests := []struct { + filename string + color1 string + color2 string + }{ + { + filename: "../powerline/double/blue.tmuxtheme", + color1: "colour24", + color2: "colour33", + }, + { + filename: "../powerline/double/cyan.tmuxtheme", + color1: "colour39", + color2: "colour81", + }, + { + filename: "../powerline/double/green.tmuxtheme", + color1: "colour100", + color2: "colour190", + }, + { + filename: "../powerline/double/magenta.tmuxtheme", + color1: "colour125", + color2: "colour127", + }, + { + filename: "../powerline/double/orange.tmuxtheme", + color1: "colour130", + color2: "colour166", + }, + { + filename: "../powerline/double/purple.tmuxtheme", + color1: "colour90", + color2: "colour129", + }, + { + filename: "../powerline/double/red.tmuxtheme", + color1: "colour88", + color2: "colour160", + }, + { + filename: "../powerline/double/yellow.tmuxtheme", + color1: "colour227", + color2: "colour227", + }, + } + + for _, tt := range tests { + tmuxSetup() + + _, err := tm.Exec("source-file", tt.filename) + assert.NoErrorf(t, err, `%s: Failed to load theme`, tt.filename) + + tmuxHasOptions(t, tt.filename, tmux.GlobalWindow, tmux.Options{ + "clock-mode-colour": tt.color1, + "clock-mode-style": "24", + "mode-style": "fg=black,bg=" + tt.color1, + "pane-active-border-style": "fg=" + tt.color1, + "pane-border-style": "fg=colour238", + "window-status-activity-style": "fg=colour245,bg=colour233", + "window-status-current-format": "#[fg=colour233,bg=black]\ue0b0#[fg=" + tt.color2 + ",nobold] #I:#W#F #[fg=colour233,bg=black,nobold]\ue0b2", + "window-status-current-style": "fg=colour235,bg=colour100", + "window-status-format": " #I:#W#F ", + "window-status-separator": "", + }) + + tmuxHasOptions(t, tt.filename, tmux.GlobalSession, tmux.Options{ + "display-panes-active-colour": "colour245", + "display-panes-colour": "colour233", + "message-command-style": "fg=black,bg=" + tt.color1, + "message-style": "fg=black,bg=" + tt.color1, + "status-interval": "1", + "status-justify": "centre", + "status-left": "#[fg=colour233,bg=" + tt.color1 + ",bold] #S #[fg=" + tt.color1 + ",bg=colour240,nobold]\ue0b0#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]\ue0b0#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]\ue0b0", + "status-left-length": "40", + "status-left-style": "fg=colour243,bg=colour233", + "status-right": "#[fg=colour235,bg=colour233]\ue0b2#[fg=colour240,bg=colour235] %H:%M:%S #[fg=colour240,bg=colour235]\ue0b2#[fg=colour233,bg=colour240] %d-%b-%y #[fg=" + tt.color1 + ",bg=colour240]\ue0b2#[fg=colour233,bg=" + tt.color1 + ",bold] #H ", + "status-right-length": "150", + "status-right-style": "fg=colour243,bg=colour233", + "status-style": "fg=colour240,bg=colour233", + }) + + tmuxTearDown() + } +} diff --git a/test/setup_test.go b/test/setup_test.go new file mode 100644 index 0000000..43a4aed --- /dev/null +++ b/test/setup_test.go @@ -0,0 +1,63 @@ +package test + +import ( + "log" + "os" + "testing" + + "github.com/jimeh/go-tmux" + "github.com/stretchr/testify/assert" +) + +var tm = tmux.New() +var tmuxVersion = os.Getenv("TMUX_VERSION") +var tmuxBinPath = os.Getenv("TMUX_BIN_PATH") +var tmuxConfig = os.Getenv("TMUX_CONFIG") + +func tmuxSetup() { + if tmuxBinPath != "" { + tm.BinPath = tmuxBinPath + } + tm.SocketPath = "./tmux-test-socket" + + if tmuxConfig != "" { + tmuxConfig = "./tmux.conf" + } + + _, err := tm.Exec("-f", tmuxConfig, "new-session", "-d", "sleep", "30") + if err != nil { + log.Fatal(err) + } +} + +func tmuxTearDown() { + _, err := tm.Exec("kill-server") + if err != nil { + log.Fatal(err) + } + + if tm.SocketPath != "" { + err = os.Remove(tm.SocketPath) + if err != nil { + log.Fatal(err) + } + } +} + +func tmuxHasOptions(t *testing.T, theme string, s tmux.Scope, m tmux.Options) { + opts, err := tm.GetOptions(s) + assert.NoErrorf(t, err, `%s: Failed to get options`, theme) + + if err == nil { + for k, v := range m { + _, ok := opts[k] + assert.Truef(t, ok, `%s: Key "%s" is not available`, theme, k) + if ok { + assert.Equalf(t, + v, opts[k], + `%s: Key "%s" is not "%s"`, theme, k, v, + ) + } + } + } +} diff --git a/test/tmux.conf b/test/tmux.conf new file mode 100644 index 0000000..3860cae --- /dev/null +++ b/test/tmux.conf @@ -0,0 +1 @@ +# Empty config used for tests diff --git a/test/version_test.go b/test/version_test.go new file mode 100644 index 0000000..5c1a4ba --- /dev/null +++ b/test/version_test.go @@ -0,0 +1,25 @@ +package test + +import ( + "bytes" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestTmuxVersion(t *testing.T) { + tmuxSetup() + defer tmuxTearDown() + + if tmuxVersion != "" { + out, err := tm.Exec("-V") + require.NoError(t, err) + + assert.Equal( + t, + "tmux "+tmuxVersion, + string(bytes.TrimSpace(out)), + ) + } +}