feat: Make all themes easily user-customizable

This is achieved by using custom @-prefixed tmux options which are set
with the `-o` option, meaning, the theme will only set the value if it
is not already set.

This allows users to override any of the options in the theme by simply
setting them before loading the theme.

Additionally all themes are now generated using a custom theme builder,
that allows sharing various parts of themes between them easily.
This commit is contained in:
2019-04-30 01:48:12 +01:00
parent 26012e0d6c
commit ba8616db4c
84 changed files with 3467 additions and 1519 deletions

24
src/_apply.tmuxsh Normal file
View File

@@ -0,0 +1,24 @@
# Apply theme options
set -gF display-panes-active-colour "#{@theme-display-panes-active-colour}"
set -gF display-panes-colour "#{@theme-display-panes-colour}"
set -gF message-command-style "fg=#{@theme-message-command-fg},bg=#{@theme-message-command-bg}"
set -gF message-style "fg=#{@theme-message-fg},bg=#{@theme-message-bg}"
set -gF status-interval "#{@theme-status-interval}"
set -gF status-justify "#{@theme-status-justify}"
set -gF status-left "#{@theme-status-left}"
set -gF status-left-length "#{@theme-status-left-length}"
set -gF status-left-style "fg=#{@theme-status-left-fg},bg=#{@theme-status-left-bg}"
set -gF status-right "#{@theme-status-right}"
set -gF status-right-length "#{@theme-status-right-length}"
set -gF status-right-style "fg=#{@theme-status-right-fg},bg=#{@theme-status-right-bg}"
set -gF status-style "fg=#{@theme-status-fg},bg=#{@theme-status-bg}"
set -gwF clock-mode-colour "#{@theme-clock-mode-colour}"
set -gwF clock-mode-style "#{@theme-clock-mode-style}"
set -gwF mode-style "fg=#{@theme-mode-fg},bg=#{@theme-mode-bg}"
set -gwF pane-active-border-style "fg=#{@theme-pane-active-border-fg},bg=#{@theme-pane-active-border-bg}"
set -gwF pane-border-style "fg=#{@theme-pane-border-fg},bg=#{@theme-pane-border-bg}"
set -gwF window-status-activity-style "fg=#{@theme-window-status-activity-fg},bg=#{@theme-window-status-activity-bg}"
set -gwF window-status-current-format "#{@theme-window-status-current-format}"
set -gwF window-status-current-style "fg=#{@theme-window-status-current-fg},bg=#{@theme-window-status-current-bg}"
set -gwF window-status-format "#{@theme-window-status-format}"
set -gwF window-status-separator "#{@theme-window-status-separator}"

50
src/basic.tmuxtheme Normal file
View File

@@ -0,0 +1,50 @@
#
# Basic theme
#
# Themepack format options
set -goq @themepack-status-left-area-left-format "#S"
set -goq @themepack-status-left-area-middle-format "#I"
set -goq @themepack-status-left-area-right-format "#P"
set -goq @themepack-status-right-area-left-format "#H"
set -goq @themepack-status-right-area-middle-format "%H:%M:%S"
set -goq @themepack-status-right-area-right-format "%d-%b-%y"
set -goq @themepack-window-status-current-format "#I:#W#F"
set -goq @themepack-window-status-format "#I:#W#F"
# Theme options
set -goq @theme-clock-mode-colour red
set -goq @theme-clock-mode-style 24
set -goq @theme-display-panes-active-colour default
set -goq @theme-display-panes-colour default
set -goq @theme-message-bg default
set -goq @theme-message-command-bg default
set -goq @theme-message-command-fg default
set -goq @theme-message-fg default
set -goq @theme-mode-bg red
set -goq @theme-mode-fg default
set -goq @theme-pane-active-border-bg default
set -goq @theme-pane-active-border-fg green
set -goq @theme-pane-border-bg default
set -goq @theme-pane-border-fg default
set -goq @theme-status-bg black
set -goq @theme-status-fg cyan
set -goq @theme-status-interval 1
set -goq @theme-status-justify centre
set -goqF @theme-status-left "#{@themepack-status-left-area-left-format} #[fg=white]» #[fg=yellow]#{@themepack-status-left-area-middle-format} #[fg=cyan]#{@themepack-status-left-area-right-format}"
set -goq @theme-status-left-bg black
set -goq @theme-status-left-fg green
set -goq @theme-status-left-length 40
set -goqF @theme-status-right "#{@themepack-status-right-area-left-format} #[fg=white]« #[fg=yellow]#{@themepack-status-right-area-middle-format} #[fg=green]#{@themepack-status-right-area-right-format}"
set -goq @theme-status-right-bg black
set -goq @theme-status-right-fg cyan
set -goq @theme-status-right-length 40
set -goq @theme-window-status-activity-bg black
set -goq @theme-window-status-activity-fg yellow
set -goq @theme-window-status-current-bg red
set -goq @theme-window-status-current-fg black
set -goqF @theme-window-status-current-format " #{@themepack-window-status-current-format} "
set -goqF @theme-window-status-format " #{@themepack-window-status-format} "
set -goq @theme-window-status-separator ""
#= include "_apply"

