diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b5ede06 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# Editors +.idea/ + +# vim +*.swp +*.swo +*~ + +# Systems +**/.DS_Store diff --git a/CHANGELOG.md b/CHANGELOG.md index 63d0ef0..d4c5050 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Added CHANGELOG file ([#9](https://github.com/egel/tmux-gruvbox/issues/9)) - Added theme installable through TPM ([#4](https://github.com/egel/tmux-gruvbox/issues/4)) +- Added light-medium theme ([#3](https://github.com/egel/tmux-gruvbox/issues/3)] ### Changed ### Deprecated diff --git a/README.md b/README.md index 948e272..1c67285 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,17 @@ # Gruvbox color theme configuration for Tmux -Theme with 'retro groove' flavor for [Tmux][github-tmux], based on Pavel Pertsev's [gruvbox colorscheme][github-grovbox] and inspired by work of [Gordon Chiam](https://gist.github.com/gchiam/4606522f513cc64b79ce). +Theme with 'retro groove' flavor for [Tmux][github-tmux], based on Pavel Pertsev's [gruvbox colorscheme][github-grovbox] and inspired by work of [Gordon Chiam](https://gist.github.com/gchiam/4606522f513cc64b79ce). Subthemes switching inspired by [tmux-color-solarized][tmux-color-solarized]. -> Screenshot made from Mac OSX builtin terminal with xterm-256color and [Hack font][github-hack]. - - +> Screenshots made from macOS builtin terminal with xterm-256color and [Hack font][github-hack]. +| Dark theme | Light theme | +|---|---| +| | | ## Installation + ### Install manually + The simplest way is just: > HINT: Always make a backup of your config files before any action. @@ -18,17 +21,21 @@ cat tmux-gruvbox-dark.conf >> ~/.tmux.conf ``` ### Install through [Tmux Plugin Manager](https://github.com/tmux-plugins/tpm) -Add plugin to the list of TPM plugins in `.tmux.conf` -``` + +Add plugin to the list of TPM plugins in `.tmux.conf` and select desired theme + +```bash set -g @plugin 'egel/tmux-gruvbox' +set -g @tmux-gruvbox 'dark' # or 'light' ``` -Hit `prefix + I` to fetch the plugin and source it. -Your tmux should be updated with the theme at this point. + +Hit `prefix + I` to fetch the plugin and source it. Your Tmux should be updated with the theme at this point. ## License + GPLv3 - Maciej Sypień [github-tmux]: https://github.com/tmux/tmux [github-grovbox]: https://github.com/morhetz/gruvbox [github-hack]: https://github.com/chrissimpkins/Hack - +[tmux-color-solarized]: https://github.com/seebi/tmux-colors-solarized diff --git a/gruvbox-tpm.tmux b/gruvbox-tpm.tmux index 3743475..532e119 100755 --- a/gruvbox-tpm.tmux +++ b/gruvbox-tpm.tmux @@ -1,4 +1,25 @@ #!/usr/bin/env bash CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -tmux source-file "$CURRENT_DIR/tmux-gruvbox-dark.conf" +THEME_OPTION="@tmux-gruvbox" +DEFAULT_THEME="dark" + +get_theme() { + local option="$1" + local default_value="$2" + local option_value + option_value=$(tmux show-option -gqv "$option") + if [ -z "$option_value" ]; then + print "$default_value" + else + print "$option_value" + fi +} + +main() { + local theme + theme=$(get_theme "$THEME_OPTION" "$DEFAULT_THEME") + tmux source-file "$CURRENT_DIR/tmux-gruvbox-${theme}.conf" +} + +main diff --git a/tmux-gruvbox-dark.conf b/tmux-gruvbox-dark.conf index 469110a..5c8961f 100644 --- a/tmux-gruvbox-dark.conf +++ b/tmux-gruvbox-dark.conf @@ -1,4 +1,4 @@ -## COLORSCHEME: gruvbox dark +## COLORSCHEME: gruvbox dark (medium) set-option -g status "on" # default statusbar color @@ -35,14 +35,16 @@ set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # bg=red ## Theme settings mixed with colors (unfortunately, but there is no cleaner way) set-option -g status-justify "left" -set-option -g status-left-style none +set-option -g status-left-style attr="none" set-option -g status-left-length "80" set-option -g status-right-style none set-option -g status-right-length "80" set-window-option -g window-status-separator "" -set-option -g status-left "#[fg=colour248, bg=colour241] #S #[fg=colour241, bg=colour237, nobold, noitalics, nounderscore]" -set-option -g status-right "#[fg=colour239, bg=colour237, nobold, nounderscore, noitalics]#[fg=colour246,bg=colour239] %Y-%m-%d  %H:%M #[fg=colour248, bg=colour239, nobold, noitalics, nounderscore]#[fg=colour237, bg=colour248] #h " +set-option -g status-left "#[bg=colour241,fg=colour248] #S #[bg=colour237,fg=colour241,nobold,noitalics,nounderscore]" +set-option -g status-right "#[bg=colour237,fg=colour239 nobold, nounderscore, noitalics]#[bg=colour239,fg=colour246] %Y-%m-%d  %H:%M #[bg=colour239,fg=colour248,nobold,noitalics,nounderscore]#[bg=colour248,fg=colour237] #h " -set-window-option -g window-status-current-format "#[fg=colour237, bg=colour214, nobold, noitalics, nounderscore]#[fg=colour239, bg=colour214] #I #[fg=colour239, bg=colour214, bold] #W #[fg=colour214, bg=colour237, nobold, noitalics, nounderscore]" -set-window-option -g window-status-format "#[fg=colour237,bg=colour239,noitalics]#[fg=colour223,bg=colour239] #I #[fg=colour223, bg=colour239] #W #[fg=colour239, bg=colour237, noitalics]" +set-window-option -g window-status-current-format "#[bg=colour214,fg=colour237,nobold,noitalics,nounderscore]#[bg=colour214,fg=colour239] #I #[bg=colour214,fg=colour239,bold] #W #[bg=colour237,fg=colour214,nobold,noitalics,nounderscore]" +set-window-option -g window-status-format "#[bg=colour239,fg=colour237,noitalics]#[bg=colour239,fg=colour223] #I #[bg=colour239,fg=colour223] #W #[bg=colour237,fg=colour239,noitalics]" + +# vim: set ft=tmux tw=0 nowrap: diff --git a/tmux-gruvbox-light.conf b/tmux-gruvbox-light.conf new file mode 100644 index 0000000..4332966 --- /dev/null +++ b/tmux-gruvbox-light.conf @@ -0,0 +1,56 @@ +## COLORSCHEME: gruvbox light (medium) +# +# Some colors are not used by gruvbox light medium theme. +# The main idea is to find best version of colors that fit +# the spirit of gruvbox light theme with limited numbers of +# 256 color palette. + +set-option -g status "on" + +# default statusbar colors +set-option -g status-style bg=colour252,fg=colour239 # bg=notInGruvboxPallete, #fg=fg1 + +# default window title colors +set-window-option -g window-status-style bg=colour66,fg=colour229 # bg=aqua, fg=bg5 + +# default window with an activity alert +set-window-option -g window-status-activity-style bg=colour237,fg=colour241 # bg=bg1, fg=notInGruvboxPallete + +# active window title colors +set-window-option -g window-status-current-style bg=default,fg=colour237 # bg=default, fg=bg1 + +# pane border +set-option -g pane-active-border-style fg=colour241 # fg=notInGruvboxPallete +set-option -g pane-border-style fg=colour252 # bg1=notInGruvboxPallete + +# message infos (visible while writing command) +set-option -g message-style bg=colour252,fg=colour241 # bg=notInGruvboxPallete, fg=notInGruvboxPallete + +# writing commands inactive +set-option -g message-command-style bg=colour124,fg=colour241 # bg=notInGruvboxPallete, fg=notInGruvboxPallete + +# pane number display +set-option -g display-panes-active-colour colour241 # notInGruvboxPallete +set-option -g display-panes-colour colour248 # notInGruvboxPallete + +# clock +set-window-option -g clock-mode-colour colour172 # orange + +# bell +set-window-option -g window-status-bell-style bg=colour124,fg=colour229 # bg=red, fg=bg + +## Theme settings mixed with colors (unfortunately, but there is no cleaner way) +set-option -g status-justify "left" +set-option -g status-left-style attr="none" +set-option -g status-left-length "80" +set-option -g status-right-style attr="none" +set-option -g status-right-length "80" +set-window-option -g window-status-separator "" + +set-option -g status-left "#[bg=colour243,fg=colour255] #S #[bg=colour252,fg=colour243,nobold,noitalics,nounderscore]" +set-option -g status-right "#[bg=colour252,fg=colour243,nobold,nounderscore,noitalics]#[bg=colour243,fg=colour255] %Y-%m-%d  %H:%M #[bg=colour243,fg=colour237,nobold,noitalics,nounderscore]#[bg=colour237,fg=colour255] #h " + +set-window-option -g window-status-current-format "#[bg=colour215,fg=colour252,nobold,noitalics,nounderscore]#[bg=colour215,fg=colour239] #I #[bg=colour215,fg=colour239,bold] #W #[bg=colour252,fg=colour215,nobold,noitalics,nounderscore]" +set-window-option -g window-status-format "#[bg=colour249,fg=colour252,noitalics]#[bg=colour249,fg=colour241] #I #[bg=colour249,fg=colour241] #W #[bg=colour252,fg=colour249,noitalics]" + +# vim: set ft=tmux tw=0 nowrap: