Compare commits
47 commits
zoomed-pan
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d23f35e9de | ||
![]() |
4f9b6dfb1d | ||
![]() |
c7653229c7 | ||
![]() |
65d5df0909 | ||
![]() |
973e696836 | ||
![]() |
1086709b52 | ||
![]() |
fabc2ba12b | ||
![]() |
9f5301fe93 | ||
![]() |
80ca5fda10 | ||
![]() |
b1bbcf68d0 | ||
![]() |
281087db0b | ||
![]() |
245e31430f | ||
![]() |
19b98c6d60 | ||
![]() |
e631a41278 | ||
![]() |
dd1c215631 | ||
![]() |
28eed454f7 | ||
![]() |
fa42a2e465 | ||
![]() |
e33cccf5c6 | ||
![]() |
1cd5b27f14 | ||
![]() |
4d745744bf | ||
![]() |
1836745b74 | ||
![]() |
bbc44d7fbe | ||
![]() |
7b97440ebc | ||
![]() |
8e93542cc2 | ||
![]() |
84253ae979 | ||
![]() |
8aca1de5a8 | ||
![]() |
6caaf72088 | ||
![]() |
b2769b4963 | ||
![]() |
4f8b69ab8b | ||
![]() |
f01574b318 | ||
![]() |
6595a51154 | ||
![]() |
23bbbfcaee | ||
![]() |
1b97d625e6 | ||
![]() |
bf07efd322 | ||
![]() |
e2a2991235 | ||
![]() |
195f5faecd | ||
![]() |
600ab506ee | ||
![]() |
ac56569ba6 | ||
![]() |
d2fb0d94d8 | ||
![]() |
4b1faabf89 | ||
![]() |
fd200674c7 | ||
![]() |
c0d9038590 | ||
![]() |
700d74ecc3 | ||
![]() |
08a41368ad | ||
![]() |
43e899108f | ||
![]() |
35f911f5e2 | ||
![]() |
3f9e38d724 |
32 changed files with 1652 additions and 155 deletions
37
.editorconfig
Normal file
37
.editorconfig
Normal file
|
@ -0,0 +1,37 @@
|
|||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# EditorConfig is awesome: https://EditorConfig.org
|
||||
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# documentation, utils
|
||||
[*.{md,mdx,diff}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
# windows shell scripts
|
||||
[*.{cmd,bat,ps1}]
|
||||
end_of_line = crlf
|
||||
|
||||
[*.{sh,tmux}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
shell_variant = posix # like -ln=posix
|
||||
binary_next_line = true # like -bn
|
||||
switch_case_indent = true # like -ci
|
||||
space_redirects = true # like -sr
|
||||
keep_padding = true # like -kp
|
||||
function_next_line = true # like -fn
|
||||
never_split = true # like -ns
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
indent_size = 8
|
34
.github/workflows/dev-push-check.yml
vendored
Normal file
34
.github/workflows/dev-push-check.yml
vendored
Normal file
|
@ -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
|
9
.gitignore
vendored
9
.gitignore
vendored
|
@ -1,10 +1,13 @@
|
|||
# Editors
|
||||
# IntelliJ
|
||||
.idea/
|
||||
|
||||
# vim
|
||||
# vim/nvim
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# Systems
|
||||
# local workdir
|
||||
uncommited/
|
||||
|
||||
# macOS
|
||||
**/.DS_Store
|
||||
|
|
56
CHANGELOG.md
56
CHANGELOG.md
|
@ -1,28 +1,74 @@
|
|||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
### Changed
|
||||
|
||||
### Deprecated
|
||||
|
||||
### Removed
|
||||
|
||||
### 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
|
||||
|
||||
## [1.1.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)]
|
||||
- Added zoom indication when pane is maximiezed ([#17](https://github.com/egel/tmux-gruvbox/issues/17))
|
||||
|
||||
### Changed
|
||||
### Deprecated
|
||||
### Removed
|
||||
### Fixed
|
||||
|
||||
- Fixed spelling in the installation script ([#2](https://github.com/egel/tmux-gruvbox/issues/2))
|
||||
- Fixed visual bugs in gruvbox dark theme after release of new tmux v2.9 ([#6](https://github.com/egel/tmux-gruvbox/issues/6))
|
||||
- Fixed installation script by removing the no longer used `attr` from dark and light themes ([#15](https://github.com/egel/tmux-gruvbox/issues/15))
|
||||
|
||||
### Security
|
||||
|
||||
## [1.0.0] - 2016-07-26
|
||||
|
||||
### Added
|
||||
|
||||
- Added dark gruvbox colorscheme
|
||||
|
||||
[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
|
||||
|
|
12
Makefile
Normal file
12
Makefile
Normal file
|
@ -0,0 +1,12 @@
|
|||
.PHONY: lint_shellcheck
|
||||
lint_shellcheck:
|
||||
find . -type f -not -path "./uncommited/*" -a \( -iname "*.sh" \) | \
|
||||
xargs -I % sh -c 'shellcheck %'
|
||||
|
||||
.PHONY: lint_shfmt
|
||||
lint_shfmt:
|
||||
find . -type f -not -path "./uncommited/*" -a \( -iname "*.sh" \) | \
|
||||
xargs -I % sh -c 'shfmt -i=2 -l -d -ln=bash %'
|
||||
|
||||
.PHONY: check_scripts
|
||||
check_scripts: lint_shellcheck lint_shfmt
|
228
README.md
228
README.md
|
@ -1,41 +1,231 @@
|
|||
# Gruvbox color theme configuration for Tmux
|
||||
<div align="center">
|
||||
<img src="https://i.imgur.com/Ukyf4Iu.png" width="200px" referrerpolicy="no-referrer">
|
||||
<h1>Gruvbox theme for Tmux</h1>
|
||||
</div>
|
||||
|
||||
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].
|
||||
|
||||
> Screenshots made from macOS builtin terminal with xterm-256color and [Hack font][github-hack].
|
||||
<!--
|
||||
Using HTML table instead default markdown tables as provide it provide
|
||||
much better code readability especially for long columns.
|
||||
-->
|
||||
|
||||
| Dark theme | Light theme |
|
||||
|---|---|
|
||||
| <img src="https://i.imgur.com/STohAcp.png" title="Tmux grovbox dark colorscheme" style="width: 100%; max-width: 600px; text-align: center;" /> | <img src="https://i.imgur.com/zQZEFtU.png" title="Tmux grovbox light colorscheme" style="width: 100%; max-width: 600px; text-align: center;" /> |
|
||||
<div align="center">
|
||||
<a href="https://i.imgur.com/uGyGwlC.png" target="_blank" title="Grovbox dark and light themes for Tmux">
|
||||
<img src="https://i.imgur.com/p6lUnzb.png"
|
||||
title="Grovbox dark and light themes for Tmux"
|
||||
width="100%"
|
||||
height="auto"
|
||||
style="max-width: 800px; text-align: center; border-radius: 12px; overflow:hidden;"
|
||||
referrerpolicy="no-referrer"
|
||||
/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
> 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 manually
|
||||
### Install via [TPM][github-tpm] (recommended)
|
||||
|
||||
The simplest way is just:
|
||||
|
||||
> HINT: Always make a backup of your config files before any action.
|
||||
Add plugin at the top list of TPM plugins list in `.tmux.conf` and select desired theme.
|
||||
|
||||
```bash
|
||||
cat tmux-gruvbox-dark.conf >> ~/.tmux.conf
|
||||
```
|
||||
# ~/.tmux.conf
|
||||
|
||||
### Install through [Tmux Plugin Manager](https://github.com/tmux-plugins/tpm)
|
||||
set -g @plugin 'tmux-plugins/tpm' # mandatory
|
||||
set -g @plugin 'tmux-plugins/tmux-sensible' # optional recommended
|
||||
|
||||
Add plugin to the list of TPM plugins in `.tmux.conf` and select desired theme
|
||||
set -g @plugin 'https://git.k4li.de/mirrors/tmux-gruvbox'
|
||||
# set desired theme options...
|
||||
set -g @tmux-gruvbox 'dark' # or 'dark256', 'light', 'light256'
|
||||
|
||||
```bash
|
||||
set -g @plugin 'egel/tmux-gruvbox'
|
||||
set -g @tmux-gruvbox 'dark' # or 'light'
|
||||
# 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
|
||||
|
||||
> [!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/
|
||||
git clone ...
|
||||
```
|
||||
|
||||
1. Add theme at to top of your `~/.tmux.conf` config.
|
||||
|
||||
```bash
|
||||
# ~/.tmux.conf
|
||||
|
||||
run ~/projects/tmux-gruvbox/tmux-gruvbox.tmux
|
||||
# set desired options...
|
||||
set -g @tmux-gruvbox 'dark' # or 'dark256', 'light', 'light256'
|
||||
```
|
||||
|
||||
## Configuration options
|
||||
|
||||
<div align="center">
|
||||
<a href="https://i.imgur.com/tO5Y1NN.png" target="_blank" title="Grovbox dark and light themes configuration sections">
|
||||
<img src="https://i.imgur.com/x4tkeU7.png"
|
||||
title="Grovbox dark and light themes configuration sections"
|
||||
width="100%"
|
||||
height="auto"
|
||||
style="max-width: 800px; text-align: center; border-radius: 12px; overflow:hidden;"
|
||||
referrerpolicy="no-referrer" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
### Theme
|
||||
|
||||
- default value: `dark256`
|
||||
|
||||
| Theme name | Color palette | Preview link |
|
||||
| :--------- | :------------ | :-------------------------------------------------------------------- |
|
||||
| `dark` | 16-bit colors | <a href="https://i.imgur.com/ae88LQI.png" target="_blank">preview</a> |
|
||||
| `light` | 16-bit colors | <a href="https://i.imgur.com/fvpdRjg.png" target="_blank">preview</a> |
|
||||
| `dark256` | 256 colors | <a href="https://i.imgur.com/kzQTTCa.png" target="_blank">preview</a> |
|
||||
| `light256` | 256 colors | <a href="https://i.imgur.com/tQsl6LA.png" target="_blank">preview</a> |
|
||||
|
||||
```bash
|
||||
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'`
|
||||
- tmux >= 3.2 (experimental)
|
||||
|
||||
```bash
|
||||
set -g @tmux-gruvbox-statusbar-alpha 'true'
|
||||
```
|
||||
|
||||
### Left Status (Section A)
|
||||
|
||||
- default value: `'#S'` (session name)
|
||||
|
||||
```bash
|
||||
set -g @tmux-gruvbox-left-status-a '#S' # tmux's session name
|
||||
```
|
||||
|
||||
### Right Status (Section X)
|
||||
|
||||
- default value: `'%Y-%m-%d'`
|
||||
|
||||
This section is customizable for user, and by default contains current date.
|
||||
|
||||
```bash
|
||||
# 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'`
|
||||
|
||||
This section is customizable for user, and by default contains current time.
|
||||
|
||||
```bash
|
||||
# set US time format
|
||||
set -g @tmux-gruvbox-right-status-y '%I:%M %p' # 09:54 PM
|
||||
```
|
||||
|
||||
### Right Status (Section Z)
|
||||
|
||||
- default value: `'#h'` (hostname)
|
||||
|
||||
This section is customizable for user, and by default contains hostname.
|
||||
|
||||
```bash
|
||||
# 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:
|
||||
|
||||
1. clone the repository to desired place
|
||||
|
||||
```bash
|
||||
cd $HOME/projects/
|
||||
git clone ...
|
||||
```
|
||||
|
||||
1. create a symlink to the cloned repository (best in the standard [TPM][github-tpm] plugin directory):
|
||||
|
||||
```bash
|
||||
# cd to tmux plugin directory
|
||||
cd ~/.tmux/plugins/
|
||||
|
||||
# create symlink to cloned repo
|
||||
ln -sf $HOME/projects/tmux-gruvbox/ tmux-gruvbox
|
||||
```
|
||||
|
||||
1. and in `~/.tmux.conf` set
|
||||
|
||||
```bash
|
||||
# ~/.tmux.conf
|
||||
set -g @plugin 'egel/tmux-gruvbox'
|
||||
# set desired options...
|
||||
set -g @tmux-gruvbox 'dark'
|
||||
```
|
||||
|
||||
### Linters & formatters
|
||||
|
||||
To keep the files clean we use few program to help us achieve it:
|
||||
|
||||
1. Editorconfig (make sure your editor have it)
|
||||
2. Markdown (prettier/prettierd)
|
||||
3. Shell (shellcheck, shfmt)
|
||||
|
||||
## License
|
||||
|
||||
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
|
||||
[tmux-color-solarized]: https://github.com/seebi/tmux-colors-solarized
|
||||
[github-nerd-fonts]: https://github.com/ryanoasis/nerd-fonts
|
||||
[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
|
||||
[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/
|
||||
|
|
73
docs/migration-guide-from-v1-to-v2.md
Normal file
73
docs/migration-guide-from-v1-to-v2.md
Normal file
|
@ -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 `<prefix>` + `I`.
|
||||
|
||||
[docs-changelog]: ../CHANGELOG.md
|
||||
[github-gist-andersevenrud-alacritty-tmux-vim-truecolor]: https://gist.github.com/andersevenrud/015e61af2fd264371032763d4ed965b6
|
|
@ -1,25 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
THEME_OPTION="@tmux-gruvbox"
|
||||
DEFAULT_THEME="dark"
|
||||
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "${CURRENT_DIR}/src/gruvbox-main.sh"
|
||||
|
||||
get_theme() {
|
||||
local option="$1"
|
||||
local default_value="$2"
|
||||
local option_value
|
||||
option_value=$(tmux show-option -gqv "$option")
|
||||
if [ -z "$option_value" ]; then
|
||||
echo "$default_value"
|
||||
else
|
||||
echo "$option_value"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
local theme
|
||||
theme=$(get_theme "$THEME_OPTION" "$DEFAULT_THEME")
|
||||
tmux source-file "$CURRENT_DIR/tmux-gruvbox-${theme}.conf"
|
||||
}
|
||||
|
||||
main
|
||||
# vim: ai et ft=bash
|
||||
|
|
98
src/gruvbox-main.sh
Executable file
98
src/gruvbox-main.sh
Executable file
|
@ -0,0 +1,98 @@
|
|||
#!/bin/bash
|
||||
|
||||
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
readonly CURRENT_DIR
|
||||
|
||||
# hold the array of all command to configure tmux theme
|
||||
declate -a TMUX_CMDS
|
||||
|
||||
# load libraries
|
||||
# shellcheck disable=1091
|
||||
source "${CURRENT_DIR}/helper_methods.sh"
|
||||
# shellcheck disable=1091
|
||||
source "${CURRENT_DIR}/tmux_utils.sh"
|
||||
|
||||
readonly TMUX_GRUVBOX="@tmux-gruvbox"
|
||||
readonly TMUX_GRUVBOX_STATUSBAR_ALPHA="@tmux-gruvbox-statusbar-alpha"
|
||||
readonly TMUX_GRUVBOX_LEFT_STATUS_A="@tmux-gruvbox-left-status-a"
|
||||
readonly TMUX_GRUVBOX_RIGHT_STAUTS_X="@tmux-gruvbox-right-status-x"
|
||||
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)
|
||||
readonly DEFAULT_THEME="dark256"
|
||||
readonly DEFAULT_STATUSBAR_ALPHA='false'
|
||||
# defaults for theme option (with color interpolation)
|
||||
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
|
||||
|
||||
# load proper palette for the theme asap to avoid additional variable interpolation
|
||||
local _theme
|
||||
_theme=$(tmux_get_option "${TMUX_GRUVBOX}" "${DEFAULT_THEME}")
|
||||
_statusbar_alpha=$(tmux_get_option "${TMUX_GRUVBOX_STATUSBAR_ALPHA}" "${DEFAULT_STATUSBAR_ALPHA}")
|
||||
|
||||
case "$_theme" in
|
||||
light)
|
||||
# shellcheck disable=1091
|
||||
source "${CURRENT_DIR}/palette_gruvbox_light.sh"
|
||||
# shellcheck disable=1091
|
||||
source "${CURRENT_DIR}/theme_gruvbox_light.sh"
|
||||
;;
|
||||
light256)
|
||||
# shellcheck disable=1091
|
||||
source "${CURRENT_DIR}/palette_gruvbox_light256.sh"
|
||||
# shellcheck disable=1091
|
||||
source "${CURRENT_DIR}/theme_gruvbox_light256.sh"
|
||||
;;
|
||||
dark)
|
||||
# shellcheck disable=1091
|
||||
source "${CURRENT_DIR}/palette_gruvbox_dark.sh"
|
||||
# shellcheck disable=1091
|
||||
source "${CURRENT_DIR}/theme_gruvbox_dark.sh"
|
||||
;;
|
||||
dark256 | *)
|
||||
# shellcheck disable=1091
|
||||
source "${CURRENT_DIR}/palette_gruvbox_dark256.sh"
|
||||
# shellcheck disable=1091
|
||||
source "${CURRENT_DIR}/theme_gruvbox_dark.sh"
|
||||
;;
|
||||
esac
|
||||
|
||||
local _status_left _status_right _window_status_current_format _window_status_format
|
||||
_status_left_a=$(tmux_get_option "$TMUX_GRUVBOX_LEFT_STATUS_A" "$DEFAULT_LEFT_STATUS_A")
|
||||
_status_right_x=$(tmux_get_option "$TMUX_GRUVBOX_RIGHT_STAUTS_X" "$DEFAULT_RIGHT_STATUS_X")
|
||||
_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")
|
||||
|
||||
local _theme_args
|
||||
_theme_args=(
|
||||
"$_status_left_a"
|
||||
"$_status_right_x"
|
||||
"$_status_right_y"
|
||||
"$_status_right_z"
|
||||
"$_statusbar_alpha"
|
||||
)
|
||||
|
||||
case $_theme in
|
||||
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[@]}"
|
||||
;;
|
||||
esac
|
||||
|
||||
# execute commands with tmux as array of options
|
||||
tmux "${TMUX_CMDS[@]}"
|
||||
}
|
||||
|
||||
main "$@"
|
19
src/helper_methods.sh
Normal file
19
src/helper_methods.sh
Normal file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
# simply print passed array
|
||||
#
|
||||
# example
|
||||
#
|
||||
# myarray=()
|
||||
# print_array myarray
|
||||
#
|
||||
print_array() {
|
||||
local -n arr # -n available over bash 4.3
|
||||
arr=$1
|
||||
|
||||
echo ""
|
||||
echo "begin >>>"
|
||||
printf "%s\n" "${arr[@]}"
|
||||
echo "<<< end"
|
||||
echo ""
|
||||
}
|
46
src/palette_gruvbox_dark.sh
Normal file
46
src/palette_gruvbox_dark.sh
Normal file
|
@ -0,0 +1,46 @@
|
|||
#!/bin/bash
|
||||
|
||||
##########################
|
||||
# gruvbox dark pallete
|
||||
##########################
|
||||
|
||||
####
|
||||
# When using 'colour124' you are using the color default in terminal pallete.
|
||||
# This could be important for people which terminals support only 256 colors
|
||||
# and does not support HEX values.
|
||||
#
|
||||
# The names of colors used from https://github.com/morhetz/gruvbox
|
||||
|
||||
# shellcheck disable=2034 # ignored as this file only contains var definitions
|
||||
col_bg="#282828"
|
||||
col_bg0_h="#1d2021"
|
||||
col_bg0="#282828"
|
||||
col_bg1="#3c3836"
|
||||
col_bg2="#504945"
|
||||
col_bg3="#665c54"
|
||||
col_bg4="#7c6f64"
|
||||
col_gray0="#a89984"
|
||||
col_gray1="#928374"
|
||||
col_gray2="#928374"
|
||||
col_bg0_s="#32302f"
|
||||
col_fg="#ebdbb2"
|
||||
col_fg4="#a89984"
|
||||
col_fg3="#bdae93"
|
||||
col_fg2="#d5c4a1"
|
||||
col_fg1="#ebdbb2"
|
||||
col_fg0="#fbf1c7"
|
||||
|
||||
col_red="#cc241d"
|
||||
col_red2="#fb4934"
|
||||
col_green="#98971a"
|
||||
col_green2="#b8bb26"
|
||||
col_yellow="#d79921"
|
||||
col_yellow2="#fabd2f"
|
||||
col_blue="#458588"
|
||||
col_blue2="#83a598"
|
||||
col_purple="#b16286"
|
||||
col_purple2="#d3869b"
|
||||
col_aqua="#689d6a"
|
||||
col_aqua2="#8ec07c"
|
||||
col_orange="#d65d0e"
|
||||
col_orange2="#fe8019"
|
46
src/palette_gruvbox_dark256.sh
Normal file
46
src/palette_gruvbox_dark256.sh
Normal file
|
@ -0,0 +1,46 @@
|
|||
#!/bin/bash
|
||||
|
||||
##########################
|
||||
# gruvbox dark256 pallete
|
||||
##########################
|
||||
|
||||
####
|
||||
# When using 'colour124' you are using the color default in terminal pallete.
|
||||
# This could be important for people which terminals support only 256 colors
|
||||
# and does not support HEX values.
|
||||
#
|
||||
# The names of colors used from https://github.com/morhetz/gruvbox
|
||||
|
||||
# shellcheck disable=2034 # ignored as this file only contains var definitions
|
||||
col_bg=colour235
|
||||
col_bg0_h=colour234
|
||||
col_bg0=colour235
|
||||
col_bg1=colour237
|
||||
col_bg2=colour239
|
||||
col_bg3=colour241
|
||||
col_bg4=colour243
|
||||
col_gray0=colour246
|
||||
col_gray1=colour245
|
||||
col_gray2=colour245
|
||||
col_bg0_s=colour236
|
||||
col_fg=colour223
|
||||
col_fg4=colour246
|
||||
col_fg3=colour167
|
||||
col_fg2=colour250
|
||||
col_fg1=colour223
|
||||
col_fg0=colour229
|
||||
|
||||
col_red=colour124
|
||||
col_red2=colour167
|
||||
col_green=colour106
|
||||
col_green2=colour142
|
||||
col_yellow=colour172
|
||||
col_yellow2=colour214
|
||||
col_blue=colour66
|
||||
col_blue2=colour109
|
||||
col_purple=colour132
|
||||
col_purple2=colour175
|
||||
col_aqua=colour72
|
||||
col_aqua2=colour108
|
||||
col_orange=colour166
|
||||
col_orange2=colour208
|
46
src/palette_gruvbox_light.sh
Normal file
46
src/palette_gruvbox_light.sh
Normal file
|
@ -0,0 +1,46 @@
|
|||
#!/bin/bash
|
||||
|
||||
##########################
|
||||
# gruvbox light pallete
|
||||
##########################
|
||||
|
||||
####
|
||||
# When using 'colour124' you are using the color default in terminal pallete.
|
||||
# This could be important for people which terminals support only 256 colors
|
||||
# and does not support HEX values.
|
||||
#
|
||||
# The names of colors used from https://github.com/morhetz/gruvbox
|
||||
|
||||
# shellcheck disable=2034 # ignored as this file only contains var definitions
|
||||
col_bg="#fbf1c7"
|
||||
col_bg0_h="#f9f5d7"
|
||||
col_bg0="#fbf1c7"
|
||||
col_bg1="#ebdbb2"
|
||||
col_bg2="#d5c4a1"
|
||||
col_bg3="#bdae93"
|
||||
col_bg4="#a89984"
|
||||
col_gray0="#7c6f64"
|
||||
col_gray1="#928374"
|
||||
col_gray2="#928374"
|
||||
col_bg0_s="#f2e5bc"
|
||||
col_fg="#3c3836"
|
||||
col_fg4="#7c6f64"
|
||||
col_fg3="#665c54"
|
||||
col_fg2="#504945"
|
||||
col_fg1="#3c3836"
|
||||
col_fg0="#282828"
|
||||
|
||||
col_red="#cc241d"
|
||||
col_red2="#9d0006"
|
||||
col_green="#98971a"
|
||||
col_green2="#79740e"
|
||||
col_yellow="#d79921"
|
||||
col_yellow2="#b57614"
|
||||
col_blue="#458588"
|
||||
col_blue2="#076678"
|
||||
col_purple="#b16286"
|
||||
col_purple2="#8f3f71"
|
||||
col_aqua="#689d6a"
|
||||
col_aqua2="#427b58"
|
||||
col_orange="#d65d0e"
|
||||
col_orange2="#af3a03"
|
46
src/palette_gruvbox_light256.sh
Normal file
46
src/palette_gruvbox_light256.sh
Normal file
|
@ -0,0 +1,46 @@
|
|||
#!/bin/bash
|
||||
|
||||
##########################
|
||||
# gruvbox light256 pallete
|
||||
##########################
|
||||
|
||||
####
|
||||
# When using 'colour124' you are using the color default in terminal pallete.
|
||||
# This could be important for people which terminals support only 256 colors
|
||||
# and does not support HEX values.
|
||||
#
|
||||
# The names of colors used from https://github.com/morhetz/gruvbox
|
||||
|
||||
# shellcheck disable=2034 # ignored as this file only contains var definitions
|
||||
col_bg=colour229
|
||||
col_bg0_h=colour230
|
||||
col_bg0=colour229
|
||||
col_bg1=colour223
|
||||
col_bg2=colour250
|
||||
col_bg3=colour248
|
||||
col_bg4=colour246
|
||||
col_gray0=colour246
|
||||
col_gray1=colour245
|
||||
col_gray2=colour244
|
||||
col_bg0_s=colour228
|
||||
col_fg=colour223
|
||||
col_fg4=colour243
|
||||
col_fg3=colour241
|
||||
col_fg2=colour239
|
||||
col_fg1=colour237
|
||||
col_fg0=colour235
|
||||
|
||||
col_red=colour124
|
||||
col_red2=colour88
|
||||
col_green=colour106
|
||||
col_green2=colour100
|
||||
col_yellow=colour172
|
||||
col_yellow2=colour136
|
||||
col_blue=colour66
|
||||
col_blue2=colour24
|
||||
col_purple=colour132
|
||||
col_purple2=colour96
|
||||
col_aqua=colour72
|
||||
col_aqua2=colour66
|
||||
col_orange=colour166
|
||||
col_orange2=colour130
|
79
src/theme_gruvbox_dark.sh
Normal file
79
src/theme_gruvbox_dark.sh
Normal file
|
@ -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_dark() {
|
||||
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_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
|
||||
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_bg3},fg=${col_fg3}] ${_left_status_a} #[bg=${col_bg1},fg=${col_bg3},nobold,noitalics,nounderscore]"
|
||||
|
||||
# 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]"
|
||||
}
|
79
src/theme_gruvbox_light.sh
Normal file
79
src/theme_gruvbox_light.sh
Normal file
|
@ -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_light() {
|
||||
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_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
|
||||
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_bg3},fg=${col_fg3}] ${_left_status_a} #[bg=${col_bg1},fg=${col_bg3},nobold,noitalics,nounderscore]"
|
||||
|
||||
# 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]"
|
||||
}
|
79
src/theme_gruvbox_light256.sh
Normal file
79
src/theme_gruvbox_light256.sh
Normal file
|
@ -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]"
|
||||
}
|
63
src/tmux_utils.sh
Normal file
63
src/tmux_utils.sh
Normal file
|
@ -0,0 +1,63 @@
|
|||
#!/bin/bash
|
||||
|
||||
# get desired tmux option or use given default value
|
||||
tmux_get_option() {
|
||||
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 window-option from tmux or default
|
||||
tmux_get_window_option() {
|
||||
local _option_name _default_value
|
||||
_option_name="$1"
|
||||
_default_value="$2"
|
||||
|
||||
local _current_option_value
|
||||
_current_option_value=$(tmux show-window-option -gqv "$_option_name")
|
||||
if [[ -n "$_current_option_value" ]]; then
|
||||
echo "$_current_option_value"
|
||||
else
|
||||
echo "$_default_value"
|
||||
fi
|
||||
}
|
||||
|
||||
# append preconfigured tmux set-option to global array
|
||||
tmux_append_seto() {
|
||||
local _option _value _result
|
||||
_option="$1"
|
||||
_value="$2"
|
||||
TMUX_CMDS+=("set-option" "-gq" "${_option}" "${_value}" ";")
|
||||
}
|
||||
|
||||
# append preconfigured tmux set-window-option to global array
|
||||
tmux_append_setwo() {
|
||||
local _option _value _result
|
||||
_option="$1"
|
||||
_value="$2"
|
||||
TMUX_CMDS+=("set-window-option" "-gq" "${_option}" "${_value}" ";")
|
||||
}
|
||||
|
||||
# imediately execute tmux option
|
||||
tmux_set_option_now() {
|
||||
local _option_name _value
|
||||
_option_name="$1"
|
||||
_value="$2"
|
||||
tmux set-option -gq "$_option_name" "$_value"
|
||||
}
|
||||
|
||||
# imediately execute tmux option
|
||||
tmux_set_window_option_now() {
|
||||
local _option_name _value
|
||||
_option_name="$1"
|
||||
_value="$2"
|
||||
tmux set-window-option -gq "$_option_name" "$_value"
|
||||
}
|
6
tests/linux/README.md
Normal file
6
tests/linux/README.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Linux tests
|
||||
|
||||
Those tests are meant to run on linux:
|
||||
|
||||
- ubuntu 20.04 LTS
|
||||
- with bash
|
57
tests/linux/test_check_gruvbox_dark256_enabled.sh
Executable file
57
tests/linux/test_check_gruvbox_dark256_enabled.sh
Executable file
|
@ -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 <<EOF >~/.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 "$@"
|
58
tests/linux/test_check_gruvbox_dark256_transparent_enabled.sh
Executable file
58
tests/linux/test_check_gruvbox_dark256_transparent_enabled.sh
Executable file
|
@ -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 <<EOF >~/.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 "$@"
|
57
tests/linux/test_check_gruvbox_dark_enabled.sh
Executable file
57
tests/linux/test_check_gruvbox_dark_enabled.sh
Executable file
|
@ -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 <<EOF >~/.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 "$@"
|
58
tests/linux/test_check_gruvbox_dark_transparent_enabled.sh
Executable file
58
tests/linux/test_check_gruvbox_dark_transparent_enabled.sh
Executable file
|
@ -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 <<EOF >~/.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 "$@"
|
57
tests/linux/test_check_gruvbox_light256_enabled.sh
Executable file
57
tests/linux/test_check_gruvbox_light256_enabled.sh
Executable file
|
@ -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 <<EOF >~/.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 "$@"
|
60
tests/linux/test_check_gruvbox_light256_transparent_enabled.sh
Executable file
60
tests/linux/test_check_gruvbox_light256_transparent_enabled.sh
Executable file
|
@ -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 <<EOF >~/.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 "$@"
|
57
tests/linux/test_check_gruvbox_light_enabled.sh
Executable file
57
tests/linux/test_check_gruvbox_light_enabled.sh
Executable file
|
@ -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 <<EOF >~/.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 "$@"
|
58
tests/linux/test_check_gruvbox_light_transparent_enabled.sh
Executable file
58
tests/linux/test_check_gruvbox_light_transparent_enabled.sh
Executable file
|
@ -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 <<EOF >~/.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 "$@"
|
59
tests/linux/test_without_theme_fallback_to_gruvbox_dark256.sh
Executable file
59
tests/linux/test_without_theme_fallback_to_gruvbox_dark256.sh
Executable file
|
@ -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 <<EOF >~/.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 "$@"
|
32
tests/run_all_linux_tests.sh
Executable file
32
tests/run_all_linux_tests.sh
Executable file
|
@ -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 "$@"
|
67
tests/test_helpers.sh
Normal file
67
tests/test_helpers.sh
Normal file
|
@ -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"
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
## COLORSCHEME: gruvbox dark (medium)
|
||||
set-option -g status "on"
|
||||
|
||||
# default statusbar color
|
||||
set-option -g status-style bg=colour237,fg=colour223 # bg=bg1, fg=fg1
|
||||
|
||||
# default window title colors
|
||||
set-window-option -g window-status-style bg=colour214,fg=colour237 # bg=yellow, fg=bg1
|
||||
|
||||
# default window with an activity alert
|
||||
set-window-option -g window-status-activity-style bg=colour237,fg=colour248 # bg=bg1, fg=fg3
|
||||
|
||||
# active window title colors
|
||||
set-window-option -g window-status-current-style bg=red,fg=colour237 # fg=bg1
|
||||
|
||||
# pane border
|
||||
set-option -g pane-active-border-style fg=colour250 #fg2
|
||||
set-option -g pane-border-style fg=colour237 #bg1
|
||||
|
||||
# message infos
|
||||
set-option -g message-style bg=colour239,fg=colour223 # bg=bg2, fg=fg1
|
||||
|
||||
# writing commands inactive
|
||||
set-option -g message-command-style bg=colour239,fg=colour223 # bg=fg3, fg=bg1
|
||||
|
||||
# pane number display
|
||||
set-option -g display-panes-active-colour colour250 #fg2
|
||||
set-option -g display-panes-colour colour237 #bg1
|
||||
|
||||
# clock
|
||||
set-window-option -g clock-mode-colour colour109 #blue
|
||||
|
||||
# bell
|
||||
set-window-option -g window-status-bell-style bg=colour167,fg=colour235 # 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 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 "#[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 "#[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:
|
|
@ -1,56 +0,0 @@
|
|||
## 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 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 "#[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:
|
Loading…
Add table
Add a link
Reference in a new issue