44
src/default.tmuxtheme Normal file
View File

@@ -0,0 +1,44 @@
#
# Default Tmux Theme
#
# This theme matches Tmux's default style as closely as possible. It functions
# as a template for creating new themes, and as a way to reset a running Tmux
# server's style to it's defaults.
# Theme options
set -goq @theme-clock-mode-colour blue
set -goq @theme-clock-mode-style 24
set -goq @theme-display-panes-active-colour red
set -goq @theme-display-panes-colour blue
set -goq @theme-message-bg yellow
set -goq @theme-message-command-bg green
set -goq @theme-message-command-fg black
set -goq @theme-message-fg black
set -goq @theme-mode-bg yellow
set -goq @theme-mode-fg black
set -goq @theme-pane-active-border-bg default
set -goq @theme-pane-active-border-fg green
set -goq @theme-pane-border-bg default
set -goq @theme-pane-border-fg white
set -goq @theme-status-bg green
set -goq @theme-status-fg black
set -goq @theme-status-interval 15
set -goq @theme-status-justify left
set -goq @theme-status-left "[#S] "
set -goq @theme-status-left-bg green
set -goq @theme-status-left-fg black
set -goq @theme-status-left-length 40
set -goq @theme-status-right " \"#H\" %H:%M %d-%b-%y"
set -goq @theme-status-right-bg green
set -goq @theme-status-right-fg black
set -goq @theme-status-right-length 40
set -goq @theme-window-status-activity-bg black
set -goq @theme-window-status-activity-fg green
set -goq @theme-window-status-current-bg green
set -goq @theme-window-status-current-fg black
set -goq @theme-window-status-current-format "#I:#W#F"
set -goq @theme-window-status-format "#I:#W#F"
set -goq @theme-window-status-separator " "
#= include "_apply"

View File

@@ -0,0 +1,7 @@
set -goq @powerline-color-black-1 black
set -goq @powerline-color-grey-1 colour233
set -goq @powerline-color-grey-2 colour235
set -goq @powerline-color-grey-3 colour238
set -goq @powerline-color-grey-4 colour240
set -goq @powerline-color-grey-5 colour243
set -goq @powerline-color-grey-6 colour245

View File

@@ -0,0 +1,3 @@
set -goq @powerline-color-main-1 colour24
set -goq @powerline-color-main-2 colour33
set -goq @powerline-color-main-3 colour31

View File

@@ -0,0 +1,3 @@
set -goq @powerline-color-main-1 colour39
set -goq @powerline-color-main-2 colour81
set -goq @powerline-color-main-3 colour75

View File

@@ -0,0 +1,3 @@
set -goq @powerline-color-main-1 colour245
set -goq @powerline-color-main-2 colour250
set -goq @powerline-color-main-3 colour245

View File

@@ -0,0 +1,3 @@
set -goq @powerline-color-main-1 colour100
set -goq @powerline-color-main-2 colour190
set -goq @powerline-color-main-3 colour107

View File

@@ -0,0 +1,3 @@
set -goq @powerline-color-main-1 colour125
set -goq @powerline-color-main-2 colour127
set -goq @powerline-color-main-3 colour129

View File

@@ -0,0 +1,3 @@
set -goq @powerline-color-main-1 colour130
set -goq @powerline-color-main-2 colour166
set -goq @powerline-color-main-3 colour130

View File

@@ -0,0 +1,3 @@
set -goq @powerline-color-main-1 colour90
set -goq @powerline-color-main-2 colour129
set -goq @powerline-color-main-3 colour141

View File

@@ -0,0 +1,3 @@
set -goq @powerline-color-main-1 colour88
set -goq @powerline-color-main-2 colour160
set -goq @powerline-color-main-3 colour124

View File

@@ -0,0 +1,3 @@
set -goq @powerline-color-main-1 colour227
set -goq @powerline-color-main-2 colour227
set -goq @powerline-color-main-3 colour229

View File

@@ -0,0 +1,9 @@
# Themepack format options
set -goq @themepack-status-left-area-left-format "#S"
set -goq @themepack-status-left-area-middle-format "#(whoami)"
set -goq @themepack-status-left-area-right-format "#I:#P"
set -goq @themepack-status-right-area-left-format "%H:%M:%S"
set -goq @themepack-status-right-area-middle-format "%d-%b-%y"
set -goq @themepack-status-right-area-right-format "#H"
set -goq @themepack-window-status-current-format "#I:#W#F"
set -goq @themepack-window-status-format "#I:#W#F"

