diff --git a/.github/workflows/dev-push-check.yml b/.github/workflows/dev-push-check.yml
new file mode 100644
index 0000000..f40befc
--- /dev/null
+++ b/.github/workflows/dev-push-check.yml
@@ -0,0 +1,34 @@
+name: dev-push-check
+run-name: ${{ github.actor }} pushed new code 💻
+on: [push] #, pull_request]
+jobs:
+ lint_shellcheck:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Install shellcheck
+ run: sudo apt-get install -y shellcheck
+ - name: Checkout repo
+ uses: actions/checkout@main
+ - name: Lint files against shellcheck
+ run: make lint_shellcheck
+ lint_shfmt:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Install shfmt
+ run: sudo apt-get install -y shfmt
+ - name: Checkout repository
+ uses: actions/checkout@main
+ - name: Lint files against shfmt
+ run: make lint_shfmt
+ tests_linux:
+ runs-on: ubuntu-latest
+ needs:
+ - lint_shfmt
+ - lint_shellcheck
+ steps:
+ - name: Install required software
+ run: sudo apt install -y tmux git
+ - name: Checkout repository
+ uses: actions/checkout@main
+ - name: Execute all linux tests and check results
+ run: ./tests/run_all_linux_tests.sh
diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml
deleted file mode 100644
index 6f76a98..0000000
--- a/.github/workflows/github-actions.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-name: GitHub Actions
-run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
-on: [push]
-jobs:
- lint-shellcheck:
- runs-on: ubuntu-latest
- steps:
- - name: install shellcheck
- run: sudo apt-get install -y shellcheck
- - name: checkout repo
- uses: actions/checkout@main
- - name: lint files against shellcheck
- run: make lint_shellcheck
- lint-shfmt:
- runs-on: ubuntu-latest
- steps:
- - name: install shfmt
- run: sudo apt-get install -y shfmt
- - name: checkout repo
- uses: actions/checkout@main
- - name: lint files against shfmt
- run: make lint_shfmt
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d16fccb..57edbfd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,12 +9,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added
-- Added light and dark transparent themes [#18](https://github.com/egel/tmux-gruvbox/issues/18)
-- Added editorconfig
-- Added code linters for shellcheck & shfmt [#33](https://github.com/egel/tmux-gruvbox/issues/33)
-- Added customizable statusbar [#31](https://github.com/egel/tmux-gruvbox/issues/31)
-- Added support for 16-bit colors palette light & dark [#34](https://github.com/egel/tmux-gruvbox/issues/34)
-
### Changed
### Deprecated
@@ -23,7 +17,33 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed
+### Security
+
+## [v2.0.0]
+
+### Added
+
+- Added light and dark transparent themes [#18](https://github.com/egel/tmux-gruvbox/issues/18)
+- Added editorconfig
+- Added code linters for shellcheck & shfmt [#33](https://github.com/egel/tmux-gruvbox/issues/33)
+- Added tests (for linux) [#39](https://github.com/egel/tmux-gruvbox/issues/39)
+- Added customizable statusbar [#31](https://github.com/egel/tmux-gruvbox/issues/31)
+- Added support for 16-bit colors palette light & dark [#34](https://github.com/egel/tmux-gruvbox/issues/34)
+- Added migration guide v1 to v2 [#44](https://github.com/egel/tmux-gruvbox/issues/44)
+
+### Changed
+
+### Deprecated
+
+### Removed
+
+- Reduce repo weight by removing unused images [#41](https://github.com/egel/tmux-gruvbox/issues/41)
+
+### Fixed
+
- Fixed incorrect spacings in template file
+- Improved README with more examples
+- Reduced repo size by outsource images to external platform [#36](https://github.com/egel/tmux-gruvbox/issues/36)
### Security
@@ -50,3 +70,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
[Unreleased]: https://github.com/egel/tmux-gruvbox/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/egel/tmux-gruvbox/compare/v0.0.0...v1.0.0
+[1.1.0]: https://github.com/egel/tmux-gruvbox/compare/v1.0.0...v1.1.0
+[2.0.0]: https://github.com/egel/tmux-gruvbox/compare/v1.1.0...v2.0.0
diff --git a/README.md b/README.md
index eb2da52..e2169b0 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,9 @@
-
+
Gruvbox theme 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). Subthemes switching inspired by [tmux-color-solarized][tmux-color-solarized].
+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][github-seebi-tmux-color-solarized].
-> Screenshot made from macOS [alacritty][github-alacritty] terminal with xterm-256color and [Hack Nerd Font Regular][github-nerd-fonts].
-> Backgrounds by [Aleksandar Pasaric][pexcel-1] and [Vishnu Murali][pexcel-2].
+> Screenshot made with dark & light themes (16-bit) from macOS [alacritty][github-alacritty] terminal with xterm-256color and [Hack Nerd Font Regular][github-nerd-fonts]. Backgrounds by [Aleksandar Pasaric][pexcel-1] and [Vishnu Murali][pexcel-2].
## Installation
### Install via [TPM][github-tpm] (recommended)
-Add plugin at the top list of TPM plugins in `.tmux.conf` and select desired theme.
+Add plugin at the top list of TPM plugins list in `.tmux.conf` and select desired theme.
```bash
# ~/.tmux.conf
-set -g @plugin 'egel/tmux-gruvbox'
-# set desired options...
-set -g @tmux-gruvbox 'dark' # or 'light'
+
+set -g @plugin 'tmux-plugins/tpm' # mandatory
+set -g @plugin 'tmux-plugins/tmux-sensible' # optional recommended
+
+set -g @plugin 'https://git.k4li.de/mirrors/tmux-gruvbox'
+# set desired theme options...
+set -g @tmux-gruvbox 'dark' # or 'dark256', 'light', 'light256'
+
+# other plugins
+...
```
Hit `prefix + I` to fetch the plugin and source it. Your Tmux should be updated with the theme at this point.
+> [!NOTE]
+> If you used v1 before and interested to adapt to v2 use this [Migration Guide from v1 to v2][docs-migration-guide-from-v1-to-v2].
+
### Install manually
-1. Clone the project to desired location
+> [!TIP]
+> If you do not have github account [download](https://github.com/egel/tmux-gruvbox/archive/refs/heads/main.zip) it and unzip.
- > ![TIP] If you do not have github account [download](https://github.com/egel/tmux-gruvbox/archive/refs/heads/main.zip) it and unzip.
+1. Clone the project to desired location
```bash
cd ~/projects/
@@ -53,24 +65,47 @@ Hit `prefix + I` to fetch the plugin and source it. Your Tmux should be updated
```bash
# ~/.tmux.conf
+
run ~/projects/tmux-gruvbox/tmux-gruvbox.tmux
# set desired options...
- set -g @tmux-gruvbox 'dark' # or light
+ set -g @tmux-gruvbox 'dark' # or 'dark256', 'light', 'light256'
```
## Configuration options
+
+
### Theme
- default value: `dark256`
-- available themes:
- - [`dark256`](./docs/assets/img/gruvbox-dark-theme.png)
- - [`light256`](./docs/assets/img/gruvbox-light-theme.png)
+
+| Theme name | Color palette | Preview link |
+| :--------- | :------------ | :-------------------------------------------------------------------- |
+| `dark` | 16-bit colors | preview |
+| `light` | 16-bit colors | preview |
+| `dark256` | 256 colors | preview |
+| `light256` | 256 colors | preview |
```bash
-set -g @tmux-gruvbox 'dark256'
+set -g @tmux-gruvbox 'dark' # dark256, light, light256
```
+> [!TIP]
+> Each terminal emulator can behave bit differently regarding displaying colors.
+> If you have some problems see
+> [True Color (24-bit) and italics with alacritty + tmux + vim (neovim)][github-gist-andersevenrud-alacritty-tmux-vim-truecolor]
+> where there is great wisdom how to adjust terminal, especially when used
+> alacritty and tmux.
+
### Transparent status-bar
- default value: `'false'`
@@ -82,10 +117,10 @@ set -g @tmux-gruvbox-statusbar-alpha 'true'
### Left Status (Section A)
-- default value: `'#S'`
+- default value: `'#S'` (session name)
```bash
-set -g @tmux-gruvbox-left-status-a
+set -g @tmux-gruvbox-left-status-a '#S' # tmux's session name
```
### Right Status (Section X)
@@ -95,9 +130,19 @@ set -g @tmux-gruvbox-left-status-a
This section is customizable for user, and by default contains current date.
```bash
-set -g @tmux-gruvbox-right-status-x
+# set date in US notation
+set -g @tmux-gruvbox-right-status-x '%m/%d/%Y' # e.g.: 01/31/2024
```
+```bash
+# or set date in EU notation
+set -g @tmux-gruvbox-right-status-x '%d.%m.%Y' # e.g.: 30.01.2024
+```
+
+> [!TIP]
+> Some user may have problem with displaying dates in desired format, if this
+> case for you try using double percent `%%`
+
### Right Status (Section Y)
- default value: `'%H:%M'`
@@ -105,21 +150,26 @@ set -g @tmux-gruvbox-right-status-x
This section is customizable for user, and by default contains current time.
```bash
-# set different time format
-set -g @tmux-gruvbox-right-status-y '%H:%M'
+# set US time format
+set -g @tmux-gruvbox-right-status-y '%I:%M %p' # 09:54 PM
```
### Right Status (Section Z)
-- default value: `'#h'`
+- default value: `'#h'` (hostname)
This section is customizable for user, and by default contains hostname.
```bash
-# enhance this section with other plugin
-set -g @tmux-gruvbox-right-status-z '#h #{tmux_mode_indicator} '
+# display hostname and enhance section with other plugin
+set -g @tmux-gruvbox-right-status-z '#h #{tmux_mode_indicator}'
```
+> [!TIP]
+> Make sure the themes' settings are defined before all other plugins,
+> otherwise content from external plugins may not be displayed correctly by
+> the theme.
+
## Development
To run project locally:
@@ -162,12 +212,20 @@ To keep the files clean we use few program to help us achieve it:
GPLv3 - Maciej Sypień
-[github-tmux]: https://github.com/tmux/tmux
+[docs-migration-guide-from-v1-to-v2]: ./docs/migration-guide-from-v1-to-v2.md
+[github-alacritty]: https://github.com/alacritty/alacritty
+[github-gist-andersevenrud-alacritty-tmux-vim-truecolor]: https://gist.github.com/andersevenrud/015e61af2fd264371032763d4ed965b6
[github-grovbox]: https://github.com/morhetz/gruvbox
[github-hack]: https://github.com/chrissimpkins/Hack
[github-nerd-fonts]: https://github.com/ryanoasis/nerd-fonts
-[github-alacritty]: https://github.com/alacritty/alacritty
+[github-seebi-tmux-color-solarized]: https://github.com/seebi/tmux-colors-solarized
+[github-tmux]: https://github.com/tmux/tmux
[github-tpm]: https://github.com/tmux-plugins/tpm
-[tmux-color-solarized]: https://github.com/seebi/tmux-colors-solarized
+[imgur-img-gruvbox-dark-16bit-1x]: https://i.imgur.com/ae88LQI.png
+[imgur-img-gruvbox-dark-light-comparision-0.5x]: https://i.imgur.com/p6lUnzb.png
+[imgur-img-gruvbox-dark-light-comparision-1x]: https://i.imgur.com/uGyGwlC.png
+[imgur-img-gruvbox-dark256-1x]: https://i.imgur.com/kzQTTCa.png
+[imgur-img-gruvbox-light-16bit-1x]: https://i.imgur.com/fvpdRjg.png
+[imgur-img-gruvbox-light256-1x]: https://i.imgur.com/tQsl6LA.png
[pexcel-1]: https://www.pexels.com/photo/urban-photo-of-an-alley-2411688/
[pexcel-2]: https://www.pexels.com/photo/lights-hanging-above-the-alley-in-a-city-at-night-27044195/
diff --git a/docs/assets/img/gruvbox-dark-and-light-theme-structure.png b/docs/assets/img/gruvbox-dark-and-light-theme-structure.png
deleted file mode 100644
index 206735c..0000000
Binary files a/docs/assets/img/gruvbox-dark-and-light-theme-structure.png and /dev/null differ
diff --git a/docs/assets/img/gruvbox-dark-and-light-theme-structure@0.25x.png b/docs/assets/img/gruvbox-dark-and-light-theme-structure@0.25x.png
deleted file mode 100644
index 58a174c..0000000
Binary files a/docs/assets/img/gruvbox-dark-and-light-theme-structure@0.25x.png and /dev/null differ
diff --git a/docs/assets/img/gruvbox-dark-and-light-theme-structure@0.5x.png b/docs/assets/img/gruvbox-dark-and-light-theme-structure@0.5x.png
deleted file mode 100644
index fef1fba..0000000
Binary files a/docs/assets/img/gruvbox-dark-and-light-theme-structure@0.5x.png and /dev/null differ
diff --git a/docs/assets/img/gruvbox-dark-theme.png b/docs/assets/img/gruvbox-dark-theme.png
deleted file mode 100644
index 5753d3e..0000000
Binary files a/docs/assets/img/gruvbox-dark-theme.png and /dev/null differ
diff --git a/docs/assets/img/gruvbox-light-theme.png b/docs/assets/img/gruvbox-light-theme.png
deleted file mode 100644
index a6b815e..0000000
Binary files a/docs/assets/img/gruvbox-light-theme.png and /dev/null differ
diff --git a/docs/assets/img/logo-v1.png b/docs/assets/img/logo-v1.png
deleted file mode 100644
index f96a428..0000000
Binary files a/docs/assets/img/logo-v1.png and /dev/null differ
diff --git a/docs/assets/img/logo-v1.svg b/docs/assets/img/logo-v1.svg
deleted file mode 100644
index cf0fdee..0000000
--- a/docs/assets/img/logo-v1.svg
+++ /dev/null
@@ -1,125 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/assets/img/logo-v1@0.5x.png b/docs/assets/img/logo-v1@0.5x.png
deleted file mode 100644
index 84dbb03..0000000
Binary files a/docs/assets/img/logo-v1@0.5x.png and /dev/null differ
diff --git a/docs/assets/img/logo-v1@0.75x.png b/docs/assets/img/logo-v1@0.75x.png
deleted file mode 100644
index b0cad22..0000000
Binary files a/docs/assets/img/logo-v1@0.75x.png and /dev/null differ
diff --git a/docs/migration-guide-from-v1-to-v2.md b/docs/migration-guide-from-v1-to-v2.md
new file mode 100644
index 0000000..0c69639
--- /dev/null
+++ b/docs/migration-guide-from-v1-to-v2.md
@@ -0,0 +1,73 @@
+# Migration guide from v1 to v2
+
+Hello there!
+
+I am so happy to see you here and are interested in using the new version of tmux-gruvbox theme.
+
+I really try to do all my best giving you new, interesting features that you probably always wanted to have.
+
+In here I also wanted to thank you all people involved in contributing to this theme 🙏🙇. Especially for adding all suggestions, or reporting problems if they occurred - this helped a lot!
+
+## What's new?
+
+There are couple of great things ahead:
+
+- new themes supporting 16-bit color palette
+- new fully customizable spaces A, X, Y, Z for your disposal
+- support for transparency (experimental)
+- and many more
+
+See what's new in [CHANGELOG][docs-changelog].
+
+## Breaking changes
+
+I planned to have best possible user experience between migrating from v1 and v2, therefore tried to build new changes this way to keep the breaking changes as low as possible. This was not ideal, although I believe for many this would not require many changes and for some none.
+
+### Theme names changes
+
+| v1 | v2 | description |
+| :-----------------: | :--------: | ----------------------------------------------------------------------- |
+| `dark` | `dark256` | 256-colors theme |
+| `light` | `light256` | 256-colors theme |
+| `dark-transparent` | ∅ | set `dark` or `dark256` theme and add `@tmux-gruvbox-statusbar-alpha` |
+| `light-transparent` | ∅ | set `light` or `light256` theme and add `@tmux-gruvbox-statusbar-alpha` |
+
+In v2 we've introduced a 16-bit color themes that should give the users more happiness utilizing a greater amount of supported colors (full gruvbox palette).
+
+Therefore in v2 themes `light` & `dark` has been simply renamed and `256` postfix has been added to indicate used palette. In v2 `light` & `dark` themes will be refering to 16-bit versions.
+
+> [!NOTE]
+> While implementing 16-bit colors I realized that many users (including me) had problems with setting up correct the color interpretation in their workspace to support multiple colors.
+>
+> Here is the page [True Color (24-bit) and italics with alacritty + tmux + vim (neovim)][github-gist-andersevenrud-alacritty-tmux-vim-truecolor] where I found great wisdom how to adjust my terminal, especially when used alacritty, tmux & neovim.
+
+### Fallback theme name
+
+| v1 | v2 |
+| :----: | :-------: |
+| `dark` | `dark256` |
+
+Continuing topic of introducing 16-bit colors, we have make slight change in fallback theme name. We love idea adding new colors to our theme, although during those changes we cannot forget about users whose terminals might not support more then basic 256 colors. Therefore the fallback theme name also has to be adapted and in v2 it's `dark256`.
+
+## FAQ
+
+### Plugin not upgrading automatically with tmux update
+
+Error ([source](https://github.com/egel/tmux-gruvbox/issues/21#issuecomment-2373794273)):
+
+```
+"tmux-gruvbox" update fail
+ | fatal: couldn't find remote ref refs/heads/master
+```
+
+Solution:
+
+We recently migrate from `master` to `main` as the primary branch, therefore tmux plugin manager using old reference to master and it's not possible to pull.
+
+The simplest way would be to:
+
+1. remove the plugin `rm -rf ~/.tmux/plugins/tmux-gruvbox`
+2. and reinstall it again via tpm key-binding `` + `I`.
+
+[docs-changelog]: ../CHANGELOG.md
+[github-gist-andersevenrud-alacritty-tmux-vim-truecolor]: https://gist.github.com/andersevenrud/015e61af2fd264371032763d4ed965b6
diff --git a/gruvbox-tpm.tmux b/gruvbox-tpm.tmux
index 6d3946a..936ef65 100755
--- a/gruvbox-tpm.tmux
+++ b/gruvbox-tpm.tmux
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# shellcheck disable=SC1091
-source "./src/gruvbox-main.sh"
+CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+source "${CURRENT_DIR}/src/gruvbox-main.sh"
# vim: ai et ft=bash
diff --git a/src/gruvbox-main.sh b/src/gruvbox-main.sh
index be5b811..eb93dc4 100755
--- a/src/gruvbox-main.sh
+++ b/src/gruvbox-main.sh
@@ -1,8 +1,6 @@
#!/bin/bash
-SCRIPT_SRC="$(dirname "${BASH_SOURCE[${#BASH_SOURCE[@]} - 1]}")"
-readonly SCRIPT_SRC
-CURRENT_DIR=$(cd "${SCRIPT_SRC}" >/dev/null 2>&1 && pwd) readonly CURRENT_DIR
+CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly CURRENT_DIR
# hold the array of all command to configure tmux theme
@@ -10,9 +8,9 @@ declate -a TMUX_CMDS
# load libraries
# shellcheck disable=1091
-source "${CURRENT_DIR}/src/helper_methods.sh"
+source "${CURRENT_DIR}/helper_methods.sh"
# shellcheck disable=1091
-source "${CURRENT_DIR}/src/tmux_utils.sh"
+source "${CURRENT_DIR}/tmux_utils.sh"
readonly TMUX_GRUVBOX="@tmux-gruvbox"
readonly TMUX_GRUVBOX_STATUSBAR_ALPHA="@tmux-gruvbox-statusbar-alpha"
@@ -22,13 +20,13 @@ readonly TMUX_GRUVBOX_RIGHT_STAUTS_Y="@tmux-gruvbox-right-status-y"
readonly TMUX_GRUVBOX_RIGHT_STAUTS_Z="@tmux-gruvbox-right-status-z"
# define simple theme options (no color interpolation required)
-DEFAULT_THEME="dark"
-DEFAULT_STATUSBAR_ALPHA=false
+readonly DEFAULT_THEME="dark256"
+readonly DEFAULT_STATUSBAR_ALPHA='false'
# defaults for theme option (with color interpolation)
-DEFAULT_LEFT_STATUS_A='#S'
-DEFAULT_RIGHT_STATUS_X='%Y-%m-%d'
-DEFAULT_RIGHT_STATUS_Y='%H:%M'
-DEFAULT_RIGHT_STATUS_Z='#h'
+readonly DEFAULT_LEFT_STATUS_A=' '
+readonly DEFAULT_RIGHT_STATUS_X='%d.%m.%Y'
+readonly DEFAULT_RIGHT_STATUS_Y='%H:%M'
+readonly DEFAULT_RIGHT_STATUS_Z="$USER@#h "
main() {
TMUX_CMDS=() # clear
@@ -41,27 +39,27 @@ main() {
case "$_theme" in
light)
# shellcheck disable=1091
- source "${CURRENT_DIR}/src/palette_gruvbox_light.sh"
+ source "${CURRENT_DIR}/palette_gruvbox_light.sh"
# shellcheck disable=1091
- source "${CURRENT_DIR}/src/theme_gruvbox_light.sh"
+ source "${CURRENT_DIR}/theme_gruvbox_light.sh"
;;
light256)
# shellcheck disable=1091
- source "${CURRENT_DIR}/src/palette_gruvbox_light256.sh"
+ source "${CURRENT_DIR}/palette_gruvbox_light256.sh"
# shellcheck disable=1091
- source "${CURRENT_DIR}/src/theme_gruvbox_light.sh"
+ source "${CURRENT_DIR}/theme_gruvbox_light256.sh"
;;
dark)
# shellcheck disable=1091
- source "${CURRENT_DIR}/src/palette_gruvbox_dark.sh"
+ source "${CURRENT_DIR}/palette_gruvbox_dark.sh"
# shellcheck disable=1091
- source "${CURRENT_DIR}/src/theme_gruvbox_dark.sh"
+ source "${CURRENT_DIR}/theme_gruvbox_dark.sh"
;;
dark256 | *)
# shellcheck disable=1091
- source "${CURRENT_DIR}/src/palette_gruvbox_dark256.sh"
+ source "${CURRENT_DIR}/palette_gruvbox_dark256.sh"
# shellcheck disable=1091
- source "${CURRENT_DIR}/src/theme_gruvbox_dark.sh"
+ source "${CURRENT_DIR}/theme_gruvbox_dark.sh"
;;
esac
@@ -71,7 +69,8 @@ main() {
_status_right_y=$(tmux_get_option "$TMUX_GRUVBOX_RIGHT_STAUTS_Y" "$DEFAULT_RIGHT_STATUS_Y")
_status_right_z=$(tmux_get_option "$TMUX_GRUVBOX_RIGHT_STAUTS_Z" "$DEFAULT_RIGHT_STATUS_Z")
- theme_args=(
+ local _theme_args
+ _theme_args=(
"$_status_left_a"
"$_status_right_x"
"$_status_right_y"
@@ -80,11 +79,15 @@ main() {
)
case $_theme in
- light | light256)
- theme_set_light "${theme_args[@]}"
+ light256)
+ # light256 have slightly different colors placement then regular light 16-bit
+ theme_set_light256 "${_theme_args[@]}"
+ ;;
+ light)
+ theme_set_light "${_theme_args[@]}"
;;
dark | dark256 | *)
- theme_set_dark "${theme_args[@]}"
+ theme_set_dark "${_theme_args[@]}"
;;
esac
diff --git a/src/palette_gruvbox_dark256.sh b/src/palette_gruvbox_dark256.sh
index fe6c84d..47b3bb1 100644
--- a/src/palette_gruvbox_dark256.sh
+++ b/src/palette_gruvbox_dark256.sh
@@ -25,7 +25,7 @@ col_gray2=colour245
col_bg0_s=colour236
col_fg=colour223
col_fg4=colour246
-col_fg3=colour248
+col_fg3=colour167
col_fg2=colour250
col_fg1=colour223
col_fg0=colour229
diff --git a/src/theme_gruvbox_dark.sh b/src/theme_gruvbox_dark.sh
index 3ee9e88..4bee163 100644
--- a/src/theme_gruvbox_dark.sh
+++ b/src/theme_gruvbox_dark.sh
@@ -28,9 +28,9 @@ theme_set_dark() {
tmux_append_setwo "window-status-activity-style" "bg=${col_bg1},fg=${col_fg3}"
# active window title colors
- local active_window_title_bg=${col_yellow2}
- if [[ "$_statusbar_alpha" == "true" ]]; then active_window_title_bg="default"; fi
- tmux_append_setwo "window-status-current-style" "bg=${active_window_title_bg},fg=${col_bg1}" # TODO cosider removing red!
+ local _active_window_title_bg=${col_yellow2}
+ if [[ "$_statusbar_alpha" == "true" ]]; then _active_window_title_bg="default"; fi
+ tmux_append_setwo "window-status-current-style" "bg=${_active_window_title_bg},fg=${col_bg1}" # TODO cosider removing red!
# pane border
tmux_append_seto "pane-active-border-style" "fg=${col_fg2}"
diff --git a/src/theme_gruvbox_light.sh b/src/theme_gruvbox_light.sh
index f5c21fd..ebbf4d9 100644
--- a/src/theme_gruvbox_light.sh
+++ b/src/theme_gruvbox_light.sh
@@ -5,25 +5,32 @@
#
# shellcheck disable=SC2154
theme_set_light() {
- local _left_status_value _right_status_value _window_status_current_format _window_status_format
+ local _left_status_a _right_status_x _right_status_y _right_status_z _statusbar_alpha
_left_status_a=$1
_right_status_x=$2
_right_status_y=$3
_right_status_z=$4
+ _statusbar_alpha=$5
tmux_append_seto "status" "on"
- # default statusbar color
- tmux_append_seto "status-style" "bg=${col_bg1},fg=${col_fg1}"
+ # default statusbar bg color
+ local _statusbar_bg="${col_bg1}"
+ if [[ "$_statusbar_alpha" == "true" ]]; then _statusbar_bg="default"; fi
+ tmux_append_seto "status-style" "bg=${_statusbar_bg},fg=${col_fg1}"
# default window title colors
- tmux_append_setwo "window-status-style" "bg=${col_yellow2},fg=${col_bg1}"
+ local _window_title_bg=${col_yellow2}
+ if [[ "$_statusbar_alpha" == "true" ]]; then _window_title_bg="default"; fi
+ tmux_append_setwo "window-status-style" "bg=${_window_title_bg},fg=${col_bg1}"
# default window with an activity alert
tmux_append_setwo "window-status-activity-style" "bg=${col_bg1},fg=${col_fg3}"
# active window title colors
- tmux_append_setwo "window-status-current-style" "bg=default,fg=${col_bg1}" # TODO cosider removing red!
+ local _active_window_title_bg=${col_yellow2}
+ if [[ "$_statusbar_alpha" == "true" ]]; then _active_window_title_bg="default"; fi
+ tmux_append_setwo "window-status-current-style" "bg=${_active_window_title_bg},fg=${col_bg1}" # TODO cosider removing red!
# pane border
tmux_append_seto "pane-active-border-style" "fg=${col_fg2}"
@@ -54,8 +61,19 @@ theme_set_light() {
tmux_append_setwo "window-status-separator" ""
tmux_append_seto "status-left" "#[bg=${col_bg3},fg=${col_fg3}] ${_left_status_a} #[bg=${col_bg1},fg=${col_bg3},nobold,noitalics,nounderscore]"
- tmux_append_seto "status-right" "#[bg=${col_bg1},fg=${col_bg2},nobold,nounderscore,noitalics]#[bg=${col_bg2},fg=${col_fg4}] ${_right_status_x} ${_right_status_y} #[bg=${col_bg2},fg=${col_fg3},nobold,noitalics,nounderscore]#[bg=${col_fg3},fg=${col_bg1}] ${_right_status_z}"
- tmux_append_setwo "window-status-current-format" "#[bg=${col_yellow2},fg=${col_bg1},nobold,noitalics,nounderscore]#[bg=${col_yellow2},fg=${col_bg2}] #I #[bg=${col_yellow2},fg=${col_bg2},bold] #W#{?window_zoomed_flag,*Z,} #[bg=${col_bg1},fg=${col_yellow2},nobold,noitalics,nounderscore]"
- tmux_append_setwo "window-status-format" "#[bg=${col_bg2},fg=${col_bg1},noitalics]#[bg=${col_bg2},fg=${col_fg1}] #I #[bg=${col_bg2},fg=${col_fg1}] #W #[bg=${col_bg1},fg=${col_bg2},noitalics]"
+ # right status
+ local _status_right_bg=${col_bg1}
+ if [[ "$_statusbar_alpha" == "true" ]]; then _status_right_bg="default"; fi
+ tmux_append_seto "status-right" "#[bg=${_status_right_bg},fg=${col_bg2},nobold,nounderscore,noitalics]#[bg=${col_bg2},fg=${col_fg4}] ${_right_status_x} ${_right_status_y} #[bg=${col_bg2},fg=${col_fg3},nobold,noitalics,nounderscore]#[bg=${col_fg3},fg=${col_bg1}] ${_right_status_z}"
+
+ # current window
+ local _current_window_status_format_bg=${col_bg1}
+ if [[ "$_statusbar_alpha" == "true" ]]; then _current_window_status_format_bg="default"; fi
+ tmux_append_setwo "window-status-current-format" "#[bg=${col_yellow2},fg=${col_bg1},nobold,noitalics,nounderscore]#[bg=${col_yellow2},fg=${col_bg2}] #I #[bg=${col_yellow2},fg=${col_bg2},bold] #W#{?window_zoomed_flag,*Z,} #{?window_end_flag,#[bg=${_current_window_status_format_bg}],#[bg=${col_bg1}]}#[fg=${col_yellow2},nobold,noitalics,nounderscore]"
+
+ # default window
+ local _default_window_status_format_bg=${col_bg1}
+ if [[ "$_statusbar_alpha" == "true" ]]; then _default_window_status_format_bg="default"; fi
+ tmux_append_setwo "window-status-format" "#[bg=${col_bg2},fg=${col_bg1},noitalics]#[bg=${col_bg2},fg=${col_fg1}] #I #[bg=${col_bg2},fg=${col_fg1}] #W #{?window_end_flag,#[bg=${_default_window_status_format_bg}],#[bg=${col_bg1}]}#[fg=${col_bg2},noitalics]"
}
diff --git a/src/theme_gruvbox_light256.sh b/src/theme_gruvbox_light256.sh
new file mode 100644
index 0000000..9ae1a43
--- /dev/null
+++ b/src/theme_gruvbox_light256.sh
@@ -0,0 +1,79 @@
+#!/bin/bash
+
+# Themes may use different colors in sets therefore we setup dark and light
+# separately.
+#
+# shellcheck disable=SC2154
+theme_set_light256() {
+ local _left_status_a _right_status_x _right_status_y _right_status_z _statusbar_alpha
+ _left_status_a=$1
+ _right_status_x=$2
+ _right_status_y=$3
+ _right_status_z=$4
+ _statusbar_alpha=$5
+
+ tmux_append_seto "status" "on"
+
+ # default statusbar bg color
+ local _statusbar_bg="${col_bg2}"
+ if [[ "$_statusbar_alpha" == "true" ]]; then _statusbar_bg="default"; fi
+ tmux_append_seto "status-style" "bg=${_statusbar_bg},fg=${col_fg1}"
+
+ # default window title colors
+ local _window_title_bg=${col_yellow2}
+ if [[ "$_statusbar_alpha" == "true" ]]; then _window_title_bg="default"; fi
+ tmux_append_setwo "window-status-style" "bg=${_window_title_bg},fg=${col_bg1}"
+
+ # default window with an activity alert
+ tmux_append_setwo "window-status-activity-style" "bg=${col_bg1},fg=${col_fg3}"
+
+ # active window title colors
+ local _active_window_title_bg=${col_yellow2}
+ if [[ "$_statusbar_alpha" == "true" ]]; then _active_window_title_bg="default"; fi
+ tmux_append_setwo "window-status-current-style" "bg=${_active_window_title_bg},fg=${col_bg1}" # TODO cosider removing red!
+
+ # pane border
+ tmux_append_seto "pane-active-border-style" "fg=${col_fg2}"
+ tmux_append_seto "pane-border-style" "fg=${col_bg1}"
+
+ # message infos
+ tmux_append_seto "message-style" "bg=${col_bg2},fg=${col_fg1}"
+
+ # writing commands inactive
+ tmux_append_seto "message-command-style" "bg=${col_fg3},fg=${col_bg1}"
+
+ # pane number display
+ tmux_append_seto "display-panes-active-colour" "${col_fg2}"
+ tmux_append_seto "display-panes-colour" "${col_bg1}"
+
+ # clock
+ tmux_append_setwo "clock-mode-colour" "${col_blue2}"
+
+ # bell
+ tmux_append_setwo "window-status-bell-style" "bg=${col_red2},fg=${col_bg}"
+
+ ## Theme settings mixed with colors (unfortunately, but there is no cleaner way)
+ tmux_append_seto "status-justify" "left"
+ tmux_append_seto "status-left-style" none
+ tmux_append_seto "status-left-length" "80"
+ tmux_append_seto "status-right-style" none
+ tmux_append_seto "status-right-length" "80"
+ tmux_append_setwo "window-status-separator" ""
+
+ tmux_append_seto "status-left" "#[bg=${col_fg2},fg=${col_bg1}] ${_left_status_a} #[bg=${col_bg2},fg=${col_fg2},nobold,noitalics,nounderscore]"
+
+ # right status
+ local _status_right_bg=${col_bg2}
+ if [[ "$_statusbar_alpha" == "true" ]]; then _status_right_bg="default"; fi
+ tmux_append_seto "status-right" "#[bg=${_status_right_bg},fg=${col_fg4},nobold,nounderscore,noitalics]#[bg=${col_fg4},fg=${col_bg1}] ${_right_status_x} ${_right_status_y} #[bg=${col_fg4},fg=${col_fg2},nobold,noitalics,nounderscore]#[bg=${col_fg2},fg=${col_bg1}] ${_right_status_z}"
+
+ # current window
+ local _current_window_status_format_bg=${col_bg2}
+ if [[ "$_statusbar_alpha" == "true" ]]; then _current_window_status_format_bg="default"; fi
+ tmux_append_setwo "window-status-current-format" "#[bg=${col_yellow},fg=${col_bg2},nobold,noitalics,nounderscore]#[bg=${col_yellow},fg=${col_fg1}] #I #[bg=${col_yellow},fg=${col_fg1},bold] #W#{?window_zoomed_flag,*Z,} #{?window_end_flag,#[bg=${_current_window_status_format_bg}],#[bg=${col_bg2}]}#[fg=${col_yellow},nobold,noitalics,nounderscore]"
+
+ # default window
+ local _default_window_status_format_bg=${col_bg2}
+ if [[ "$_statusbar_alpha" == "true" ]]; then _default_window_status_format_bg="default"; fi
+ tmux_append_setwo "window-status-format" "#[bg=${col_bg3},fg=${col_bg2},noitalics]#[bg=${col_bg3},fg=${col_fg2}] #I #[bg=${col_bg3},fg=${col_fg2}] #W #{?window_end_flag,#[bg=${_default_window_status_format_bg}],#[bg=${col_bg2}]}#[fg=${col_bg3},noitalics]"
+}
diff --git a/src/tmux_utils.sh b/src/tmux_utils.sh
index cc235b3..87ab063 100644
--- a/src/tmux_utils.sh
+++ b/src/tmux_utils.sh
@@ -1,20 +1,5 @@
#!/bin/bash
-# get desired option from tmux or default
-tmux_get_option_or_default() {
- local _option_name _default_value
- _option_name="$1"
- _default_value="$2"
-
- local _current_option_value
- _current_option_value=$(tmux show-option -gqv "$_option_name")
- if [[ -n "$_current_option_value" ]]; then
- echo "$_current_option_value"
- else
- echo "$_default_value"
- fi
-}
-
# get desired tmux option or use given default value
tmux_get_option() {
local _option_name _default_value
diff --git a/tests/linux/README.md b/tests/linux/README.md
new file mode 100644
index 0000000..fe1095b
--- /dev/null
+++ b/tests/linux/README.md
@@ -0,0 +1,6 @@
+# Linux tests
+
+Those tests are meant to run on linux:
+
+- ubuntu 20.04 LTS
+- with bash
diff --git a/tests/linux/test_check_gruvbox_dark256_enabled.sh b/tests/linux/test_check_gruvbox_dark256_enabled.sh
new file mode 100755
index 0000000..aad203f
--- /dev/null
+++ b/tests/linux/test_check_gruvbox_dark256_enabled.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+# shellcheck disable=SC1091
+source "${CURRENT_DIR}/../test_helpers.sh"
+
+main() {
+ helper_tearup_linux
+
+ cat <~/.tmux.conf
+# List of plugins
+set -g @plugin 'tmux-plugins/tpm'
+set -g @plugin 'tmux-plugins/tmux-sensible'
+
+# Other plugins
+set -g @plugin 'egel/tmux-gruvbox'
+set -g @tmux-gruvbox 'dark256'
+
+# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
+run '~/.tmux/plugins/tpm/tpm'
+EOF
+
+ cat ~/.tmux.conf
+
+ # it's essential to link current repo to the plugins' directory
+ ln -sfv "$CURRENT_DIR/../../../tmux-gruvbox" "${HOME}/.tmux/plugins/tmux-gruvbox"
+
+ helper_install_tpm_plugins
+
+ # start new detached session
+ tmux new -d
+
+ # check if left side match
+ _status_left_expected="#[bg=colour241,fg=colour248] #S #[bg=colour237,fg=colour241,nobold,noitalics,nounderscore]"
+ _status_left_current=$(helper_tmux_get_statusleft)
+ if [[ "$_status_left_current" != "$_status_left_expected" ]]; then
+ helper_print_fail "status-left did not match" "$_status_left_current" "$_status_left_expected"
+ helper_teardown
+ exit 1
+ fi
+ # check if status is not transparent
+ _status_style_expected="bg=colour237,fg=colour223"
+ _status_style_current=$(helper_tmux_get_statusstyle)
+ if [[ "$_status_style_current" != "$_status_style_expected" ]]; then
+ helper_print_fail "status-style did not match" "$_status_style_current" "$_status_style_expected"
+ helper_teardown
+ exit 1
+ fi
+
+ helper_print_success "status-left match"
+ helper_teardown
+ exit 0
+
+}
+
+main "$@"
diff --git a/tests/linux/test_check_gruvbox_dark256_transparent_enabled.sh b/tests/linux/test_check_gruvbox_dark256_transparent_enabled.sh
new file mode 100755
index 0000000..76fcfdc
--- /dev/null
+++ b/tests/linux/test_check_gruvbox_dark256_transparent_enabled.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+# shellcheck disable=SC1091
+source "${CURRENT_DIR}/../test_helpers.sh"
+
+main() {
+ helper_tearup_linux
+
+ cat <~/.tmux.conf
+# List of plugins
+set -g @plugin 'tmux-plugins/tpm'
+set -g @plugin 'tmux-plugins/tmux-sensible'
+
+# Other plugins
+set -g @plugin 'egel/tmux-gruvbox'
+set -g @tmux-gruvbox 'dark256'
+set -g @tmux-gruvbox-statusbar-alpha 'true'
+
+# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
+run '~/.tmux/plugins/tpm/tpm'
+EOF
+
+ cat ~/.tmux.conf
+
+ # it's essential to link current repo to the plugins' directory
+ ln -sfv "$CURRENT_DIR/../../../tmux-gruvbox" "${HOME}/.tmux/plugins/tmux-gruvbox"
+
+ helper_install_tpm_plugins
+
+ # start new detached session
+ tmux new -d
+
+ # check if left side match
+ _status_left_expected="#[bg=colour241,fg=colour248] #S #[bg=colour237,fg=colour241,nobold,noitalics,nounderscore]"
+ _status_left_current=$(helper_tmux_get_statusleft)
+ if [[ "$_status_left_current" != "$_status_left_expected" ]]; then
+ helper_print_fail "status-left did not match" "$_status_left_current" "$_status_left_expected"
+ helper_teardown
+ exit 1
+ fi
+ # check if status is not transparent
+ _status_style_expected="bg=default,fg=colour223"
+ _status_style_current=$(helper_tmux_get_statusstyle)
+ if [[ "$_status_style_current" != "$_status_style_expected" ]]; then
+ helper_print_fail "status-style did not match" "$_status_style_current" "$_status_style_expected"
+ helper_teardown
+ exit 1
+ fi
+
+ helper_print_success "status-left match"
+ helper_teardown
+ exit 0
+
+}
+
+main "$@"
diff --git a/tests/linux/test_check_gruvbox_dark_enabled.sh b/tests/linux/test_check_gruvbox_dark_enabled.sh
new file mode 100755
index 0000000..e8d0505
--- /dev/null
+++ b/tests/linux/test_check_gruvbox_dark_enabled.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+# shellcheck disable=SC1091
+source "${CURRENT_DIR}/../test_helpers.sh"
+
+main() {
+ helper_tearup_linux
+
+ cat <~/.tmux.conf
+# List of plugins
+set -g @plugin 'tmux-plugins/tpm'
+set -g @plugin 'tmux-plugins/tmux-sensible'
+
+# Other plugins
+set -g @plugin 'egel/tmux-gruvbox'
+set -g @tmux-gruvbox 'dark'
+
+# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
+run '~/.tmux/plugins/tpm/tpm'
+EOF
+
+ cat ~/.tmux.conf
+
+ # it's essential to link current repo to the plugins' directory
+ ln -sfv "$CURRENT_DIR/../../../tmux-gruvbox" "${HOME}/.tmux/plugins/tmux-gruvbox"
+
+ helper_install_tpm_plugins
+
+ # start new detached session
+ tmux new -d
+
+ # check if left side match
+ _status_left_expected="#[bg=#665c54,fg=#bdae93] #S #[bg=#3c3836,fg=#665c54,nobold,noitalics,nounderscore]"
+ _status_left_current=$(helper_tmux_get_statusleft)
+ if [[ "$_status_left_current" != "$_status_left_expected" ]]; then
+ helper_print_fail "status-left did not match" "$_status_left_current" "$_status_left_expected"
+ helper_teardown
+ exit 1
+ fi
+ # check if status is not transparent
+ _status_style_expected="bg=#3c3836,fg=#ebdbb2"
+ _status_style_current=$(helper_tmux_get_statusstyle)
+ if [[ "$_status_style_current" != "$_status_style_expected" ]]; then
+ helper_print_fail "status-style did not match" "$_status_style_current" "$_status_style_expected"
+ helper_teardown
+ exit 1
+ fi
+
+ helper_print_success "status-left match"
+ helper_teardown
+ exit 0
+
+}
+
+main "$@"
diff --git a/tests/linux/test_check_gruvbox_dark_transparent_enabled.sh b/tests/linux/test_check_gruvbox_dark_transparent_enabled.sh
new file mode 100755
index 0000000..fff0358
--- /dev/null
+++ b/tests/linux/test_check_gruvbox_dark_transparent_enabled.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+# shellcheck disable=SC1091
+source "${CURRENT_DIR}/../test_helpers.sh"
+
+main() {
+ helper_tearup_linux
+
+ cat <~/.tmux.conf
+# List of plugins
+set -g @plugin 'tmux-plugins/tpm'
+set -g @plugin 'tmux-plugins/tmux-sensible'
+
+# Other plugins
+set -g @plugin 'egel/tmux-gruvbox'
+set -g @tmux-gruvbox 'dark'
+set -g @tmux-gruvbox-statusbar-alpha 'true'
+
+# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
+run '~/.tmux/plugins/tpm/tpm'
+EOF
+
+ cat ~/.tmux.conf
+
+ # it's essential to link current repo to the plugins' directory
+ ln -sfv "$CURRENT_DIR/../../../tmux-gruvbox" "${HOME}/.tmux/plugins/tmux-gruvbox"
+
+ helper_install_tpm_plugins
+
+ # start new detached session
+ tmux new -d
+
+ # check if left side match
+ _status_left_expected="#[bg=#665c54,fg=#bdae93] #S #[bg=#3c3836,fg=#665c54,nobold,noitalics,nounderscore]"
+ _status_left_current=$(helper_tmux_get_statusleft)
+ if [[ "$_status_left_current" != "$_status_left_expected" ]]; then
+ helper_print_fail "status-left did not match" "$_status_left_current" "$_status_left_expected"
+ helper_teardown
+ exit 1
+ fi
+ # check if status is not transparent
+ _status_style_expected="bg=default,fg=#ebdbb2"
+ _status_style_current=$(helper_tmux_get_statusstyle)
+ if [[ "$_status_style_current" != "$_status_style_expected" ]]; then
+ helper_print_fail "status-style did not match" "$_status_style_current" "$_status_style_expected"
+ helper_teardown
+ exit 1
+ fi
+
+ helper_print_success "status-left match"
+ helper_teardown
+ exit 0
+
+}
+
+main "$@"
diff --git a/tests/linux/test_check_gruvbox_light256_enabled.sh b/tests/linux/test_check_gruvbox_light256_enabled.sh
new file mode 100755
index 0000000..b9bfcd7
--- /dev/null
+++ b/tests/linux/test_check_gruvbox_light256_enabled.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+# shellcheck disable=SC1091
+source "${CURRENT_DIR}/../test_helpers.sh"
+
+main() {
+ helper_tearup_linux
+
+ cat <~/.tmux.conf
+# List of plugins
+set -g @plugin 'tmux-plugins/tpm'
+set -g @plugin 'tmux-plugins/tmux-sensible'
+
+# Other plugins
+set -g @plugin 'egel/tmux-gruvbox'
+set -g @tmux-gruvbox 'light256'
+
+# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
+run '~/.tmux/plugins/tpm/tpm'
+EOF
+
+ cat ~/.tmux.conf
+
+ # it's essential to link current repo to the plugins' directory
+ ln -sfv "$CURRENT_DIR/../../../tmux-gruvbox" "${HOME}/.tmux/plugins/tmux-gruvbox"
+
+ helper_install_tpm_plugins
+
+ # start new detached session
+ tmux new -d
+
+ # check if left side match
+ _status_left_expected="#[bg=colour239,fg=colour223] #S #[bg=colour250,fg=colour239,nobold,noitalics,nounderscore]"
+ _status_left_current=$(helper_tmux_get_statusleft)
+ if [[ "$_status_left_current" != "$_status_left_expected" ]]; then
+ helper_print_fail "status-left did not match" "$_status_left_current" "$_status_left_expected"
+ helper_teardown
+ exit 1
+ fi
+ # check if status is not transparent
+ _status_style_expected="bg=colour250,fg=colour237"
+ _status_style_current=$(helper_tmux_get_statusstyle)
+ if [[ "$_status_style_current" != "$_status_style_expected" ]]; then
+ helper_print_fail "status-style did not match" "$_status_style_current" "$_status_style_expected"
+ helper_teardown
+ exit 1
+ fi
+
+ helper_print_success "status-left match"
+ helper_teardown
+ exit 0
+
+}
+
+main "$@"
diff --git a/tests/linux/test_check_gruvbox_light256_transparent_enabled.sh b/tests/linux/test_check_gruvbox_light256_transparent_enabled.sh
new file mode 100755
index 0000000..b8cf8a6
--- /dev/null
+++ b/tests/linux/test_check_gruvbox_light256_transparent_enabled.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+# shellcheck disable=SC1091
+source "${CURRENT_DIR}/../test_helpers.sh"
+# shellcheck disable=SC1091
+source "${CURRENT_DIR}/../tmux_utils.sh"
+
+main() {
+ helper_tearup_linux
+
+ cat <~/.tmux.conf
+# List of plugins
+set -g @plugin 'tmux-plugins/tpm'
+set -g @plugin 'tmux-plugins/tmux-sensible'
+
+# Other plugins
+set -g @plugin 'egel/tmux-gruvbox'
+set -g @tmux-gruvbox 'light256'
+set -g @tmux-gruvbox-statusbar-alpha 'true'
+
+# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
+run '~/.tmux/plugins/tpm/tpm'
+EOF
+
+ cat ~/.tmux.conf
+
+ # it's essential to link current repo to the plugins' directory
+ ln -sfv "$CURRENT_DIR/../../../tmux-gruvbox" "${HOME}/.tmux/plugins/tmux-gruvbox"
+
+ helper_install_tpm_plugins
+
+ # start new detached session
+ tmux new -d
+
+ # check if left side match
+ _status_left_expected="#[bg=colour239,fg=colour223] #S #[bg=colour250,fg=colour239,nobold,noitalics,nounderscore]"
+ _status_left_current=$(helper_tmux_get_statusleft)
+ if [[ "$_status_left_current" != "$_status_left_expected" ]]; then
+ helper_print_fail "status-left did not match" "$_status_left_current" "$_status_left_expected"
+ helper_teardown
+ exit 1
+ fi
+ # check if status is not transparent
+ _status_style_expected="bg=default,fg=colour237"
+ _status_style_current=$(helper_tmux_get_statusstyle)
+ if [[ "$_status_style_current" != "$_status_style_expected" ]]; then
+ helper_print_fail "status-style did not match" "$_status_style_current" "$_status_style_expected"
+ helper_teardown
+ exit 1
+ fi
+
+ helper_print_success "status-left match"
+ helper_teardown
+ exit 0
+
+}
+
+main "$@"
diff --git a/tests/linux/test_check_gruvbox_light_enabled.sh b/tests/linux/test_check_gruvbox_light_enabled.sh
new file mode 100755
index 0000000..8c4404f
--- /dev/null
+++ b/tests/linux/test_check_gruvbox_light_enabled.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+# shellcheck disable=SC1091
+source "${CURRENT_DIR}/../test_helpers.sh"
+
+main() {
+ helper_tearup_linux
+
+ cat <~/.tmux.conf
+# List of plugins
+set -g @plugin 'tmux-plugins/tpm'
+set -g @plugin 'tmux-plugins/tmux-sensible'
+
+# Other plugins
+set -g @plugin 'egel/tmux-gruvbox'
+set -g @tmux-gruvbox 'light'
+
+# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
+run '~/.tmux/plugins/tpm/tpm'
+EOF
+
+ cat ~/.tmux.conf
+
+ # it's essential to link current repo to the plugins' directory
+ ln -sfv "$CURRENT_DIR/../../../tmux-gruvbox" "${HOME}/.tmux/plugins/tmux-gruvbox"
+
+ helper_install_tpm_plugins
+
+ # start new detached session
+ tmux new -d
+
+ # check if left side match
+ _status_left_expected="#[bg=#bdae93,fg=#665c54] #S #[bg=#ebdbb2,fg=#bdae93,nobold,noitalics,nounderscore]"
+ _status_left_current=$(helper_tmux_get_statusleft)
+ if [[ "$_status_left_current" != "$_status_left_expected" ]]; then
+ helper_print_fail "status-left did not match" "$_status_left_current" "$_status_left_expected"
+ helper_teardown
+ exit 1
+ fi
+ # check if status is not transparent
+ _status_style_expected="bg=#ebdbb2,fg=#3c3836"
+ _status_style_current=$(helper_tmux_get_statusstyle)
+ if [[ "$_status_style_current" != "$_status_style_expected" ]]; then
+ helper_print_fail "status-style did not match" "$_status_style_current" "$_status_style_expected"
+ helper_teardown
+ exit 1
+ fi
+
+ helper_print_success "status-left match"
+ helper_teardown
+ exit 0
+
+}
+
+main "$@"
diff --git a/tests/linux/test_check_gruvbox_light_transparent_enabled.sh b/tests/linux/test_check_gruvbox_light_transparent_enabled.sh
new file mode 100755
index 0000000..309fc6f
--- /dev/null
+++ b/tests/linux/test_check_gruvbox_light_transparent_enabled.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+# shellcheck disable=SC1091
+source "${CURRENT_DIR}/../test_helpers.sh"
+
+main() {
+ helper_tearup_linux
+
+ cat <~/.tmux.conf
+# List of plugins
+set -g @plugin 'tmux-plugins/tpm'
+set -g @plugin 'tmux-plugins/tmux-sensible'
+
+# Other plugins
+set -g @plugin 'egel/tmux-gruvbox'
+set -g @tmux-gruvbox 'light'
+set -g @tmux-gruvbox-statusbar-alpha 'true'
+
+# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
+run '~/.tmux/plugins/tpm/tpm'
+EOF
+
+ cat ~/.tmux.conf
+
+ # it's essential to link current repo to the plugins' directory
+ ln -sfv "$CURRENT_DIR/../../../tmux-gruvbox" "${HOME}/.tmux/plugins/tmux-gruvbox"
+
+ helper_install_tpm_plugins
+
+ # start new detached session
+ tmux new -d
+
+ # check if left side match
+ _status_left_expected="#[bg=#bdae93,fg=#665c54] #S #[bg=#ebdbb2,fg=#bdae93,nobold,noitalics,nounderscore]"
+ _status_left_current=$(helper_tmux_get_statusleft)
+ if [[ "$_status_left_current" != "$_status_left_expected" ]]; then
+ helper_print_fail "status-left did not match" "$_status_left_current" "$_status_left_expected"
+ helper_teardown
+ exit 1
+ fi
+ # check if status is not transparent
+ _status_style_expected="bg=default,fg=#3c3836"
+ _status_style_current=$(helper_tmux_get_statusstyle)
+ if [[ "$_status_style_current" != "$_status_style_expected" ]]; then
+ helper_print_fail "status-style did not match" "$_status_style_current" "$_status_style_expected"
+ helper_teardown
+ exit 1
+ fi
+
+ helper_print_success "status-left match"
+ helper_teardown
+ exit 0
+
+}
+
+main "$@"
diff --git a/tests/linux/test_without_theme_fallback_to_gruvbox_dark256.sh b/tests/linux/test_without_theme_fallback_to_gruvbox_dark256.sh
new file mode 100755
index 0000000..b150655
--- /dev/null
+++ b/tests/linux/test_without_theme_fallback_to_gruvbox_dark256.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+# shellcheck disable=SC1091
+source "${CURRENT_DIR}/../test_helpers.sh"
+
+####
+# Test: when the theme is not defined in config it should fallback to 'dark256'
+#
+main() {
+ helper_tearup_linux
+
+ # set config without theme defined
+ cat <~/.tmux.conf
+# List of plugins
+set -g @plugin 'tmux-plugins/tpm'
+set -g @plugin 'tmux-plugins/tmux-sensible'
+
+# Other plugins
+set -g @plugin 'egel/tmux-gruvbox'
+
+# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
+run '~/.tmux/plugins/tpm/tpm'
+EOF
+
+ cat ~/.tmux.conf
+
+ # it's essential to link current repo to the plugins' directory
+ ln -sfv "$CURRENT_DIR/../../../tmux-gruvbox" "${HOME}/.tmux/plugins/tmux-gruvbox"
+
+ helper_install_tpm_plugins
+
+ # start new detached session
+ tmux new -d
+
+ # check if left side match
+ _status_left_expected="#[bg=colour241,fg=colour248] #S #[bg=colour237,fg=colour241,nobold,noitalics,nounderscore]"
+ _status_left_current=$(helper_tmux_get_statusleft)
+ if [[ "$_status_left_current" != "$_status_left_expected" ]]; then
+ helper_print_fail "status-left did not match" "$_status_left_current" "$_status_left_expected"
+ helper_teardown
+ exit 1
+ fi
+ # check if status is not transparent
+ _status_style_expected="bg=colour237,fg=colour223"
+ _status_style_current=$(helper_tmux_get_statusstyle)
+ if [[ "$_status_style_current" != "$_status_style_expected" ]]; then
+ helper_print_fail "status-style did not match" "$_status_style_current" "$_status_style_expected"
+ helper_teardown
+ exit 1
+ fi
+
+ helper_print_success "status-left match"
+ helper_teardown
+ exit 0
+}
+
+main "$@"
diff --git a/tests/run_all_linux_tests.sh b/tests/run_all_linux_tests.sh
new file mode 100755
index 0000000..77cde66
--- /dev/null
+++ b/tests/run_all_linux_tests.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+
+CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+main() {
+ set -e # exit on error
+ declare -i _countFailures
+ local _files
+ _countFailures=0
+ _files=$(find "$CURRENT_DIR/linux" -name "test_*" -type f)
+ for test in $_files; do
+ printf "\n"
+ printf "\n=============================================="
+ printf "\n %s" "$test"
+ printf "\n=============================================="
+ printf "\n"
+ bash -c "$test"
+
+ # run all and count failures
+ retVal=$?
+ if [ $retVal -eq 1 ]; then
+ _countFailures+=1
+ fi
+ done
+
+ # check if anything failed and fail
+ if [ "$_countFailures" -gt 0 ]; then
+ exit 1
+ fi
+}
+
+main "$@"
diff --git a/tests/test_helpers.sh b/tests/test_helpers.sh
new file mode 100644
index 0000000..7b199a4
--- /dev/null
+++ b/tests/test_helpers.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+helper_teardown() {
+ echo "TEARDOWN"
+ rm -rf ~/.tmux.conf
+ rm -rf ~/.tmux/
+ tmux kill-server >/dev/null 2>&1
+}
+
+helper_tearup_linux() {
+ if [[ "$(uname)" != "Linux" ]]; then
+ echo "NOT LINUX. Failed & exit."
+ exit 1
+ fi
+ echo "TEARUP LINUX"
+
+ # install software
+ sudo apt update -y
+ sudo apt install -y tmux git
+
+ # download TPM
+ mkdir -p ~/.tmux/plugins/
+ git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
+}
+
+helper_print_fail() {
+ local _msg="${1}"
+ local _current_val="${2}"
+ local _expected_val="${3}"
+ printf "FAIL. %s\n" "${_msg}"
+ printf "current value:\t%s\n" "$_current_val"
+ printf "expected value:\t%s\n" "$_expected_val"
+}
+
+helper_print_success() {
+ local _msg="${1}"
+ printf "SUCCESS. %s\n" "${_msg}"
+}
+
+helper_print_fail_and_exit() {
+ helper_print_fail "$1" "$2" "$3"
+ exit 1
+}
+
+helper_print_success_and_exit() {
+ helper_print_success "$1" "$2" "$3"
+ exit 0
+}
+
+# install TMP plugins with command
+helper_install_tpm_plugins() {
+ bash -c "${HOME}/.tmux/plugins/tpm/scripts/install_plugins.sh install_plugins"
+}
+
+# return the value of tmux status-style
+helper_tmux_get_statusstyle() {
+ local _val
+ _val=$(tmux show-option -gqv status-style)
+ echo "$_val"
+}
+
+# return the value of tmux status-left
+helper_tmux_get_statusleft() {
+ local _val
+ _val=$(tmux show-option -gqv status-left)
+ echo "$_val"
+}