View File

@@ -0,0 +1,7 @@
# https://github.com/jimeh/tmux-themepack
#
# Inspired by vim-powerline: https://github.com/powerline/powerline
#
# Requires terminal to be using a powerline compatible font, find one here:
# https://github.com/powerline/fonts
#

View File

@@ -0,0 +1,20 @@
# Powerline options
set -goqF @powerline-color-activity-1 "#{@powerline-color-grey-6}"
set -goqF @powerline-status-bg "#{@powerline-color-grey-1}"
set -goqF @powerline-status-fg "#{@powerline-color-grey-4}"
set -goqF @powerline-status-left-area-left-bg "#{@powerline-color-main-1}"
set -goqF @powerline-status-left-area-left-fg "#{@powerline-status-bg}"
set -goqF @powerline-status-left-area-middle-bg "#{@powerline-status-fg}"
set -goqF @powerline-status-left-area-middle-fg "#{@powerline-status-bg}"
set -goqF @powerline-status-left-area-right-bg "#{@powerline-color-grey-2}"
set -goqF @powerline-status-left-area-right-fg "#{@powerline-status-fg}"
set -goqF @powerline-status-left-bg "#{@powerline-color-grey-1}"
set -goqF @powerline-status-left-fg "#{@powerline-color-grey-5}"
set -goqF @powerline-status-right-area-left-bg "#{@powerline-color-grey-2}"
set -goqF @powerline-status-right-area-left-fg "#{@powerline-status-fg}"
set -goqF @powerline-status-right-area-middle-bg "#{@powerline-status-fg}"
set -goqF @powerline-status-right-area-middle-fg "#{@powerline-status-bg}"
set -goqF @powerline-status-right-area-right-bg "#{@powerline-color-grey-6}"
set -goqF @powerline-status-right-area-right-fg "#{@powerline-status-bg}"
set -goqF @powerline-status-right-bg "#{@powerline-color-grey-1}"
set -goqF @powerline-status-right-fg "#{@powerline-color-grey-5}"

View File

@@ -0,0 +1,27 @@
# Theme options
set -goqF @theme-clock-mode-colour "#{@powerline-color-main-1}"
set -goq @theme-clock-mode-style 24
set -goqF @theme-display-panes-active-colour "#{@powerline-color-grey-6}"
set -goqF @theme-display-panes-colour "#{@powerline-color-grey-1}"
set -goqF @theme-message-bg "#{@powerline-color-main-1}"
set -goqF @theme-message-command-bg "#{@powerline-color-main-1}"
set -goqF @theme-message-command-fg "#{@powerline-color-black-1}"
set -goqF @theme-message-fg "#{@powerline-color-black-1}"
set -goqF @theme-mode-bg "#{@powerline-color-main-1}"
set -goqF @theme-mode-fg "#{@powerline-color-black-1}"
set -goq @theme-pane-active-border-bg default
set -goqF @theme-pane-active-border-fg "#{@powerline-color-main-1}"
set -goq @theme-pane-border-bg default
set -goqF @theme-pane-border-fg "#{@powerline-color-grey-3}"
set -goqF @theme-status-bg "#{@powerline-status-bg}"
set -goqF @theme-status-fg "#{@powerline-status-fg}"
set -goq @theme-status-interval 1
set -goq @theme-status-justify centre
set -goqF @theme-status-left "#[fg=#{@powerline-status-left-area-left-fg},bg=#{@powerline-status-left-area-left-bg},bold] #{@themepack-status-left-area-left-format} #[fg=#{@powerline-status-left-area-left-bg},bg=#{@powerline-status-left-area-middle-bg},nobold]#[fg=#{@powerline-status-left-area-middle-fg},bg=#{@powerline-status-left-area-middle-bg}] #{@themepack-status-left-area-middle-format} #[fg=#{@powerline-status-left-area-middle-bg},bg=#{@powerline-status-left-area-right-bg}]#[fg=#{@powerline-status-left-area-right-fg},bg=#{@powerline-status-left-area-right-bg}] #{@themepack-status-left-area-right-format} #[fg=#{@powerline-status-left-area-right-bg},bg=#{@theme-status-bg},nobold]"
set -goqF @theme-status-left-bg "#{@powerline-status-left-bg}"
set -goqF @theme-status-left-fg "#{@powerline-status-left-fg}"
set -goq @theme-status-left-length 40
set -goqF @theme-status-right "#[fg=#{@powerline-status-right-area-left-bg},bg=#{@theme-status-bg}]#[fg=#{@powerline-status-right-area-left-fg},bg=#{@powerline-status-right-area-left-bg}] #{@themepack-status-right-area-left-format} #[fg=#{@powerline-status-right-area-middle-bg},bg=#{@powerline-status-right-area-left-bg}]#[fg=#{@powerline-status-right-area-middle-fg},bg=#{@powerline-status-right-area-middle-bg}] #{@themepack-status-right-area-middle-format} #[fg=#{@powerline-status-right-area-right-bg},bg=#{@powerline-status-right-area-middle-bg}]#[fg=#{@powerline-status-right-area-right-fg},bg=#{@powerline-status-right-area-right-bg},bold] #{@themepack-status-right-area-right-format} "
set -goqF @theme-status-right-bg "#{@powerline-status-right-bg}"
set -goqF @theme-status-right-fg "#{@powerline-status-right-fg}"
set -goq @theme-status-right-length 150

View File

@@ -0,0 +1,7 @@
set -goqF @theme-window-status-activity-bg "#{@theme-status-bg}"
set -goqF @theme-window-status-activity-fg "#{@powerline-color-activity-1}"
set -goqF @theme-window-status-current-bg "#{@powerline-color-main-1}"
set -goqF @theme-window-status-current-fg "#{@powerline-color-black-1}"
set -goq @theme-window-status-separator ""
set -goqF @theme-window-status-format " #{@themepack-window-status-format} "
set -goqF @theme-window-status-current-format " #{@themepack-window-status-current-format} "

View File

@@ -0,0 +1,7 @@
set -goqF @theme-window-status-activity-bg "#{@theme-status-bg}"
set -goqF @theme-window-status-activity-fg "#{@powerline-color-activity-1}"
set -goqF @theme-window-status-current-bg "#{@powerline-color-black-1}"
set -goqF @theme-window-status-current-fg "#{@powerline-color-main-2}"
set -goq @theme-window-status-separator ""
set -goqF @theme-window-status-format " #{@themepack-window-status-format} "
set -goqF @theme-window-status-current-format "#[fg=#{@theme-status-bg},bg=#{@theme-window-status-current-bg}]#[fg=#{@theme-window-status-current-fg},nobold] #{@themepack-window-status-current-format} #[fg=#{@theme-status-bg},bg=#{@theme-window-status-current-bg},nobold]"

View File

@@ -0,0 +1,11 @@
#= include "powerline/_colors/base"
# Powerline Block Override
set -goqF @powerline-color-activity-1 "#{@powerline-color-main-3}"
#= include "powerline/_powerline-options"
#= include "powerline/_theme-options"
#= include "powerline/_window-status-block"
#= include "_apply"

View File

@@ -0,0 +1,9 @@
#
# Powerline Blue Block - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/blue"
#= include "powerline/block/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Cyan Block - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/cyan"
#= include "powerline/block/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Gray Block - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/gray"
#= include "powerline/block/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Green Block - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/green"
#= include "powerline/block/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Magenta Block - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/magenta"
#= include "powerline/block/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Orange Block - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/orange"
#= include "powerline/block/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Purple Block - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/purple"
#= include "powerline/block/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Red Block - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/red"
#= include "powerline/block/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Yellow Block - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/yellow"
#= include "powerline/block/_base"

View File

@@ -0,0 +1,8 @@
#= include "powerline/_colors/base"
#= include "powerline/_powerline-options"
#= include "powerline/_theme-options"
#= include "powerline/_window-status-default"
#= include "_apply"

View File

@@ -0,0 +1,9 @@
#
# Powerline Blue - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/blue"
#= include "powerline/default/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Cyan - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/cyan"
#= include "powerline/default/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Gray - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/gray"
#= include "powerline/default/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Green - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/green"
#= include "powerline/default/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Magenta - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/magenta"
#= include "powerline/default/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Orange - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/orange"
#= include "powerline/default/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Purple - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/purple"
#= include "powerline/default/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Red - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/red"
#= include "powerline/default/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Yellow - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/yellow"
#= include "powerline/default/_base"

View File

@@ -0,0 +1,11 @@
#= include "powerline/_colors/base"
# Powerline Double Override
set -goqF @powerline-status-right-area-right-bg "#{@powerline-color-main-1}"
#= include "powerline/_powerline-options"
#= include "powerline/_theme-options"
#= include "powerline/_window-status-default"
#= include "_apply"

View File

@@ -0,0 +1,9 @@
#
# Powerline Double Blue - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/blue"
#= include "powerline/double/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Double Cyan - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/cyan"
#= include "powerline/double/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Double Green - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/green"
#= include "powerline/double/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Double Magenta - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/magenta"
#= include "powerline/double/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Double Orange - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/orange"
#= include "powerline/double/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Double Purple - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/purple"
#= include "powerline/double/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Double Red - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/red"
#= include "powerline/double/_base"

View File

@@ -0,0 +1,9 @@
#
# Powerline Double Yellow - Tmux Themepack
#= include "powerline/_info"
#= include "powerline/_formats"
# Powerline color options
#= include "powerline/_colors/yellow"
#= include "powerline/double/_base"