Moving config and local to (dot) prefix

This commit is contained in:
2026-06-01 16:41:36 +01:00
parent d6561d9d20
commit 904819fba5
32615 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
# 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
# go
[*.go]
indent_style = tab
indent_size = 4
# python
[*.{ini,py,py.tpl,rst}]
indent_size = 4
# rust
[*.rs]
indent_size = 4
# documentation, utils
[*.{md,mdx,diff}]
trim_trailing_whitespace = false
# windows shell scripts
[*.{cmd,bat,ps1}]
end_of_line = crlf

View File

@@ -0,0 +1,3 @@
custom
!custom/README.md
!custom/example.sh

View File

@@ -0,0 +1,15 @@
{
"$schema": "https://raw.githubusercontent.com/DavidAnson/markdownlint/v0.35.0/schema/markdownlint-config-schema.json",
"line-length": {
"code_block_line_length": 120,
"tables": false
},
"no-inline-html": {
"allowed_elements": ["details", "summary", "img", "p", "a", "h3"]
},
"first-line-heading": false,
"no-alt-text": false,
"code-block-style": {
"style": "consistent"
}
}

View File

@@ -0,0 +1,6 @@
shell=bash
# TODO: Find a way to declare color variables
disable=SC2154
external-sources=true

View File

@@ -0,0 +1,181 @@
# Changelog
## [2.1.3](https://github.com/catppuccin/tmux/compare/v2.1.2...v2.1.3) (2025-03-23)
### Fixed
* make the space in [@catppuccin](https://github.com/catppuccin)_window_flags_icon_format user-configurable ([#465](https://github.com/catppuccin/tmux/issues/465)) ([320e184](https://github.com/catppuccin/tmux/commit/320e184a31d0825cb4f4af550492cbdff2fc3ffc))
* pomodoro plugin icon color - use a defined color (peach) rather than orange ([#466](https://github.com/catppuccin/tmux/issues/466)) ([da2143d](https://github.com/catppuccin/tmux/commit/da2143d2a6baf7951eda302678a57a171a78d78a))
* use plain awk for the load status line module, removing a dep ([#508](https://github.com/catppuccin/tmux/issues/508)) ([c21246e](https://github.com/catppuccin/tmux/commit/c21246ed58e867c9594dc687c5e92b229bc1760d))
* use the correct option for the left separator for the current window ([#450](https://github.com/catppuccin/tmux/issues/450)) ([ba9bd88](https://github.com/catppuccin/tmux/commit/ba9bd88c98c81f25060f051ed983e40f82fdd3ba))
### Documentation
* add a troubleshooting guide ([#473](https://github.com/catppuccin/tmux/issues/473)) ([ab647cf](https://github.com/catppuccin/tmux/commit/ab647cf91501cebbd3f967da2b488a5f87614e6b))
* Correct the plugin path for TPM in the readme ([#492](https://github.com/catppuccin/tmux/issues/492)) ([ee8970d](https://github.com/catppuccin/tmux/commit/ee8970ddb5dd60fd93e254de9a30ed8277c7ccc7))
* **README:** fix codeblock indentation ([#489](https://github.com/catppuccin/tmux/issues/489)) ([cce60ab](https://github.com/catppuccin/tmux/commit/cce60abc8efd7a641a5fcc8001e6b3ae61e8d5fe))
* **README:** update migration guide issue link ([#493](https://github.com/catppuccin/tmux/issues/493)) ([073ee54](https://github.com/catppuccin/tmux/commit/073ee54992c59fedcc29c1525a26f95691f0ae1f))
## [2.1.2](https://github.com/catppuccin/tmux/compare/v2.1.1...v2.1.2) (2024-12-08)
### Fixed
* improve uptime status sed script to report correct units for few uptime scenarios ([#437](https://github.com/catppuccin/tmux/issues/437)) ([31fc2bf](https://github.com/catppuccin/tmux/commit/31fc2bfb1123681dc06da613b944b85f81e4babd))
* use current window separators for the current window format ([#443](https://github.com/catppuccin/tmux/issues/443)) ([2a6c45b](https://github.com/catppuccin/tmux/commit/2a6c45b7c0da1594de1105d6cef15e3e68981113))
## [2.1.1](https://github.com/catppuccin/tmux/compare/v2.1.0...v2.1.1) (2024-11-17)
### Fixed
* escape the TPM environment variable in the kube status line module ([#434](https://github.com/catppuccin/tmux/issues/434)) ([eb78ade](https://github.com/catppuccin/tmux/commit/eb78ade9dc1f6cd8ba654572f51ddcae3c6e7fd7))
* specify the color for right separator of the status modules to be the same as text bg color ([#429](https://github.com/catppuccin/tmux/issues/429)) ([0e66dee](https://github.com/catppuccin/tmux/commit/0e66dee11ee396824668d4db863f1873e9e9243f))
### Documentation
* add possible values for window_flags ([#417](https://github.com/catppuccin/tmux/issues/417)) ([c8a2d1a](https://github.com/catppuccin/tmux/commit/c8a2d1ae9649aa904960bef1516ea2ff9a3e6ad0))
* **custom-status:** fix typo `catpuccin` -> `catppuccin` ([#424](https://github.com/catppuccin/tmux/issues/424)) ([aaf9120](https://github.com/catppuccin/tmux/commit/aaf9120f769a34e5491b3ee7f885c8c347f2f663))
## [2.1.0](https://github.com/catppuccin/tmux/compare/v2.0.0...v2.1.0) (2024-10-25)
### Added
* add an option to format the window number with `[@catppuccin](https://github.com/catppuccin)_window_number` and `[@catppuccin](https://github.com/catppuccin)_window_current_number` ([c749885](https://github.com/catppuccin/tmux/commit/c74988511a462bdf07c5fc9ce88157b93a4ed185))
### Fixed
* allow for dynamic colors in status modules ([#411](https://github.com/catppuccin/tmux/issues/411)), fixes issue [#407](https://github.com/catppuccin/tmux/issues/407) ([5e273e4](https://github.com/catppuccin/tmux/commit/5e273e41dd3188a1a0e795b120623c95de491445))
* session status icon bg color change by client_prefix ([#394](https://github.com/catppuccin/tmux/issues/394)) ([8855667](https://github.com/catppuccin/tmux/commit/885566714315915547516de5c2f1b660f8e524c2))
### Documentation
* **README:** add [@kjnsn](https://github.com/kjnsn) to "Thanks to" section ([#398](https://github.com/catppuccin/tmux/issues/398)) ([c3fab98](https://github.com/catppuccin/tmux/commit/c3fab98ab4248a2a78c8193ad48f0991b7bfa1e3))
## [2.0.0](https://github.com/catppuccin/tmux/compare/v1.0.3...v2.0.0) (2024-10-21)
### ⚠ BREAKING CHANGES
* rebalance the colors used, and follow the styleguide
* change how windows are styled
* change how status modules are styled
* rebalance colors, adhere to style guide & overhaul docs ([#372](https://github.com/catppuccin/tmux/issues/372))
### Features
* change how status modules are styled ([79284da](https://github.com/catppuccin/tmux/commit/79284da665bf5d39d304e23df4165c8ac37f9b7a))
* rebalance colors, adhere to style guide & overhaul docs ([#372](https://github.com/catppuccin/tmux/issues/372)) ([79284da](https://github.com/catppuccin/tmux/commit/79284da665bf5d39d304e23df4165c8ac37f9b7a))
* rebalance the colors used, and follow the styleguide ([79284da](https://github.com/catppuccin/tmux/commit/79284da665bf5d39d304e23df4165c8ac37f9b7a))
* rebalance the status module colors for cpu and battery ([79284da](https://github.com/catppuccin/tmux/commit/79284da665bf5d39d304e23df4165c8ac37f9b7a))
* replace `_ctp_status_bg` with unified `_ctp_module_bg_color` in module configuration ([a4d4ad0](https://github.com/catppuccin/tmux/commit/a4d4ad09cc8b5c9338cbd4510450d0ae997a7710))
### Bug Fixes
* **tests:** add tests for window styling ([79284da](https://github.com/catppuccin/tmux/commit/79284da665bf5d39d304e23df4165c8ac37f9b7a))
* use ubuntu-24.04 in ci ([#388](https://github.com/catppuccin/tmux/issues/388)) ([3b0e0a6](https://github.com/catppuccin/tmux/commit/3b0e0a6f0741bf09149f23620516decd7b5f5ba5))
### Code Refactoring
* change how windows are styled ([79284da](https://github.com/catppuccin/tmux/commit/79284da665bf5d39d304e23df4165c8ac37f9b7a))
## [1.0.3](https://github.com/catppuccin/tmux/compare/v1.0.2...v1.0.3) (2024-10-16)
### Bug Fixes
* change the default status line background to mantle ([#377](https://github.com/catppuccin/tmux/issues/377)) ([47dbe81](https://github.com/catppuccin/tmux/commit/47dbe818e3ad7a008ccbd3e5d69a29a4509f7d07))
## [1.0.2](https://github.com/catppuccin/tmux/compare/v1.0.1...v1.0.2) (2024-10-12)
### Bug Fixes
* **ci:** update tmux in test workflow ([#370](https://github.com/catppuccin/tmux/issues/370)) ([02debd3](https://github.com/catppuccin/tmux/commit/02debd396802af9fe4b41601739e48ef38217533))
* **status:** use a literal string for battery_icon so it can be replaced by the battery plugin ([#365](https://github.com/catppuccin/tmux/issues/365)) ([06fff2f](https://github.com/catppuccin/tmux/commit/06fff2f40ec4a5cd2c9e064bc7fde22130ecd4bb)), closes [#342](https://github.com/catppuccin/tmux/issues/342)
* typo in readme config example ([#362](https://github.com/catppuccin/tmux/issues/362)) ([41ee0b8](https://github.com/catppuccin/tmux/commit/41ee0b89acb3f4afe531209558d6b8e4d7d4ae1a))
* **window:** middle separator colors ([#369](https://github.com/catppuccin/tmux/issues/369)) ([c59df83](https://github.com/catppuccin/tmux/commit/c59df83d68e64feb8d015c2eb3f8b90febc95a53))
## [1.0.1](https://github.com/catppuccin/tmux/compare/v1.0.0...v1.0.1) (2024-10-05)
### Bug Fixes
* **readme:** fix the example configurations ([#343](https://github.com/catppuccin/tmux/issues/343)) ([06183b3](https://github.com/catppuccin/tmux/commit/06183b31216b4ed917760b3d59565e242eee6a64))
* **readme:** fix the version number, and fix escaping in the custom status line module docs ([#357](https://github.com/catppuccin/tmux/issues/357)) ([db466f8](https://github.com/catppuccin/tmux/commit/db466f8c2dbcfdd84e501ee8274bdfdcf049d65d))
## [1.0.0](https://github.com/catppuccin/tmux/compare/v0.4.0...v1.0.0) (2024-10-02)
### Bug Fixes
* **readme:** remove -F when setting the status line ([#333](https://github.com/catppuccin/tmux/issues/333)) ([b38421f](https://github.com/catppuccin/tmux/commit/b38421fa15d8dfafecaf6f438115cfe3c1259bf0))
## [0.4.0](https://github.com/catppuccin/tmux/compare/v0.3.0...v0.4.0) (2024-10-01)
### ⚠ BREAKING CHANGES
* rewrite to use tmux native rather than bash ([#328](https://github.com/catppuccin/tmux/issues/328))
### Bug Fixes
* **readme:** update the readme to include upgrade instructions ([1bcad05](https://github.com/catppuccin/tmux/commit/1bcad05f206fb4bb9706403da24b97d2cdb64bad))
* **window:** ensure the window formats are set correctly ([#331](https://github.com/catppuccin/tmux/issues/331)) ([1bcad05](https://github.com/catppuccin/tmux/commit/1bcad05f206fb4bb9706403da24b97d2cdb64bad))
### Code Refactoring
* rewrite to use tmux native rather than bash ([#328](https://github.com/catppuccin/tmux/issues/328)) ([87fa4a0](https://github.com/catppuccin/tmux/commit/87fa4a08c5a7fdbef3130f05a8b12f0ca26d4a46))
## [0.3.0](https://github.com/catppuccin/tmux/compare/v0.2.0...v0.3.0) (2024-09-17)
### Features
* **status:** Add support for status module middle separators ([#310](https://github.com/catppuccin/tmux/issues/310)) ([1612a23](https://github.com/catppuccin/tmux/commit/1612a23174a6771ac466312eb156f83b8b89d907))
* **status:** window specific separator config ([#198](https://github.com/catppuccin/tmux/issues/198)) ([8276c5a](https://github.com/catppuccin/tmux/commit/8276c5a5e33dbbbae3d370db2f6129e20b402f8a))
### Bug Fixes
* **kube:** escape env var ([c31b9b2](https://github.com/catppuccin/tmux/commit/c31b9b2c6c7c50abbebd02b80c4fd32b2782a011))
## [0.2.0](https://github.com/catppuccin/tmux/compare/v0.1.0...v0.2.0) (2024-08-23)
### Features
* error/warning messages on first load ([#278](https://github.com/catppuccin/tmux/issues/278)) ([a2dda02](https://github.com/catppuccin/tmux/commit/a2dda02b43194aec5deddf2890c28c76b4c11ed4))
* warn users of whitespace in module lists ([#266](https://github.com/catppuccin/tmux/issues/266)) ([362a306](https://github.com/catppuccin/tmux/commit/362a306db71794f04d0995fc058bcaa094d1af70))
### Bug Fixes
* add missing batch options `catppuccin_pane{,_active}_border_style` ([3ffbc37](https://github.com/catppuccin/tmux/commit/3ffbc3700b4c1c3e2c4d015c5a51ccef555dabaf))
* add missing batch options catppuccin_pane{,_active}_border_style ([3ffbc37](https://github.com/catppuccin/tmux/commit/3ffbc3700b4c1c3e2c4d015c5a51ccef555dabaf))
* escaping in options ([#298](https://github.com/catppuccin/tmux/issues/298)) ([9b57c20](https://github.com/catppuccin/tmux/commit/9b57c2002081fff8af16b878f1369d46788c0409))
* **pomodoro_plus:** option names ([#273](https://github.com/catppuccin/tmux/issues/273)) ([51dde6e](https://github.com/catppuccin/tmux/commit/51dde6e8d4d3d8da97d915b01594a08aa4ac0cca))
* warning `[@catppuccin](https://github.com/catppuccin)_flavour` ([#296](https://github.com/catppuccin/tmux/issues/296)) ([a71f3c0](https://github.com/catppuccin/tmux/commit/a71f3c039bed8a7c49fc390a50befec5db2c4af9))
* warning `[@catppuccin](https://github.com/catppuccin)_window_status` ([9ee1695](https://github.com/catppuccin/tmux/commit/9ee1695d757c16e2f236858b8d3f88be9fb666fa))
### Performance Improvements
* batch tmux show ([#288](https://github.com/catppuccin/tmux/issues/288)) ([99013fa](https://github.com/catppuccin/tmux/commit/99013fafe6a98416079b3b84751f2eb540e17c79)), closes [#281](https://github.com/catppuccin/tmux/issues/281)
* batch tmux show-options ([3c6f6f2](https://github.com/catppuccin/tmux/commit/3c6f6f282b3bb17554dc2b4b80760b6507acfd65))
## [0.1.0](https://github.com/catppuccin/tmux/compare/v0.0.1...v0.1.0) (2024-08-04)
### Features
* releases ([#260](https://github.com/catppuccin/tmux/issues/260)) ([5fbacdf](https://github.com/catppuccin/tmux/commit/5fbacdf3559cf4496eef02aead087b3bb715e570))

View File

@@ -0,0 +1,40 @@
# Contributing
## Design
To understand our mindset in developing this plugin and how to ensure your
changes align with that mindset, check out the "[Design Philosophy](./docs/explanation/design.md)."
## Commit messages
This repository uses [Conventional Commits](https://conventionalcommits.org).
Commit headers should be lowercase. Most commits should include a body that briefly
describes the motivation and content of the commit.
### Commit types
- `fix`: A bug fix that doesn't modify the public API
- `feat`: A code change that adds functionality
- `change`: A modification to the public API
- `deprecate`: Something in the public API has been deprecated
- `remove`: A part of the public API has been removed
- `refactor`: A code change that doesn't change behavior
- `style`: A style fix or change
- `docs`: Any change to documentation
- `revert`: A revert commit. The message should describe the reasoning and the
commit should include the `Refs:` footer with the short hashes of the commits
being reverted.
- `chore`: catch-all type
### Breaking changes
All breaking changes should be documented in the commit footer in the format
described by Conventional Commits. Use the `<type>!` syntax in order to distinguish
breaking commits in the log, but include the footer to provide a better description
for the changelog generator.
```text
feat(bar)!: foo the bars
BREAKING CHANGE: bars are now foo'ed
```

View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Catppuccin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,199 @@
<!-- markdownlint-disable -->
<h3 align="center">
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/logos/exports/1544x1544_circle.png" width="100" alt="Logo"/><br/>
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/misc/transparent.png" height="30" width="0px"/>
Catppuccin for <a href="https://github.com/tmux/tmux">Tmux</a>
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/misc/transparent.png" height="30" width="0px"/>
</h3>
<p align="center">
<a href="https://github.com/catppuccin/tmux/stargazers"><img src="https://img.shields.io/github/stars/catppuccin/tmux?colorA=363a4f&colorB=b7bdf8&style=for-the-badge"></a>
<a href="https://github.com/catppuccin/tmux/issues"><img src="https://img.shields.io/github/issues/catppuccin/tmux?colorA=363a4f&colorB=f5a97f&style=for-the-badge"></a>
<a href="https://github.com/catppuccin/tmux/contributors"><img src="https://img.shields.io/github/contributors/catppuccin/tmux?colorA=363a4f&colorB=a6da95&style=for-the-badge"></a>
</p>
<p align="center">
<img src="./assets/preview.webp"/>
</p>
<!-- markdownlint-enable -->
## Themes
<details>
<summary>🌻 Latte</summary>
![Latte Flavor Preview](./assets/latte.webp)
</details>
<details>
<summary>🪴 Frappé</summary>
![Frappe Flavor Preview](./assets/frappe.webp)
</details>
<details>
<summary>🌺 Macchiato</summary>
![Macchiato Flavor Preview](./assets/macchiato.webp)
</details>
<details>
<summary>🌿 Mocha</summary>
![Mocha Flavor Preview](./assets/mocha.webp)
</details>
## Installation
In order to have the icons displayed correctly please use/update your favorite
[nerd font](https://www.nerdfonts.com/font-downloads).
If you do not have a patched font installed, you can override or remove any
icon. Check the [documentation](./docs/reference/configuration.md) on the
options available.
### Manual (Recommended)
This method is recommended as TPM has some issues with name conflicts.
<!-- x-release-please-start-version -->
1. Clone this repository to your desired location (e.g.
`~/.config/tmux/plugins/catppuccin`).
```bash
mkdir -p ~/.config/tmux/plugins/catppuccin
git clone -b v2.1.3 https://github.com/catppuccin/tmux.git ~/.config/tmux/plugins/catppuccin/tmux
```
1. Add the following line to your `tmux.conf` file:
`run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux`.
1. Reload Tmux by either restarting or reloading with `tmux source ~/.tmux.conf`.
<!-- x-release-please-end -->
Check out what to do next in the "[Getting Started Guide](./docs/tutorials/01-getting-started.md)".
### TPM
<!-- x-release-please-start-version -->
1. Install [TPM](https://github.com/tmux-plugins/tpm)
1. Add the Catppuccin plugin:
```bash
set -g @plugin 'catppuccin/tmux#v2.1.3' # See https://github.com/catppuccin/tmux/tags for additional tags
# ...alongside
set -g @plugin 'tmux-plugins/tpm'
```
1. (Optional) Set your preferred flavor, it defaults to `"mocha"`:
```bash
set -g @catppuccin_flavor 'mocha' # latte, frappe, macchiato or mocha
```
<!-- x-release-please-end -->
> [!IMPORTANT]
> You may have to run `~/.config/tmux/plugins/tpm/bin/clean_plugins`
> if upgrading from an earlier version
> (especially from `v0.3.0`).
### For TMUX versions prior to 3.2
This plugin uses features that were only introduced into tmux in version 3.2.
If you are using a version earlier than this, you can still have lovely
catppuccin colors, the installation method just looks a little different.
```sh
# In your ~/.tmux.conf
# Add the colors from the pallete. Check the themes/ directory for all options.
# Some basic mocha colors.
set -g @ctp_bg "#24273a"
set -g @ctp_surface_1 "#494d64"
set -g @ctp_fg "#cad3f5"
set -g @ctp_mauve "#c6a0f6"
set -g @ctp_crust "#181926"
# status line
set -gF status-style "bg=#{@ctp_bg},fg=#{@ctp_fg}"
# windows
set -gF window-status-format "#[bg=#{@ctp_surface_1},fg=#{@ctp_fg}] ##I ##T "
set -gF window-status-current-format "#[bg=#{@ctp_mauve},fg=#{@ctp_crust}] ##I ##T "
```
### Upgrading from v0.3
Breaking changes have been introduced since 0.3, to understand how to migrate
your configuration, see pinned issue [#487](https://github.com/catppuccin/tmux/issues/487).
## Recommended Default Configuration
This configuration shows some customisation options, that can be further
extended as desired.
This is what is used for the previews above.
![Example configuration](./assets/mocha.webp)
```bash
# ~/.tmux.conf
# Options to make tmux more pleasant
set -g mouse on
set -g default-terminal "tmux-256color"
# Configure the catppuccin plugin
set -g @catppuccin_flavor "mocha"
set -g @catppuccin_window_status_style "rounded"
# Load catppuccin
run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux
# For TPM, instead use `run ~/.tmux/plugins/tmux/catppuccin.tmux`
# Make the status line pretty and add some modules
set -g status-right-length 100
set -g status-left-length 100
set -g status-left ""
set -g status-right "#{E:@catppuccin_status_application}"
set -agF status-right "#{E:@catppuccin_status_cpu}"
set -ag status-right "#{E:@catppuccin_status_session}"
set -ag status-right "#{E:@catppuccin_status_uptime}"
set -agF status-right "#{E:@catppuccin_status_battery}"
run ~/.config/tmux/plugins/tmux-plugins/tmux-cpu/cpu.tmux
run ~/.config/tmux/plugins/tmux-plugins/tmux-battery/battery.tmux
# Or, if using TPM, just run TPM
```
## Documentation
### Guides
- [Getting Started](./docs/tutorials/01-getting-started.md)
- [Custom Status Line Segments](./docs/tutorials/02-custom-status.md)
- [Troubleshooting](./docs/guides/troubleshooting.md)
### Reference
- [Status Line](./docs/reference/status-line.md)
- [Configuration Options Reference](./docs/reference/configuration.md)
- [Tmux Configuration Showcase](https://github.com/catppuccin/tmux/discussions/317)
## 💝 Thanks to
- [Pocco81](https://github.com/Pocco81)
- [vinnyA3](https://github.com/vinnyA3)
- [rogeruiz](https://github.com/rogeruiz)
- [kales](https://github.com/kjnsn)
&nbsp;
<!-- markdownlint-disable -->
<p align="center">
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/footers/gray0_ctp_on_line.svg?sanitize=true" /></p>
<p align="center">Copyright &copy; 2021-present <a href="https://github.com/catppuccin" target="_blank">Catppuccin Org</a>
<p align="center"><a href="https://github.com/catppuccin/catppuccin/blob/main/LICENSE"><img src="https://img.shields.io/static/v1.svg?style=for-the-badge&label=License&message=MIT&logoColor=d9e0ee&colorA=363a4f&colorB=b7bdf8"/></a></p>
<!-- markdownlint-enable -->

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@@ -0,0 +1,13 @@
set -g @catppuccin_flavor 'frappe'
run "#{d:current_file}/../../catppuccin.tmux"
# Make the status line more pleasant.
set -g status-left ""
set -g status-right '#[fg=#{@thm_crust},bg=#{@thm_teal}] session: #S '
# Ensure that everything on the right side of the status line
# is included.
set -g status-right-length 100
set -g default-shell '/opt/homebrew/bin/fish'

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

View File

@@ -0,0 +1,19 @@
Output assets/demos/basic.gif
Require echo
Require tmux
Set Shell "bash"
Set FontSize 30
Set FontFamily "SFMono Nerd Font"
Set Width 1200
Set Height 600
Type "tmux -f assets/demos/basic.conf" Sleep 500ms Enter
Sleep 3s
Ctrl+b
Type "c"
Sleep 5s

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,11 @@
set -l flavors latte frappe macchiato mocha
for flavor in $flavors
magick $flavor.webp -crop '1320x50+0+464' +repage $flavor-crop.webp
end
catwalk {latte,frappe,macchiato,mocha}-crop.webp --output preview.webp --layout column
for flavor in $flavors
rm $flavor-crop.webp
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Set path of script
PLUGIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
tmux source "${PLUGIN_DIR}/catppuccin_options_tmux.conf"
tmux source "${PLUGIN_DIR}/catppuccin_tmux.conf"

View File

@@ -0,0 +1,70 @@
# All options and their defaults.
#
# This is executed separately to the main configuration
# so that options are set before parsing the rest of the config.
set -ogq @catppuccin_flavor "mocha"
set -ogq @catppuccin_status_background "default"
# Menu styling options
set -ogq @catppuccin_menu_selected_style "fg=#{@thm_fg},bold,bg=#{@thm_overlay_0}"
# Pane styling options
set -ogq @catppuccin_pane_status_enabled "no" # set to "yes" to enable
set -ogq @catppuccin_pane_border_status "off" # set to "yes" to enable
set -ogq @catppuccin_pane_border_style "fg=#{@thm_overlay_0}"
set -ogq @catppuccin_pane_active_border_style "##{?pane_in_mode,fg=#{@thm_lavender},##{?pane_synchronized,fg=#{@thm_mauve},fg=#{@thm_lavender}}}"
set -ogq @catppuccin_pane_left_separator "█"
set -ogq @catppuccin_pane_middle_separator "█"
set -ogq @catppuccin_pane_right_separator "█"
set -ogq @catppuccin_pane_color "#{@thm_green}"
set -ogq @catppuccin_pane_background_color "#{@thm_surface_0}"
set -ogq @catppuccin_pane_default_text "##{b:pane_current_path}"
set -ogq @catppuccin_pane_default_fill "number"
set -ogq @catppuccin_pane_number_position "left" # right, left
# NOTE: Changes to make the option names more intuitive and more closely follow
# the tmux naming conventions.
# @catppuccin_window_current_background -> @catppuccin_window_current_number_color
# @catppuccin_window_current_color -> @catppuccin_window_current_text_color
# @catppuccin_window_default_background -> @catppuccin_window_number_color
# @catppuccin_window_default_color -> @catppuccin_window_text_color
# @catppuccin_window_status -> @catppuccin_window_flags
#
# Removed:
# @catppuccin_window_default_fill, @catppuccin_window_current_fill
# Just set the number and text colors.
# Window options
set -ogq @catppuccin_window_status_style "basic" # basic, rounded, slanted, custom, or none
set -ogq @catppuccin_window_text_color "#{@thm_surface_0}"
set -ogq @catppuccin_window_number_color "#{@thm_overlay_2}"
set -ogq @catppuccin_window_text " #T"
set -ogq @catppuccin_window_number "#I"
set -ogq @catppuccin_window_current_text_color "#{@thm_surface_1}"
set -ogq @catppuccin_window_current_number_color "#{@thm_mauve}"
set -ogq @catppuccin_window_current_text " #T"
set -ogq @catppuccin_window_current_number "#I"
set -ogq @catppuccin_window_number_position "left"
# Window flags
set -ogq @catppuccin_window_flags "none"
set -ogq @catppuccin_window_flags_icon_last " 󰖰" # -
set -ogq @catppuccin_window_flags_icon_current " 󰖯" # *
set -ogq @catppuccin_window_flags_icon_zoom " 󰁌" # Z
set -ogq @catppuccin_window_flags_icon_mark " 󰃀" # M
set -ogq @catppuccin_window_flags_icon_silent " 󰂛" # ~
set -ogq @catppuccin_window_flags_icon_activity " 󱅫" # #
set -ogq @catppuccin_window_flags_icon_bell " 󰂞" # !
# Matches icon order when using `#F` (`#!~[*-]MZ`)
set -ogq @catppuccin_window_flags_icon_format "##{?window_activity_flag,#{E:@catppuccin_window_flags_icon_activity},}##{?window_bell_flag,#{E:@catppuccin_window_flags_icon_bell},}##{?window_silence_flag,#{E:@catppuccin_window_flags_icon_silent},}##{?window_active,#{E:@catppuccin_window_flags_icon_current},}##{?window_last_flag,#{E:@catppuccin_window_flags_icon_last},}##{?window_marked_flag,#{E:@catppuccin_window_flags_icon_mark},}##{?window_zoomed_flag,#{E:@catppuccin_window_flags_icon_zoom},} "
# Status line options
set -ogq @catppuccin_status_left_separator ""
set -ogq @catppuccin_status_middle_separator ""
set -ogq @catppuccin_status_right_separator " "
set -ogq @catppuccin_status_connect_separator "yes" # yes, no
# Maintain backwards compatibility. Use @catppuccin_status_module_bg_color if it is set.
set -ogq @catppuccin_status_module_text_bg "#{?@catppuccin_status_module_bg_color,#{E:@catppuccin_status_module_bg_color},#{@thm_surface_0}}"

View File

@@ -0,0 +1,223 @@
source -F "#{d:current_file}/themes/catppuccin_#{@catppuccin_flavor}_tmux.conf"
%if "#{==:#{@catppuccin_status_background},default}"
set -gF @_ctp_status_bg "#{@thm_mantle}"
set -gF status-style "bg=#{@_ctp_status_bg},fg=#{@thm_fg}"
%hidden CTP_MESSAGE_BACKGROUND="#{@thm_overlay_0}"
%elif "#{==:#{@catppuccin_status_background},none}"
set -g status-style "default"
set -g @_ctp_status_bg "none"
%hidden CTP_MESSAGE_BACKGROUND="default"
%else
# Treat @catppuccin_status_background as a format string.
set -gF status-style "bg=#{E:@catppuccin_status_background},fg=#{@thm_fg}"
set -gF @_ctp_status_bg "#{E:@catppuccin_status_background}"
%hidden CTP_MESSAGE_BACKGROUND="#{E:@catppuccin_status_background}"
%endif
source -F "#{d:current_file}/status/application.conf"
source -F "#{d:current_file}/status/battery.conf"
source -F "#{d:current_file}/status/clima.conf"
source -F "#{d:current_file}/status/cpu.conf"
source -F "#{d:current_file}/status/date_time.conf"
source -F "#{d:current_file}/status/directory.conf"
source -F "#{d:current_file}/status/gitmux.conf"
source -F "#{d:current_file}/status/host.conf"
source -F "#{d:current_file}/status/kube.conf"
source -F "#{d:current_file}/status/load.conf"
source -F "#{d:current_file}/status/pomodoro_plus.conf"
source -F "#{d:current_file}/status/session.conf"
source -F "#{d:current_file}/status/uptime.conf"
source -F "#{d:current_file}/status/user.conf"
source -F "#{d:current_file}/status/weather.conf"
# messages
set -gF message-style "fg=#{@thm_teal},bg=$CTP_MESSAGE_BACKGROUND,align=centre"
set -gF message-command-style "fg=#{@thm_teal},bg=$CTP_MESSAGE_BACKGROUND,align=centre"
# menu
%if "#{>=:#{version},3.4}"
set -gF menu-selected-style "#{E:@catppuccin_menu_selected_style}"
%endif
# panes
set -wgF pane-active-border-style "#{E:@catppuccin_pane_active_border_style}"
set -wgF pane-border-style "#{E:@catppuccin_pane_border_style}"
%if "#{==:#{@catppuccin_pane_status_enabled},yes}"
# "internal" variables are kept as @_ctp_p_.*
# and then unset at the end.
set -gq @_ctp_p_left "" # the content on the left, usually a separator
set -gq @_ctp_p_middle ""
set -gq @_ctp_p_right ""
set -gq @_ctp_p_number ""
set -gq @_ctp_p_text ""
%if "#{==:#{@catppuccin_pane_default_fill},none}"
set -g @_ctp_p_left \
"#[fg=#{@thm_surface_0},bg=default]#{@catppuccin_pane_left_separator}"
set -g @_ctp_p_middle \
"#[fg=#{@thm_fg},bg=#{@thm_surface_0}]#{@catppuccin_pane_middle_separator}"
set -g @_ctp_p_right \
"#[fg=#{@thm_surface_0},bg=default]#{@catppuccin_pane_right_separator}"
set -g @_ctp_p_number \
"#[fg=#{@thm_fg},bg=#{@thm_surface_0}]##{pane_index}"
set -g @_ctp_p_text \
"#[fg=#{@thm_fg},bg=#{@thm_surface_0}]#{E:@catppuccin_pane_default_text}"
%elif "#{==:#{@catppuccin_pane_default_fill},all}"
set -g @_ctp_p_left \
"#[fg=#{E:@catppuccin_pane_color},bg=default]#{@catppuccin_pane_left_separator}"
set -g @_ctp_p_middle \
"#[fg=#{E:@catppuccin_pane_color},bg=#{E:@catppuccin_pane_background_color}]#{@catppuccin_pane_middle_separator}"
set -g @_ctp_p_right \
"#[fg=#{E:@catppuccin_pane_color},bg=default]#{@catppuccin_pane_right_separator}"
set -g @_ctp_p_number \
"#[fg=#{E:@catppuccin_pane_background_color},bg=#{E:@catppuccin_pane_color}]##{pane_index}"
set -g @_ctp_p_text \
"#[fg=#{E:@catppuccin_pane_background_color},bg=#{E:@catppuccin_pane_color}]#{E:@catppuccin_pane_default_text}"
%elif "#{==:#{@catppuccin_pane_default_fill},number}"
%if "#{==:#{@catppuccin_pane_number_position},left}"
set -g @_ctp_p_left \
"#[fg=#{E:@catppuccin_pane_color},bg=default]#{@catppuccin_pane_left_separator}"
set -g @_ctp_p_right \
"#[fg=#{E:@catppuccin_pane_background_color},bg=default]#{@catppuccin_pane_right_separator}"
%else
set -g @_ctp_p_left \
"#[fg=#{E:@catppuccin_pane_background_color},bg=default]#{@catppuccin_pane_left_separator}"
set -g @_ctp_p_right \
"#[fg=#{E:@catppuccin_pane_color},bg=default]#{@catppuccin_pane_right_separator}"
%endif
set -g @_ctp_p_middle \
"#[fg=#{E:@catppuccin_pane_color},bg=#{E:@catppuccin_pane_background_color}]#{@catppuccin_pane_middle_separator}"
set -g @_ctp_p_number \
"#[fg=#{E:@catppuccin_pane_background_color},bg=#{E:@catppuccin_pane_color}]##{pane_index}"
set -g @_ctp_p_text \
"#[fg=#{E:@catppuccin_pane_color},bg=#{E:@catppuccin_pane_background_color}]#{E:@catppuccin_pane_default_text}"
%endif
%if "#{==:#{@catppuccin_pane_number_position},left}"
set -wgF pane-border-format \
"#{E:@_ctp_p_left}#{E:@_ctp_p_number}#{E:@_ctp_p_middle} #{E:@_ctp_p_text}#{E:@_ctp_p_right}"
%else
set -wgF pane-border-format \
"#{E:@_ctp_p_left}#{E:@_ctp_p_text} #{E:@_ctp_p_middle}#{E:@_ctp_p_number}#{E:@_ctp_p_right}"
%endif
set -ug @_ctp_p_left
set -ug @_ctp_p_middle
set -ug @_ctp_p_right
set -ug @_ctp_p_number
set -ug @_ctp_p_text
%endif
# popups
%if "#{>=:#{version},3.4}"
set -gF popup-style "bg=#{@thm_bg},fg=#{@thm_fg}"
set -gF popup-border-style "fg=#{@thm_surface_1}"
%endif
%if "#{==:#{@catppuccin_window_status_style},basic}"
set -gq @catppuccin_window_left_separator " "
set -gq @catppuccin_window_middle_separator " "
set -gq @catppuccin_window_right_separator " "
%elif "#{==:#{@catppuccin_window_status_style},rounded}"
set -gq @catppuccin_window_left_separator "#[fg=#{@_ctp_status_bg},reverse]#[none]"
set -gq @catppuccin_window_middle_separator " "
set -gq @catppuccin_window_right_separator "#[fg=#{@_ctp_status_bg},reverse]#[none]"
%elif "#{==:#{@catppuccin_window_status_style},slanted}"
set -gq @catppuccin_window_left_separator "#[fg=#{@_ctp_status_bg},reverse]#[none]"
%if "#{==:#{@catppuccin_window_number_position},left}"
set -gq @catppuccin_window_middle_separator "#[fg=#{@catppuccin_window_number_color},bg=#{@catppuccin_window_text_color}]"
set -gq @catppuccin_window_current_middle_separator \
"#[fg=#{@catppuccin_window_current_number_color},bg=#{@catppuccin_window_current_text_color}]"
%else
set -gq @catppuccin_window_middle_separator " #[fg=#{@catppuccin_window_number_color},bg=#{@catppuccin_window_text_color}]"
set -gq @catppuccin_window_current_middle_separator \
" #[fg=#{@catppuccin_window_current_number_color},bg=#{@catppuccin_window_current_text_color}]"
%endif
set -gq @catppuccin_window_right_separator "#[fg=#{@_ctp_status_bg},reverse]█#[none]"
%endif
set -ogqF @catppuccin_window_current_left_separator "#{@catppuccin_window_left_separator}"
set -ogqF @catppuccin_window_current_middle_separator "#{@catppuccin_window_middle_separator}"
set -ogqF @catppuccin_window_current_right_separator "#{@catppuccin_window_right_separator}"
# window status
%if "#{!=:#{@catppuccin_window_status_style},none}"
set -gF window-status-activity-style "bg=#{@thm_lavender},fg=#{@thm_crust}"
set -gF window-status-bell-style "bg=#{@thm_yellow},fg=#{@thm_crust}"
%if "#{==:#{@catppuccin_window_flags},icon}"
set -gqF @_ctp_w_flags "#{E:@catppuccin_window_flags_icon_format}"
%elif "#{==:#{@catppuccin_window_flags},text}"
set -gq @_ctp_w_flags "#F"
%else
set -gq @_ctp_w_flags ""
%endif
set -g @_ctp_w_number_style "#[fg=#{@thm_crust},bg=#{@catppuccin_window_number_color}]"
set -g @_ctp_w_text_style "#[fg=#{@thm_fg},bg=#{@catppuccin_window_text_color}]"
%if "#{==:#{@catppuccin_window_number_position},left}"
set -gF window-status-format \
"#{E:@_ctp_w_number_style}#{E:@catppuccin_window_left_separator}#{@catppuccin_window_number}"
set -agF window-status-format "#{E:@catppuccin_window_middle_separator}"
set -agF window-status-format \
"#{E:@_ctp_w_text_style}#{@catppuccin_window_text}#{@_ctp_w_flags}#{E:@catppuccin_window_right_separator}"
%else
set -gF window-status-format \
"#{E:@_ctp_w_text_style}#{E:@catppuccin_window_left_separator}#{E:@_ctp_w_text_style}#{@catppuccin_window_text}#{@_ctp_w_flags}"
set -agF window-status-format "#{E:@catppuccin_window_middle_separator}"
set -agF window-status-format \
"#{E:@_ctp_w_number_style} #{@catppuccin_window_number}#{E:@catppuccin_window_right_separator}"
%endif
# =======================================
# And do the same for the current window.
# =======================================
set -g @_ctp_w_number_style "#[fg=#{@thm_crust},bg=#{@catppuccin_window_current_number_color}]"
set -g @_ctp_w_text_style "#[fg=#{@thm_fg},bg=#{@catppuccin_window_current_text_color}]"
%if "#{==:#{@catppuccin_window_number_position},left}"
set -gF window-status-current-format \
"#{E:@_ctp_w_number_style}#{E:@catppuccin_window_current_left_separator}#{@catppuccin_window_current_number}"
set -agF window-status-current-format "#{E:@catppuccin_window_current_middle_separator}"
set -agF window-status-current-format \
"#{E:@_ctp_w_text_style}#{@catppuccin_window_current_text}#{@_ctp_w_flags}#{E:@catppuccin_window_current_right_separator}"
%else
set -gF window-status-current-format \
"#{E:@_ctp_w_text_style}#{E:@catppuccin_window_current_left_separator}#{E:@_ctp_w_text_style}#{@catppuccin_window_current_text}#{@_ctp_w_flags}"
set -agF window-status-current-format "#{E:@catppuccin_window_current_middle_separator}"
set -agF window-status-current-format \
"#{E:@_ctp_w_number_style} #{@catppuccin_window_current_number}#{E:@catppuccin_window_current_right_separator}"
%endif
# Cleanup (unset) all of the internal variables.
set -ug @_ctp_w_number_style
set -ug @_ctp_w_text_style
set -ug @_ctp_w_flags
%endif
# Mode style. This is used for copy mode highlighting to style the current selection.
set -gF mode-style "bg=#{@thm_surface_0},bold"
set -gF clock-mode-colour "#{@thm_blue}"

View File

@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>catppuccin/renovate-config"
]
}

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -Eeuo pipefail
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/default_options.sh --expected "${script_dir}"/tests/default_options_expected.txt "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/window_status_styling.sh --expected "${script_dir}"/tests/window_status_styling_expected.txt "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/application_module.sh --expected "${script_dir}"/tests/application_module_expected.txt "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/battery_module.sh --expected "${script_dir}"/tests/battery_module_expected.txt "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/cpu_module.sh --expected "${script_dir}"/tests/cpu_module_expected.txt "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/load_module.sh --expected "${script_dir}"/tests/load_module_expected.txt "$@"
"${script_dir}"/tests/harness.sh --test "${script_dir}"/tests/pane_styling.sh --expected "${script_dir}"/tests/pane_styling_expected.txt "$@"

View File

@@ -0,0 +1,8 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="application"
set -ogq "@catppuccin_${MODULE_NAME}_icon" " "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_maroon}"
set -ogq "@catppuccin_${MODULE_NAME}_text" " #{pane_current_command}"
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,22 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="battery"
set -ogq @batt_icon_charge_tier8 "󰁹"
set -ogq @batt_icon_charge_tier7 "󰂁"
set -ogq @batt_icon_charge_tier6 "󰁿"
set -ogq @batt_icon_charge_tier5 "󰁾"
set -ogq @batt_icon_charge_tier4 "󰁽"
set -ogq @batt_icon_charge_tier3 "󰁼"
set -ogq @batt_icon_charge_tier2 "󰁻"
set -ogq @batt_icon_charge_tier1 "󰁺"
set -ogq @batt_icon_status_charged "󰚥"
set -ogq @batt_icon_status_charging "󰂄"
set -ogq @batt_icon_status_discharging "󰂃"
set -ogq @batt_icon_status_unknown "󰂑"
set -ogq @batt_icon_status_attached "󱈑"
set -ogq "@catppuccin_${MODULE_NAME}_icon" "#{l:#{battery_icon}} "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_lavender}"
set -ogq "@catppuccin_${MODULE_NAME}_text" " #{l:#{battery_percentage}}"
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,9 @@
# vim:set ft=tmux:
# Requires https://github.com/vascomfnunes/tmux-clima
%hidden MODULE_NAME="clima"
set -ogq "@catppuccin_${MODULE_NAME}_icon" " "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_yellow}"
set -ogq "@catppuccin_${MODULE_NAME}_text" " #{l:#{clima}}"
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,18 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="cpu"
set -ogq @cpu_low_fg_color "#{E:@thm_fg}"
set -ogq @cpu_medium_fg_color "#{E:@thm_fg}"
set -ogq @cpu_high_fg_color "#{E:@thm_crust}"
set -ogq @cpu_low_bg_color "#{E:@catppuccin_status_module_text_bg}"
set -ogq @cpu_medium_bg_color "#{E:@catppuccin_status_module_text_bg}"
set -ogq @cpu_high_bg_color "#{E:@thm_red}"
set -ogq "@catppuccin_${MODULE_NAME}_icon" " "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_yellow}"
set -ogq "@catppuccin_status_${MODULE_NAME}_text_fg" "#{l:#{cpu_fg_color}}"
set -ogq "@catppuccin_status_${MODULE_NAME}_text_bg" "#{l:#{cpu_bg_color}}"
set -ogq "@catppuccin_${MODULE_NAME}_text" " #{l:#{cpu_percentage}}"
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,8 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="date_time"
set -ogq "@catppuccin_${MODULE_NAME}_icon" "󰃰 "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_sapphire}"
set -ogq "@catppuccin_${MODULE_NAME}_text" " %Y-%m-%d %H:%M"
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,8 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="directory"
set -ogq "@catppuccin_${MODULE_NAME}_icon" " "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_rosewater}"
set -ogq "@catppuccin_${MODULE_NAME}_text" " #{b:pane_current_path}"
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,9 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="gitmux"
# Requires https://github.com/arl/gitmux
set -ogq "@catppuccin_${MODULE_NAME}_icon" "󰊢 "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_teal}"
set -gq "@catppuccin_${MODULE_NAME}_text" ' #(gitmux -cfg $HOME/.gitmux.conf "#{pane_current_path}")'
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,8 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="host"
set -ogq "@catppuccin_${MODULE_NAME}_icon" "󰒋 "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_mauve}"
set -ogq "@catppuccin_${MODULE_NAME}_text" " #H"
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,13 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="kube"
# Requires https://github.com/jonmosco/kube-tmux
set -ogq "@catppuccin_${MODULE_NAME}_icon" "󱃾 "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_blue}"
set -ogqF "@catppuccin_kube_context_color" "#{E:@thm_red}"
set -ogqF "@catppuccin_kube_namespace_color" "#{E:@thm_sky}"
set -ogq "@catppuccin_${MODULE_NAME}_text" \
" #(\${TMUX_PLUGIN_MANAGER_PATH}kube-tmux/kube.tmux 250 #{@catppuccin_kube_context_color} #{@catppuccin_kube_namespace_color})"
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,8 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="load"
set -ogq "@catppuccin_${MODULE_NAME}_icon" "󰊚 "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_blue}"
set -ogq "@catppuccin_${MODULE_NAME}_text" "#{l:#(uptime | awk '{split(substr($0, index($0, \"load\")), a, \":\"); print a[2]\}}')"
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,9 @@
# vim:set ft=tmux:
# Requires https://github.com/olimorris/tmux-pomodoro-plus
%hidden MODULE_NAME="pomodoro_plus"
set -ogq "@catppuccin_${MODULE_NAME}_icon" " "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_peach}"
set -ogq "@catppuccin_${MODULE_NAME}_text" " #{l:#{pomodoro_status}}"
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,8 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="session"
set -ogq "@catppuccin_${MODULE_NAME}_icon" " "
set -ogq "@catppuccin_${MODULE_NAME}_color" "#{?client_prefix,#{E:@thm_red},#{E:@thm_green}}"
set -ogq "@catppuccin_${MODULE_NAME}_text" " #S"
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,8 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="uptime"
set -ogq @catppuccin_uptime_icon "󰔟 "
set -ogqF @catppuccin_uptime_color "#{E:@thm_sapphire}"
set -ogq @catppuccin_uptime_text " #(uptime | sed 's/^[^,]*up *//; s/, *[[:digit:]]* user.*//; s/ day.*, */d /; s/ hr\\(s*\\).*/h/; s/ min\\(s*\\).*/m/; s/ sec\\(s*\\).*/s/; s/\\([0-9]\\{1,2\\}\\):\\([0-9]\\{1,2\\}\\)/\\1h \\2m/;')"
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,8 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="user"
set -ogq @catppuccin_user_icon " "
set -ogqF @catppuccin_user_color "#{E:@thm_sky}"
set -ogq @catppuccin_user_text " #(whoami)"
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,10 @@
# vim:set ft=tmux:
%hidden MODULE_NAME="weather"
# Requires https://github.com/xamut/tmux-weather.
set -ogq @catppuccin_weather_icon " "
set -ogqF @catppuccin_weather_color "#{E:@thm_yellow}"
set -ogq @catppuccin_weather_text " #{l:#{weather}}"
source -F "#{d:current_file}/../utils/status_module.conf"

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
# shellcheck disable=SC1091
source "${script_dir}/helpers.sh"
# Tests that the default options are set correctly
tmux source "${script_dir}/../catppuccin_options_tmux.conf"
tmux source "${script_dir}/../catppuccin_tmux.conf"
print_option @catppuccin_status_application | grep -q "@thm_" &&
echo "@catppuccin_status_application did not expand all colors"
print_option @catppuccin_status_application | sed -E 's/(bash|fish|zsh)/<application>/'

View File

@@ -0,0 +1 @@
@catppuccin_status_application #[fg=#eba0ac]#[fg=#11111b,bg=#eba0ac] #[fg=#cdd6f4,bg=#313244]#{E:@catppuccin_application_text}#[fg=#313244]

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
# shellcheck disable=SC1091
source "${script_dir}/helpers.sh"
# Tests that the default options are set correctly
tmux source "${script_dir}/../catppuccin_options_tmux.conf"
tmux source "${script_dir}/../catppuccin_tmux.conf"
print_option @catppuccin_status_battery

View File

@@ -0,0 +1 @@
@catppuccin_status_battery #[fg=#b4befe]#[fg=#11111b,bg=#b4befe]#{l:#{battery_icon}} #[fg=#cdd6f4,bg=#313244]#{E:@catppuccin_battery_text}#[fg=#313244]

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
# shellcheck disable=SC1091
source "${script_dir}/helpers.sh"
# Tests that the default options are set correctly
tmux source "${script_dir}/../catppuccin_options_tmux.conf"
tmux source "${script_dir}/../catppuccin_tmux.conf"
print_option E:@catppuccin_status_cpu

View File

@@ -0,0 +1 @@
E:@catppuccin_status_cpu #[fg=#f9e2af]#[fg=#11111b,bg=#f9e2af] #[fg=#{cpu_fg_color},bg=#{cpu_bg_color}] #{cpu_percentage}#[fg=#{cpu_bg_color}]

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
# shellcheck disable=SC1091
source "${script_dir}/helpers.sh"
# Tests that the default options are set correctly
tmux source "${script_dir}/../catppuccin_options_tmux.conf"
tmux source "${script_dir}/../catppuccin_tmux.conf"
print_option @catppuccin_flavor
print_option @catppuccin_menu_selected_style
print_option @catppuccin_pane_active_border_style

View File

@@ -0,0 +1,3 @@
@catppuccin_flavor mocha
@catppuccin_menu_selected_style fg=#{@thm_fg},bold,bg=#{@thm_overlay_0}
@catppuccin_pane_active_border_style ##{?pane_in_mode,fg=#{@thm_lavender},##{?pane_synchronized,fg=#{@thm_mauve},fg=#{@thm_lavender}}}

View File

@@ -0,0 +1,153 @@
#!/usr/bin/env bash
set -Euo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
usage() {
trap - EXIT
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
Checks that running the given script, specified with -t, matches the output
specified in the file with -e.
Available options:
-h, --help Print this help and exit
-t, --test The script to run to generate the test output
-e, --expected File that contains the expected output of the test
-v, --verbose Enable verbose messaging
--no-color Do not use color in the output
EOF
exit
}
DIFFCOLORS="never" NOFORMAT='' RED='' GREEN='' ORANGE='' BLUE='' PURPLE='' CYAN='' YELLOW=''
setup_colors() {
if [[ -t 2 ]] && [[ -z "${NO_COLOR-}" ]] && [[ "${TERM-}" != "dumb" ]]; then
DIFFCOLORS="always" NOFORMAT='\033[0m' RED='\033[0;31m' GREEN='\033[0;32m' ORANGE='\033[0;33m' BLUE='\033[0;34m' PURPLE='\033[0;35m' CYAN='\033[0;36m' YELLOW='\033[1;33m'
else
# shellcheck disable=SC2034
DIFFCOLORS="never" NOFORMAT='' RED='' GREEN='' ORANGE='' BLUE='' PURPLE='' CYAN='' YELLOW=''
fi
}
VERBOSE=false
msg() {
echo >&2 -e "${1-}"
}
msg_verbose() {
if [ "$VERBOSE" = true ]; then
msg "$@"
fi
}
SOCKET_NAME="${SOCKET_NAME:-test}"
SESSION_NAME="test-session"
tmux() {
command tmux -L "$SOCKET_NAME" -f /dev/null "$@"
}
start_tmux_server() {
msg_verbose "${CYAN}Starting tmux server on socket ${SOCKET_NAME}${NOFORMAT}"
tmux new -s "$SESSION_NAME" -d "$(which bash)"
}
kill_tmux_server() {
msg_verbose "${CYAN}Stopping tmux server${NOFORMAT}"
tmux kill-session "$SESSION_NAME" 2>/dev/null
tmux kill-server 2>/dev/null
}
cleanup() {
trap - SIGINT SIGTERM ERR EXIT
# If the session is still running then stop it.
tmux has-session -t "$SESSION_NAME" 2>/dev/null
if test $? -eq 0; then
kill_tmux_server
fi
}
die() {
local msg=$1
local code=${2-1} # default exit status 1
msg "$msg"
cleanup
exit "$code"
}
parse_params() {
# default values of variables set from params
test_script=''
expected_output=''
while :; do
case "${1-}" in
-h | --help) usage ;;
--no-color) NO_COLOR=1 ;;
-t | --test)
test_script="${2-}"
shift
;;
-e | --expected)
expected_output="${2-}"
shift
;;
-v | --verbose)
VERBOSE=true
shift
;;
-?*) die "Unknown option: $1" ;;
*) break ;;
esac
shift
done
# shellcheck disable=SC2034
args=("$@")
# check required params and arguments
[[ -z "${test_script-}" ]] && die "Missing required parameter: -t|--test"
[[ -z "${expected_output-}" ]] && die "Missing required parameter: -e|--expected"
return 0
}
parse_params "$@"
setup_colors
run_test() {
msg_verbose "Running test ${test_script} and checking the output against ${expected_output}"
start_tmux_server
local script_name
script_name=$(basename "${test_script}")
local output
# shellcheck disable=SC1090
output=$(source "${test_script}")
test_exit_code="$?"
if test $test_exit_code -ne 0; then
die "\n${RED}Test ${script_name} exited with code $test_exit_code ${NOFORMAT}"
fi
echo -e "${output}" | diff -abB --color=${DIFFCOLORS} "${expected_output}" -
if test $? -eq 0; then
msg "${GREEN}Test ${script_name} passed${NOFORMAT}"
else
die "\n${RED}Test ${script_name} failed${NOFORMAT}"
fi
cleanup
}
run_test

View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# Returns the value of given tmux option.
# First argument is the option name, e.g. @catppuccin_flavor.
#
# Usage: `get_option @catppuccin_flavor`
# Would return: `mocha`
#
# The option is given as a format string.
get_option() {
local option
option=$1
tmux display-message -p "#{${option}}"
}
# Prints the given tmux option to stdout.
# First argument is the option name, e.g. @catppuccin_flavor.
#
# Usage: `print_option @catppuccin_flavor`
# Would print: `@catppuccin_flavor mocha`
#
# The option is given as a format string.
print_option() {
local option
option=$1
printf "\n%s " "${option}"
get_option "$option"
}

View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
# shellcheck disable=SC1091
source "${script_dir}/helpers.sh"
# Tests that the default options are set correctly
tmux source "${script_dir}/../catppuccin_options_tmux.conf"
tmux source "${script_dir}/../catppuccin_tmux.conf"
print_option E:@catppuccin_status_load

View File

@@ -0,0 +1,3 @@
E:@catppuccin_status_load #[fg=#89b4fa]#[fg=#11111b,bg=#89b4fa]󰊚 #[fg=#cdd6f4,bg=#313244]#(uptime | awk '{split(substr($0, index($0, "load")), a, ":"); print a[2]}')#[fg=#313244]

View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
# shellcheck disable=SC1091
source "${script_dir}/helpers.sh"
tmux set -g @catppuccin_pane_status_enabled "yes"
tmux source "${script_dir}/../catppuccin_options_tmux.conf"
tmux source "${script_dir}/../catppuccin_tmux.conf"
print_option pane-border-format
# Switch the number position to the right
tmux set -g @catppuccin_pane_number_position "right"
tmux source "${script_dir}/../catppuccin_tmux.conf"
print_option pane-border-format
tmux set -g @catppuccin_pane_number_position "left" # reset
# Fill option "all"
tmux set -g @catppuccin_pane_default_fill "all"
tmux source "${script_dir}/../catppuccin_tmux.conf"
print_option pane-border-format
tmux set -g @catppuccin_pane_default_fill "number" # reset
# Fill option "none"
tmux set -g @catppuccin_pane_default_fill "none"
tmux source "${script_dir}/../catppuccin_tmux.conf"
print_option pane-border-format

View File

@@ -0,0 +1,4 @@
pane-border-format #[fg=#a6e3a1,bg=default]█#[fg=#313244,bg=#a6e3a1]#{pane_index}#[fg=#a6e3a1,bg=#313244]█ #[fg=#a6e3a1,bg=#313244]#{b:pane_current_path}#[fg=#313244,bg=default]█
pane-border-format #[fg=#313244,bg=default]█#[fg=#a6e3a1,bg=#313244]#{b:pane_current_path} #[fg=#a6e3a1,bg=#313244]█#[fg=#313244,bg=#a6e3a1]#{pane_index}#[fg=#a6e3a1,bg=default]█
pane-border-format #[fg=#a6e3a1,bg=default]█#[fg=#313244,bg=#a6e3a1]#{pane_index}#[fg=#a6e3a1,bg=#313244]█ #[fg=#313244,bg=#a6e3a1]#{b:pane_current_path}#[fg=#a6e3a1,bg=default]█
pane-border-format #[fg=#313244,bg=default]█#[fg=#cdd6f4,bg=#313244]#{pane_index}#[fg=#cdd6f4,bg=#313244]█ #[fg=#cdd6f4,bg=#313244]#{b:pane_current_path}#[fg=#313244,bg=default]█

View File

@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# Unsets (removes) any styling options that will contaminate
# subsequent test runs.
function reset() {
tmux set -gu @catppuccin_window_current_left_separator
tmux set -gu @catppuccin_window_current_middle_separator
tmux set -gu @catppuccin_window_current_right_separator
tmux set -gu @catppuccin_window_status_style
}
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
# shellcheck disable=SC1091
source "${script_dir}/helpers.sh"
tmux source "${script_dir}/../catppuccin_options_tmux.conf"
tmux source "${script_dir}/../catppuccin_tmux.conf"
print_option window-status-format
print_option window-status-current-format
# Test the rounded style
reset
tmux set -g @catppuccin_window_status_style "rounded"
tmux source "${script_dir}/../catppuccin_options_tmux.conf"
tmux source "${script_dir}/../catppuccin_tmux.conf"
print_option window-status-format
print_option window-status-current-format
# Test the basic style with the number on the right
reset
tmux set -g @catppuccin_window_number_position "right"
tmux source "${script_dir}/../catppuccin_options_tmux.conf"
tmux source "${script_dir}/../catppuccin_tmux.conf"
print_option window-status-format
print_option window-status-current-format

View File

@@ -0,0 +1,6 @@
window-status-format #[fg=#11111b,bg=#{@thm_overlay_2}] #I #[fg=#cdd6f4,bg=#{@thm_surface_0}] #T
window-status-current-format #[fg=#11111b,bg=#{@thm_mauve}] #I #[fg=#cdd6f4,bg=#{@thm_surface_1}] #T
window-status-format #[fg=#11111b,bg=#{@thm_overlay_2}]#[fg=#181825,reverse]#[none]#I #[fg=#cdd6f4,bg=#{@thm_surface_0}] #T#[fg=#181825,reverse]#[none]
window-status-current-format #[fg=#11111b,bg=#{@thm_mauve}]#[fg=#181825,reverse]#[none]#I #[fg=#cdd6f4,bg=#{@thm_surface_1}] #T#[fg=#181825,reverse]#[none]
window-status-format #[fg=#cdd6f4,bg=#{@thm_surface_0}] #[fg=#cdd6f4,bg=#{@thm_surface_0}] #T #[fg=#11111b,bg=#{@thm_overlay_2}] #I
window-status-current-format #[fg=#cdd6f4,bg=#{@thm_surface_1}] #[fg=#cdd6f4,bg=#{@thm_surface_1}] #T #[fg=#11111b,bg=#{@thm_mauve}] #I

View File

@@ -0,0 +1,35 @@
# vim:set ft=tmux:
# --> Catppuccin (Frappe)
set -ogq @thm_bg "#303446"
set -ogq @thm_fg "#c6d0f5"
# Colors
set -ogq @thm_rosewater "#f2d5cf"
set -ogq @thm_flamingo "#eebebe"
set -ogq @thm_rosewater "#f2d5cf"
set -ogq @thm_pink "#f4b8e4"
set -ogq @thm_mauve "#ca9ee6"
set -ogq @thm_red "#e78284"
set -ogq @thm_maroon "#ea999c"
set -ogq @thm_peach "#ef9f76"
set -ogq @thm_yellow "#e5c890"
set -ogq @thm_green "#a6d189"
set -ogq @thm_teal "#81c8be"
set -ogq @thm_sky "#99d1db"
set -ogq @thm_sapphire "#85c1dc"
set -ogq @thm_blue "#8caaee"
set -ogq @thm_lavender "#babbf1"
# Surfaces and overlays
set -ogq @thm_subtext_1 "#a5adce"
set -ogq @thm_subtext_0 "#b5bfe2"
set -ogq @thm_overlay_2 "#949cbb"
set -ogq @thm_overlay_1 "#838ba7"
set -ogq @thm_overlay_0 "#737994"
set -ogq @thm_surface_2 "#626880"
set -ogq @thm_surface_1 "#51576d"
set -ogq @thm_surface_0 "#414559"
set -ogq @thm_mantle "#292c3c"
set -ogq @thm_crust "#232634"

View File

@@ -0,0 +1,35 @@
# vim:set ft=tmux:
# --> Catppuccin (Latte)
set -ogq @thm_bg "#eff1f5"
set -ogq @thm_fg "#4c4f69"
# Colors
set -ogq @thm_rosewater "#dc8a78"
set -ogq @thm_flamingo "#dd7878"
set -ogq @thm_rosewater "#dc8a78"
set -ogq @thm_pink "#ea76cb"
set -ogq @thm_mauve "#8839ef"
set -ogq @thm_red "#d20f39"
set -ogq @thm_maroon "#e64553"
set -ogq @thm_peach "#fe640b"
set -ogq @thm_yellow "#df8e1d"
set -ogq @thm_green "#40a02b"
set -ogq @thm_teal "#179299"
set -ogq @thm_sky "#04a5e5"
set -ogq @thm_sapphire "#209fb5"
set -ogq @thm_blue "#1e66f5"
set -ogq @thm_lavender "#7287fd"
# Surfaces and overlays
set -ogq @thm_subtext_1 "#6c6f85"
set -ogq @thm_subtext_0 "#5c5f77"
set -ogq @thm_overlay_2 "#7c7f93"
set -ogq @thm_overlay_1 "#8c8fa1"
set -ogq @thm_overlay_0 "#9ca0b0"
set -ogq @thm_surface_2 "#acb0be"
set -ogq @thm_surface_1 "#bcc0cc"
set -ogq @thm_surface_0 "#ccd0da"
set -ogq @thm_mantle "#e6e9ef"
set -ogq @thm_crust "#dce0e8"

View File

@@ -0,0 +1,35 @@
# vim:set ft=tmux:
# --> Catppuccin (Macchiato)
set -ogq @thm_bg "#24273a"
set -ogq @thm_fg "#cad3f5"
# Colors
set -ogq @thm_rosewater "#f4dbd6"
set -ogq @thm_flamingo "#f0c6c6"
set -ogq @thm_rosewater "#f4dbd6"
set -ogq @thm_pink "#f5bde6"
set -ogq @thm_mauve "#c6a0f6"
set -ogq @thm_red "#ed8796"
set -ogq @thm_maroon "#ee99a0"
set -ogq @thm_peach "#f5a97f"
set -ogq @thm_yellow "#eed49f"
set -ogq @thm_green "#a6da95"
set -ogq @thm_teal "#8bd5ca"
set -ogq @thm_sky "#91d7e3"
set -ogq @thm_sapphire "#7dc4e4"
set -ogq @thm_blue "#8aadf4"
set -ogq @thm_lavender "#b7bdf8"
# Surfaces and overlays
set -ogq @thm_subtext_1 "#a5adcb"
set -ogq @thm_subtext_0 "#b8c0e0"
set -ogq @thm_overlay_2 "#939ab7"
set -ogq @thm_overlay_1 "#8087a2"
set -ogq @thm_overlay_0 "#6e738d"
set -ogq @thm_surface_2 "#5b6078"
set -ogq @thm_surface_1 "#494d64"
set -ogq @thm_surface_0 "#363a4f"
set -ogq @thm_mantle "#1e2030"
set -ogq @thm_crust "#181926"

View File

@@ -0,0 +1,35 @@
# vim:set ft=tmux:
# --> Catppuccin (Mocha)
set -ogq @thm_bg "#1e1e2e"
set -ogq @thm_fg "#cdd6f4"
# Colors
set -ogq @thm_rosewater "#f5e0dc"
set -ogq @thm_flamingo "#f2cdcd"
set -ogq @thm_rosewater "#f5e0dc"
set -ogq @thm_pink "#f5c2e7"
set -ogq @thm_mauve "#cba6f7"
set -ogq @thm_red "#f38ba8"
set -ogq @thm_maroon "#eba0ac"
set -ogq @thm_peach "#fab387"
set -ogq @thm_yellow "#f9e2af"
set -ogq @thm_green "#a6e3a1"
set -ogq @thm_teal "#94e2d5"
set -ogq @thm_sky "#89dceb"
set -ogq @thm_sapphire "#74c7ec"
set -ogq @thm_blue "#89b4fa"
set -ogq @thm_lavender "#b4befe"
# Surfaces and overlays
set -ogq @thm_subtext_1 "#a6adc8"
set -ogq @thm_subtext_0 "#bac2de"
set -ogq @thm_overlay_2 "#9399b2"
set -ogq @thm_overlay_1 "#7f849c"
set -ogq @thm_overlay_0 "#6c7086"
set -ogq @thm_surface_2 "#585b70"
set -ogq @thm_surface_1 "#45475a"
set -ogq @thm_surface_0 "#313244"
set -ogq @thm_mantle "#181825"
set -ogq @thm_crust "#11111b"

View File

@@ -0,0 +1,43 @@
---
whiskers:
version: "2.1.1"
matrix:
- flavor
filename: "themes/catppuccin_{{flavor.identifier}}_tmux.conf"
---
{%- set palette = flavor.colors -%}
# vim:set ft=tmux:
# --> Catppuccin ({{ flavor.identifier | capitalize }})
set -ogq @thm_bg "#{{ palette.base.hex | lower }}"
set -ogq @thm_fg "#{{ palette.text.hex | lower }}"
# Colors
set -ogq @thm_rosewater "#{{ palette.rosewater.hex | lower }}"
set -ogq @thm_flamingo "#{{ palette.flamingo.hex | lower }}"
set -ogq @thm_rosewater "#{{ palette.rosewater.hex | lower }}"
set -ogq @thm_pink "#{{ palette.pink.hex | lower }}"
set -ogq @thm_mauve "#{{ palette.mauve.hex | lower }}"
set -ogq @thm_red "#{{ palette.red.hex | lower }}"
set -ogq @thm_maroon "#{{ palette.maroon.hex | lower }}"
set -ogq @thm_peach "#{{ palette.peach.hex | lower }}"
set -ogq @thm_yellow "#{{ palette.yellow.hex | lower }}"
set -ogq @thm_green "#{{ palette.green.hex | lower }}"
set -ogq @thm_teal "#{{ palette.teal.hex | lower }}"
set -ogq @thm_sky "#{{ palette.sky.hex | lower }}"
set -ogq @thm_sapphire "#{{ palette.sapphire.hex | lower }}"
set -ogq @thm_blue "#{{ palette.blue.hex | lower }}"
set -ogq @thm_lavender "#{{ palette.lavender.hex | lower }}"
# Surfaces and overlays
set -ogq @thm_subtext_1 "#{{ palette.subtext0.hex | lower }}"
set -ogq @thm_subtext_0 "#{{ palette.subtext1.hex | lower }}"
set -ogq @thm_overlay_2 "#{{ palette.overlay2.hex | lower }}"
set -ogq @thm_overlay_1 "#{{ palette.overlay1.hex | lower }}"
set -ogq @thm_overlay_0 "#{{ palette.overlay0.hex | lower }}"
set -ogq @thm_surface_2 "#{{ palette.surface2.hex | lower }}"
set -ogq @thm_surface_1 "#{{ palette.surface1.hex | lower }}"
set -ogq @thm_surface_0 "#{{ palette.surface0.hex | lower }}"
set -ogq @thm_mantle "#{{ palette.mantle.hex | lower }}"
set -ogq @thm_crust "#{{ palette.crust.hex | lower }}"

View File

@@ -0,0 +1,47 @@
# vim:set ft=tmux:
# Embedded style that ensures that modules look "connected"
# when required.
set -gqF @_ctp_connect_style \
"#{?#{==:#{@catppuccin_status_connect_separator},yes},,#[bg=default]}"
# There are four colors involved:
#
# - Icon
# - fg: @catppuccin_status_[module]_icon_fg [default = crust]
# - bg: @catppuccin_status_[module]_icon_bg [required]
# - Text
# - fg: @catppuccin_status_[module]_text_fg [default = foreground]
# - bg: @catppuccin_status_[module]_text_bg [default = @catppuccin_status_module_text_bg]
set -ogqF "@catppuccin_status_${MODULE_NAME}_icon_fg" "#{E:@thm_crust}"
set -ogqF "@catppuccin_status_${MODULE_NAME}_text_fg" "#{E:@thm_fg}"
%if "#{==:#{@catppuccin_status_${MODULE_NAME}_icon_bg},}"
set -gqF "@catppuccin_status_${MODULE_NAME}_icon_bg" "#{@catppuccin_${MODULE_NAME}_color}"
%endif
%if "#{==:#{@catppuccin_status_${MODULE_NAME}_text_bg},}"
set -gqF @_ctp_module_text_bg "#{E:@catppuccin_status_module_text_bg}"
%else
set -gqF @_ctp_module_text_bg "#{@catppuccin_status_${MODULE_NAME}_text_bg}"
%endif
set -gF "@catppuccin_status_${MODULE_NAME}" \
"#[fg=#{@catppuccin_status_${MODULE_NAME}_icon_bg}]#{@_ctp_connect_style}#{@catppuccin_status_left_separator}"
set -agF "@catppuccin_status_${MODULE_NAME}" \
"#[fg=#{@catppuccin_status_${MODULE_NAME}_icon_fg},bg=#{@catppuccin_status_${MODULE_NAME}_icon_bg}]#{@catppuccin_${MODULE_NAME}_icon}"
set -agF "@catppuccin_status_${MODULE_NAME}" \
"#{@catppuccin_status_middle_separator}"
set -agF "@catppuccin_status_${MODULE_NAME}" \
"#[fg=#{@catppuccin_status_${MODULE_NAME}_text_fg},bg=#{@_ctp_module_text_bg}]"
set -ag "@catppuccin_status_${MODULE_NAME}" "#{E:@catppuccin_${MODULE_NAME}_text}"
set -agF "@catppuccin_status_${MODULE_NAME}" "#[fg=#{@_ctp_module_text_bg}]#{@_ctp_connect_style}#{@catppuccin_status_right_separator}"
set -ug @_ctp_connect_style
set -ug @_ctp_module_text_bg

View File

@@ -0,0 +1,9 @@
# Force text files to have unix eols, so Windows/Cygwin does not break them
*.* eol=lf
# These files are unfortunately not recognized as text files so
# explicitly listing them here
tpm eol=lf
bin/* eol=lf
bindings/* eol=lf
tests/* eol=lf

4
.config/tmux/plugins/tpm/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
**/.vagrant/
run_tests
tests/run_tests_in_isolation
tests/helpers/helpers.sh

3
.config/tmux/plugins/tpm/.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "lib/tmux-test"]
path = lib/tmux-test
url = https://github.com/tmux-plugins/tmux-test.git

View File

@@ -0,0 +1,19 @@
# generic packages and tmux
before_install:
- sudo apt-get update
- sudo apt-get install -y git-core expect
- sudo apt-get install -y python-software-properties software-properties-common
- sudo apt-get install -y libevent-dev libncurses-dev
- git clone https://github.com/tmux/tmux.git
- cd tmux
- git checkout 2.0
- sh autogen.sh
- ./configure && make && sudo make install
install:
- git fetch --unshallow --recurse-submodules || git fetch --recurse-submodules
# manual `git clone` required for testing `tmux-test` plugin itself
- git clone https://github.com/tmux-plugins/tmux-test lib/tmux-test; true
- lib/tmux-test/setup
script: ./tests/run_tests_in_isolation

View File

@@ -0,0 +1,86 @@
# Changelog
### master
### v3.1.0, 2023-01-03
- upgrade to new version of `tmux-test`
- bug: when using `emacs` copy mode, Enter does not quit screen after tpm
installation/update. Fix by making `Escape` the key for emacs mode.
- add a doc with troubleshooting instructions
- add `.gitattributes` file that forces linefeed characters (classic `\n`) as
line endings - helps with misconfigured git on windows/cygwin
- readme update: announce Cygwin support
- un-deprecate old plugin definition syntax: `set -g @tpm_plugins`
- More stuff, check `git log`.
### v3.0.0, 2015-08-03
- refactor `shared_set_tpm_path_constant` function
- move all instructions to `docs/` dir
- add `bin/install_plugins` cli executable script
- improved test runner function
- switch to using [tmux-test](https://github.com/tmux-plugins/tmux-test)
framework
- add `bin/update_plugins` cli executable script
- refactor test `expect` scripts, make them simpler and ensure they properly
assert expectations
- refactor code that sets 'TMUX_PLUGIN_MANAGER_PATH' global env var
- stop using global variable for 'tpm path'
- support defining plugins via `set -g @plugin` in sourced files as well
### v2.0.0, 2015-07-07
- enable overriding default key bindings
- start using `C-c` to clear screen
- add uninstall/clean procedure and keybinding (prefix+alt+u) (@chilicuil)
- add new `set @plugin 'repo'` plugin definition syntax (@chilicuil)
- revert back to using `-g` flag in new plugin definition syntax
- permit leading whitespace with new plugin definition syntax (thanks @chilicuil)
- make sure `TMUX_PLUGIN_MANAGER_PATH` always has trailng slash
- ensure old/deprecated plugin syntax `set -g @tpm_plugins` works alongside new
`set -g @plugin` syntax
### v1.2.2, 2015-02-08
- set GIT_TERMINAL_PROMPT=0 when doing `git clone`, `pull` or `submodule update`
to ensure git does not prompt for username/password in any case
### v1.2.1, 2014-11-21
- change the way plugin name is expanded. It now uses the http username
and password by default, like this: `https://git::@github.com/`. This prevents
username and password prompt (and subsequently tmux install hanging) with old
git versions. Fixes #7.
### v1.2.0, 2014-11-20
- refactor tests so they can be used on travis
- add travis.yml, add travis badge to the readme
### v1.1.0, 2014-11-19
- if the plugin is not downloaded do not source it
- remove `PLUGINS.md`, an obsolete list of plugins
- update readme with instructions about uninstalling plugins
- tilde char and `$HOME` in `TMUX_SHARED_MANAGER_PATH` couldn't be used because
they are just plain strings. Fixing the problem by manually expanding them.
- bugfix: fragile `*.tmux` file globbing (@majutsushi)
### v1.0.0, 2014-08-05
- update readme because of github organization change to
[tmux-plugins](https://github.com/tmux-plugins)
- update tests to pass
- update README to suggest different first plugin
- update list of plugins in the README
- remove README 'about' section
- move key binding to the main file. Delete `key_binding.sh`.
- rename `display_message` -> `echo_message`
- installing plugins installs just new plugins. Already installed plugins aren't
updated.
- add 'update plugin' binding and functionality
- add test for updating a plugin
### v0.0.2, 2014-07-17
- run all *.tmux plugin files as executables
- fix all redirects to /dev/null
- fix bug: TPM shared path is created before sync (cloning plugins from github
is done)
- add test suite running in Vagrant
- add Tmux version check. `TPM` won't run if Tmux version is less than 1.9.
### v0.0.1, 2014-05-21
- get TPM up and running

View File

@@ -0,0 +1,2 @@
Instructions moved to
[docs/how_to_create_plugin.md](docs/how_to_create_plugin.md).

View File

@@ -0,0 +1,20 @@
MIT license
Copyright (C) 2014 Bruno Sutic
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,101 @@
# Tmux Plugin Manager
[![Build Status](https://travis-ci.org/tmux-plugins/tpm.svg?branch=master)](https://travis-ci.org/tmux-plugins/tpm)
Installs and loads `tmux` plugins.
Tested and working on Linux, OSX, and Cygwin.
See list of plugins [here](https://github.com/tmux-plugins/list).
### Installation
Requirements: `tmux` version 1.9 (or higher), `git`, `bash`.
Clone TPM:
```bash
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
```
Put this at the bottom of `~/.tmux.conf` (`$XDG_CONFIG_HOME/tmux/tmux.conf`
works too):
```bash
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin 'git@github.com:user/plugin'
# set -g @plugin 'git@bitbucket.com:user/plugin'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
```
Reload TMUX environment so TPM is sourced:
```bash
# type this in terminal if tmux is already running
tmux source ~/.tmux.conf
```
That's it!
### Installing plugins
1. Add new plugin to `~/.tmux.conf` with `set -g @plugin '...'`
2. Press `prefix` + <kbd>I</kbd> (capital i, as in **I**nstall) to fetch the plugin.
You're good to go! The plugin was cloned to `~/.tmux/plugins/` dir and sourced.
### Uninstalling plugins
1. Remove (or comment out) plugin from the list.
2. Press `prefix` + <kbd>alt</kbd> + <kbd>u</kbd> (lowercase u as in **u**ninstall) to remove the plugin.
All the plugins are installed to `~/.tmux/plugins/` so alternatively you can
find plugin directory there and remove it.
### Key bindings
`prefix` + <kbd>I</kbd>
- Installs new plugins from GitHub or any other git repository
- Refreshes TMUX environment
`prefix` + <kbd>U</kbd>
- updates plugin(s)
`prefix` + <kbd>alt</kbd> + <kbd>u</kbd>
- remove/uninstall plugins not on the plugin list
### Docs
- [Help, tpm not working](docs/tpm_not_working.md) - problem solutions
More advanced features and instructions, regular users probably do not need
this:
- [How to create a plugin](docs/how_to_create_plugin.md). It's easy.
- [Managing plugins via the command line](docs/managing_plugins_via_cmd_line.md)
- [Changing plugins install dir](docs/changing_plugins_install_dir.md)
- [Automatic TPM installation on a new machine](docs/automatic_tpm_installation.md)
### Tests
Tests for this project run on [Travis CI](https://travis-ci.org/tmux-plugins/tpm).
When run locally, [vagrant](https://www.vagrantup.com/) is required.
Run tests with:
```bash
# within project directory
./run_tests
```
### License
[MIT](LICENSE.md)

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Script intended for use via the command line.
#
# `.tmux.conf` needs to be set for TPM. Tmux has to be installed on the system,
# but does not need to be started in order to run this script.
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPTS_DIR="$CURRENT_DIR/../scripts"
main() {
"$SCRIPTS_DIR/clean_plugins.sh" # has correct exit code
}
main

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
# Script intended for use via the command line.
#
# `.tmux.conf` needs to be set for TPM. Tmux has to be installed on the system,
# but does not need to be started in order to run this script.
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPTS_DIR="$CURRENT_DIR/../scripts"
main() {
"$SCRIPTS_DIR/install_plugins.sh" # has correct exit code
}
main

View File

@@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Script intended for use via the command line.
#
# `.tmux.conf` needs to be set for TPM. Tmux has to be installed on the system,
# but does not need to be started in order to run this script.
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPTS_DIR="$CURRENT_DIR/../scripts"
PROGRAM_NAME="$0"
if [ $# -eq 0 ]; then
echo "usage:"
echo " $PROGRAM_NAME all update all plugins"
echo " $PROGRAM_NAME tmux-foo update plugin 'tmux-foo'"
echo " $PROGRAM_NAME tmux-bar tmux-baz update multiple plugins"
exit 1
fi
main() {
"$SCRIPTS_DIR/update_plugin.sh" --shell-echo "$*" # has correct exit code
}
main "$*"

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Tmux key-binding script.
# Scripts intended to be used via the command line are in `bin/` directory.
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPTS_DIR="$CURRENT_DIR/../scripts"
HELPERS_DIR="$SCRIPTS_DIR/helpers"
source "$HELPERS_DIR/tmux_echo_functions.sh"
source "$HELPERS_DIR/tmux_utils.sh"
main() {
reload_tmux_environment
"$SCRIPTS_DIR/clean_plugins.sh" --tmux-echo >/dev/null 2>&1
reload_tmux_environment
end_message
}
main

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Tmux key-binding script.
# Scripts intended to be used via the command line are in `bin/` directory.
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPTS_DIR="$CURRENT_DIR/../scripts"
HELPERS_DIR="$SCRIPTS_DIR/helpers"
source "$HELPERS_DIR/tmux_echo_functions.sh"
source "$HELPERS_DIR/tmux_utils.sh"
main() {
reload_tmux_environment
"$SCRIPTS_DIR/install_plugins.sh" --tmux-echo >/dev/null 2>&1
reload_tmux_environment
end_message
}
main

View File

@@ -0,0 +1,49 @@
#!/usr/bin/env bash
# Tmux key-binding script.
# Scripts intended to be used via the command line are in `bin/` directory.
# This script:
# - shows a list of installed plugins
# - starts a prompt to enter the name of the plugin that will be updated
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SCRIPTS_DIR="$CURRENT_DIR/../scripts"
HELPERS_DIR="$SCRIPTS_DIR/helpers"
source "$HELPERS_DIR/plugin_functions.sh"
source "$HELPERS_DIR/tmux_echo_functions.sh"
source "$HELPERS_DIR/tmux_utils.sh"
display_plugin_update_list() {
local plugins="$(tpm_plugins_list_helper)"
tmux_echo "Installed plugins:"
tmux_echo ""
for plugin in $plugins; do
# displaying only installed plugins
if plugin_already_installed "$plugin"; then
local plugin_name="$(plugin_name_helper "$plugin")"
tmux_echo " $plugin_name"
fi
done
tmux_echo ""
tmux_echo "Type plugin name to update it."
tmux_echo ""
tmux_echo "- \"all\" - updates all plugins"
tmux_echo "- ENTER - cancels"
}
update_plugin_prompt() {
tmux command-prompt -p 'plugin update:' " \
send-keys C-c; \
run-shell '$SCRIPTS_DIR/update_plugin_prompt_handler.sh %1'"
}
main() {
reload_tmux_environment
display_plugin_update_list
update_plugin_prompt
}
main

View File

@@ -0,0 +1,12 @@
# Automatic tpm installation
One of the first things we do on a new machine is cloning our dotfiles. Not everything comes with them though, so for example `tpm` most likely won't be installed.
If you want to install `tpm` and plugins automatically when tmux is started, put the following snippet in `.tmux.conf` before the final `run '~/.tmux/plugins/tpm/tpm'`:
```
if "test ! -d ~/.tmux/plugins/tpm" \
"run 'git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins'"
```
This useful tip was submitted by @acr4 and narfman0.

View File

@@ -0,0 +1,16 @@
# Changing plugins install dir
By default, TPM installs plugins in a subfolder named `plugins/` inside
`$XDG_CONFIG_HOME/tmux/` if a `tmux.conf` file was found at that location, or
inside `~/.tmux/` otherwise.
You can change the install path by putting this in `.tmux.conf`:
set-environment -g TMUX_PLUGIN_MANAGER_PATH '/some/other/path/'
Tmux plugin manager initialization in `.tmux.conf` should also be updated:
# initializes TMUX plugin manager in a new path
run /some/other/path/tpm/tpm
Please make sure that the `run` line is at the very bottom of `.tmux.conf`.

View File

@@ -0,0 +1,108 @@
# How to create Tmux plugins
Creating a new plugin is easy.
For demonstration purposes we'll create a simple plugin that lists all
installed TPM plugins. Yes, a plugin that lists plugins :) We'll bind that to
`prefix + T`.
The source code for this example plugin can be found
[here](https://github.com/tmux-plugins/tmux-example-plugin).
### 1. create a new git project
TPM depends on git for downloading and updating plugins.
To create a new git project:
$ mkdir tmux_my_plugin
$ cd tmux_my_plugin
$ git init
### 2. create a `*.tmux` plugin run file
When it sources a plugin, TPM executes all `*.tmux` files in your plugins'
directory. That's how plugins are run.
Create a plugin run file in plugin directory:
$ touch my_plugin.tmux
$ chmod u+x my_plugin.tmux
You can have more than one `*.tmux` file, and all will get executed. However, usually
you'll need just one.
### 3. create a plugin key binding
We want the behavior of the plugin to trigger when a user hits `prefix + T`.
Key `T` is chosen because:
- it's "kind of" a mnemonic for `TPM`
- the key is not used by Tmux natively. Tmux man page, KEY BINDINGS section
contains a list of all the bindings Tmux uses. There's plenty of unused keys
and we don't want to override any of Tmux default key bindings.
Open the plugin run file in your favorite text editor:
$ vim my_plugin.tmux
# or
$ subl my_plugin.tmux
Put the following content in the file:
#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
tmux bind-key T run-shell "$CURRENT_DIR/scripts/tmux_list_plugins.sh"
As you can see, plugin run file is a simple bash script that sets up the binding.
When pressed, `prefix + T` will execute another shell script:
`tmux_list_plugins.sh`. That script should be in `scripts/` directory -
relative to the plugin run file.
### 4. listing plugins
Now that we have the binding, let's create a script that's invoked with
`prefix + T`.
$ mkdir scripts
$ touch scripts/tmux_list_plugins.sh
$ chmod u+x scripts/tmux_list_plugins.sh
And here's the script content:
#!/usr/bin/env bash
# fetching the directory where plugins are installed
plugin_path="$(tmux show-env -g TMUX_PLUGIN_MANAGER_PATH | cut -f2 -d=)"
# listing installed plugins
ls -1 "$plugin_path"
### 5. try it out
To see if this works, execute the plugin run file:
$ ./my_plugin.tmux
That should set up the key binding. Now hit `prefix + T` and see if it works.
### 6. publish the plugin
When everything is ready, push the plugin to an online git repository,
preferably GitHub.
Other users can install your plugin by just adding plugin git URL to the
`@plugin` list in their `.tmux.conf`.
If the plugin is on GitHub, your users will be able to use the shorthand of
`github_username/repository`.
### Conclusion
Hopefully, that was easy. As you can see, it's mostly shell scripting.
You can use other scripting languages (ruby, python etc) but plain old shell
is preferred because of portability.

View File

@@ -0,0 +1,36 @@
# Managing plugins via the command line
Aside from tmux key bindings, TPM provides shell interface for managing plugins
via scripts located in [bin/](../bin/) directory.
Tmux does not need to be started in order to run scripts (but it's okay if it
is). If you [changed tpm install dir](../docs/changing_plugins_install_dir.md)
in `.tmux.conf` that should work fine too.
Prerequisites:
- tmux installed on the system (doh)
- `.tmux.conf` set up for TPM
### Installing plugins
As usual, plugins need to be specified in `.tmux.conf`. Run the following
command to install plugins:
~/.tmux/plugins/tpm/bin/install_plugins
### Updating plugins
To update all installed plugins:
~/.tmux/plugins/tpm/bin/update_plugins all
or update a single plugin:
~/.tmux/plugins/tpm/bin/update_plugins tmux-sensible
### Removing plugins
To remove plugins not on the plugin list:
~/.tmux/plugins/tpm/bin/clean_plugins

View File

@@ -0,0 +1,102 @@
# Help, tpm not working!
Here's the list of issues users had with `tpm`:
<hr />
> Nothing works. `tpm` key bindings `prefix + I`, `prefix + U` not even
defined.
Related [issue #22](https://github.com/tmux-plugins/tpm/issues/22)
- Do you have required `tmux` version to run `tpm`?<br/>
Check `tmux` version with `$ tmux -V` command and make sure it's higher or
equal to the required version for `tpm` as stated in the readme.
- ZSH tmux plugin might be causing issues.<br/>
If you have it installed, try disabling it and see if `tpm` works then.
<hr />
> Help, I'm using custom config file with `tmux -f /path/to/my_tmux.conf`
to start Tmux and for some reason plugins aren't loaded!?
Related [issue #57](https://github.com/tmux-plugins/tpm/issues/57)
`tpm` has a known issue when using custom config file with `-f` option.
The solution is to use alternative plugin definition syntax. Here are the steps
to make it work:
1. remove all `set -g @plugin` lines from tmux config file
2. in the config file define the plugins in the following way:
# List of plugins
set -g @tpm_plugins ' \
tmux-plugins/tpm \
tmux-plugins/tmux-sensible \
tmux-plugins/tmux-resurrect \
'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm'
3. Reload TMUX environment so TPM is sourced: `$ tmux source /path/to/my_tmux.conf`
The plugins should now be working.
<hr />
> Weird sequence of characters show up when installing or updating plugins
Related: [issue #25](https://github.com/tmux-plugins/tpm/issues/25)
- This could be caused by [tmuxline.vim](https://github.com/edkolev/tmuxline.vim)
plugin. Uninstall it and see if things work.
<hr />
> "failed to connect to server" error when sourcing .tmux.conf
Related: [issue #48](https://github.com/tmux-plugins/tpm/issues/48)
- Make sure `tmux source ~/.tmux.conf` command is ran from inside `tmux`.
<hr />
> tpm not working: '~/.tmux/plugins/tpm/tpm' returned 2 (Windows / Cygwin)
Related: [issue #81](https://github.com/tmux-plugins/tpm/issues/81)
This issue is most likely caused by Windows line endings. For example, if you
have git's `core.autocrlf` option set to `true`, git will automatically convert
all the files to Windows line endings which might cause a problem.
The solution is to convert all line ending to Unix newline characters. This
command handles that for all files under `.tmux/` dir (skips `.git`
subdirectories):
```bash
find ~/.tmux -type d -name '.git*' -prune -o -type f -print0 | xargs -0 dos2unix
```
<hr />
> '~/.tmux/plugins/tpm/tpm' returned 127 (on macOS, w/ tmux installed using brew)
Related: [issue #67](https://github.com/tmux-plugins/tpm/issues/67)
This problem is because tmux's `run-shell` command runs a shell which doesn't read from user configs, thus tmux installed in a brew prefix (e.g. `/usr/local/bin`) will not be found.
The solution is to find your brew prefix
```sh
> echo "$(brew --prefix)/bin"
/opt/homebrew/bin
```
And prepend it to the `PATH` environment variable
```
set-environment -g PATH "/opt/homebrew/bin:/bin:/usr/bin"
```
before any `run-shell`/`run` commands in `~/.tmux.conf`.

View File

@@ -0,0 +1,2 @@
.vagrant/
lib/

View File

@@ -0,0 +1,19 @@
# generic packages and tmux
before_install:
- sudo apt-get update
- sudo apt-get install -y git-core expect
- sudo apt-get install -y python-software-properties software-properties-common
- sudo apt-get install -y libevent-dev libncurses-dev
- git clone https://github.com/tmux/tmux.git
- cd tmux
- git checkout 2.0
- sh autogen.sh
- ./configure && make && sudo make install
install:
- git fetch --unshallow --recurse-submodules || git fetch --recurse-submodules
# manual `git clone` required for testing `tmux-test` plugin itself
- git clone https://github.com/tmux-plugins/tmux-test lib/tmux-test; true
- lib/tmux-test/setup
script: ./tests/run_tests_in_isolation

View File

@@ -0,0 +1,45 @@
# Changelog
### master
- move `setup` task to `.travis.yml` for travis tests
- "merge" travis.yml and travis_for_plugins.yml files (no need to keep em
separate)
- add more useful helper functions
- remove tmux-test repo as a submodule from self, this causes issues with
`$ git submodule update --recursive --init` command that some users use for
managing other plugins
- add new helper `teardown_helper`
- add `run_tests` helper
- change CLI syntax for choosing vagrant machine to run the tests on
- enable running just a single test via `run_tests` cli interface
- add `--keep-running` cli option to continue running vagrant after the tests
are done executing
- start using tmux 2.0 for tests
### v0.2.0, 2015-02-22
- `setup` script gitignores `tests/helpers.sh`
- move `tests/helpers.sh` to `tests/helpers/helpers.sh`
- `setup` undo removes added lines from gitignore file
### v0.1.0, 2015-02-22
- changes so that 'tmux-test' can be included with tmux plugins
- do not gitignore submodules directory
- add installation and usage instructions
- copy `.travis.yml` to the project root when running `setup` script
- add a brief mention of travis CI to the readme
- add test helpers
- `setup` script symlinks helpers file to `tests/` directory
- `setup` script can undo most of its actions
- add a tmux scripting test
- `tmux-test` uses `tmux-test` to test itself
- update `tmux-test` submodule
- a different `travis.yml` for `tmux-test` and for plugins
### v0.0.1, 2015-02-21
- git init
- add vagrant provisioning scripts for ubuntu and debian
- add a ".travis.yml" file
- generic "run_tests" script
- "run_tests_in_isolation" script
- add "Vagrantfile"
- enable passing VM names as arguments to "run_tests" script

View File

@@ -0,0 +1,19 @@
Copyright (C) Bruno Sutic
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,134 @@
# tmux-test
[![Build Status](https://travis-ci.org/tmux-plugins/tmux-test.png?branch=master)](https://travis-ci.org/tmux-plugins/tmux-test)
A small framework for isolated testing of tmux plugins. Isolation is achieved by
running the tests in `Vagrant`. Works on [travis](travis-ci.org) too.
Extracted from [tmux plugin manager](https://github.com/tmux-plugins/tpm) and
[tmux-copycat](https://github.com/tmux-plugins/tmux-copycat).
Dependencies: `Vagrant` (no required when running on travis).
### Setup
Let's say you made tmux plugin with the following file hierarchy:
```text
/tmux-plugin
|-- plugin.tmux
`-- scripts
`-- plugin_script.sh
```
From your project root directory (tmux-plugin/) execute the following shell
command to fetch `tmux-test` and add it as a submodule:
$ git submodule add https://github.com/tmux-plugins/tmux-test.git lib/tmux-test
Run the `setup` script:
$ lib/tmux-test/setup
The project directory will now look like this (additions have comments):
```text
/tmux-plugin
|-- plugin.tmux
|-- run_tests # symlink, gitignored
|-- .gitignore # 2 lines appended to gitignore
|-- .travis.yml # added
|-- lib/tmux-test/ # git submodule
|-- scripts
| `-- plugin_script.sh
`-- tests # dir to put the tests in
`-- run_tests_in_isolation.sh # symlink, gitignored
`-- helpers
`-- helpers.sh # symlinked bash helpers, gitignored
```
`tmux-test` is now set up. You are ok to commit the additions to the repo.
### Writing and running tests
A test is any executable with a name starting with `test_` in `tests/`
directory.
Now that you installed `tmux-test` let's create an example test.
- create a `tests/test_example.sh` file with the following content (it's a
`bash` script but it can be any executable):
#/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# bash helpers provided by 'tmux-test'
source $CURRENT_DIR/helpers/helpers.sh
# installs plugin from current repo in Vagrant (or on Travis)
install_tmux_plugin_under_test_helper
# start tmux in background (plugin under test is sourced)
tmux new -d
# get first session name
session_name="$(tmux list-sessions -F "#{session_name}")"
# fail the test if first session name is not "0"
if [ "$session_name" == "0" ]; then
# fail_helper is also provided by 'tmux-test'
fail_helper "First session name is not '0' by default"
fi
# sets the right script exit code ('tmux-test' helper)
exit_helper
- make the test file executable with `$ chmod +x tests/test_example.sh`
- run the test by executing `./run_tests` from the project root directory
- the first invocation might take some time because Vagrant's ubuntu virtual
machine is downloading. You should see `Success, tests pass!` message when it's
done.
Check out more example test scripts in this project's [tests/ directory](tests/).
### Continuous integration
The setup script (`lib/tmux-test/setup`) added a `.travis.yml` file to the
project root. To setup continuous integration, just add/enable the project on
[travis](travis-ci.org).
### Notes
- The `tests/` directory for tests and `lib/tmux-test/` for cloning `tmux-test`
into cannot be changed currently
- Don't run `tests/run_tests_in_isolation` script on your local development
environment. That's an internal test runner meant to be executed in an
isolated environment like `vagrant` or `travis`.<br/>
Use `./run_tests` script.
- You can use `KEEP_RUNNING=true ./run_tests` for faster test running cycle.
If this case `Vagrant` will keep running even after the tests are done.
- You can use `VAGRANT_CWD=lib/tmux-text/ vagrant ssh ubuntu` for ssh login to
`Vagrant`.
### Running `tmux-test` framework tests
`tmux-test` uses itself to test itself. To run framework tests:
- clone this project `$ git clone git@github.com:tmux-plugins/tmux-test.git`
- `$ cd tmux-test`
- run `$ ./run_framework_tests`
### Other goodies
- [tmux-copycat](https://github.com/tmux-plugins/tmux-copycat) - a plugin for
regex searches in tmux and fast match selection
- [tmux-continuum](https://github.com/tmux-plugins/tmux-continuum) - automatic
restoring and continuous saving of tmux env
You might want to follow [@brunosutic](https://twitter.com/brunosutic) on
twitter if you want to hear about new tmux plugins or feature updates.
### License
[MIT](LICENSE.md)

View File

@@ -0,0 +1,17 @@
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.synced_folder "../../", "/vagrant"
config.vm.define :ubuntu do |ubuntu|
ubuntu.vm.box = "hashicorp/precise64"
ubuntu.vm.provision "shell", path: "vagrant_ubuntu_provisioning.sh"
end
config.vm.define :centos do |centos|
centos.vm.box = "chef/centos-6.5"
centos.vm.provision "shell", path: "vagrant_centos_provisioning.sh"
end
end

View File

@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# This file is used to run "tmux-test" framework tests.
# "setup" script is needed to run the tests, but it overrides some working dir
# files. To address that, "setup" is run before the tests and it's actions are
# undone after.
main() {
git clone https://github.com/tmux-plugins/tmux-test lib/tmux-test
lib/tmux-test/setup
./run_tests
local exit_value=$?
lib/tmux-test/setup "undo"
exit "$exit_value"
}
main

View File

@@ -0,0 +1,93 @@
#!/usr/bin/env bash
# invoke this script from your projects root directory
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# pass "undo" as a script arg to undo most of the setup actions
UNDO_SETUP="$1"
undo() {
[ "$UNDO_SETUP" == "undo" ]
}
restore() {
local file="$1"
rm -f "$file"
git checkout -- "$file" 2>/dev/null
}
gitignore() {
local file="$1"
grep -q "^${file}$" .gitignore 2>/dev/null || echo "$file" >> .gitignore
}
remove_from_gitignore() {
local file="$1"
local escaped_filename="$(echo "$file" | sed "s,/,\\\/,g")"
sed -i"" "/^${escaped_filename}$/d" .gitignore
}
add_files_to_gitignore() {
if ! undo; then
gitignore "run_tests"
gitignore "tests/run_tests_in_isolation"
gitignore "tests/helpers/helpers.sh"
else
remove_from_gitignore "run_tests"
remove_from_gitignore "tests/run_tests_in_isolation"
remove_from_gitignore "tests/helpers/helpers.sh"
fi
}
symlink_user_test_runner() {
local file="run_tests"
if ! undo; then
ln -sf "lib/tmux-test/${file}" "$file"
else
restore "$file"
fi
}
create_directory_for_tests() {
if ! undo; then
mkdir -p tests/helpers/
fi
}
symlink_internal_test_runner() {
local file="tests/run_tests_in_isolation"
if ! undo; then
ln -sf "../lib/tmux-test/${file}" "$file"
else
restore "$file"
fi
}
symlink_test_helpers() {
local file="tests/helpers/helpers.sh"
if ! undo; then
ln -sf "../../lib/tmux-test/${file}" "$file"
else
restore "$file"
fi
}
copy_travis_yml() {
local file=".travis.yml"
if ! undo; then
cp "lib/tmux-test/${file}" "$file"
else
restore "$file"
fi
}
main() {
add_files_to_gitignore
symlink_user_test_runner
create_directory_for_tests
symlink_internal_test_runner
symlink_test_helpers
copy_travis_yml
}
main

View File

@@ -0,0 +1,68 @@
# This file is a symlink from 'tmux-test' plugin.
# You probably don't want to edit it.
# Global variable that keeps the value of test status (success/fail).
# Suggested usage is via `fail_helper` and `exit_helper` functions.
TEST_STATUS="success"
# PRIVATE FUNCTIONS
_clone_the_plugin() {
local plugin_path="${HOME}/.tmux/plugins/tmux-plugin-under-test/"
rm -rf "$plugin_path"
git clone --recursive "${CURRENT_DIR}/../" "$plugin_path" >/dev/null 2>&1
}
_add_plugin_to_tmux_conf() {
set_tmux_conf_helper<<-HERE
run-shell '~/.tmux/plugins/tmux-plugin-under-test/*.tmux'
HERE
}
# PUBLIC HELPER FUNCTIONS
teardown_helper() {
rm -f ~/.tmux.conf
rm -rf ~/.tmux/
tmux kill-server >/dev/null 2>&1
}
set_tmux_conf_helper() {
> ~/.tmux.conf # empty tmux.conf file
while read line; do
echo "$line" >> ~/.tmux.conf
done
}
fail_helper() {
local message="$1"
echo "$message" >&2
TEST_STATUS="fail"
}
exit_helper() {
teardown_helper
if [ "$TEST_STATUS" == "fail" ]; then
echo "FAIL!"
echo
exit 1
else
echo "SUCCESS"
echo
exit 0
fi
}
install_tmux_plugin_under_test_helper() {
_clone_the_plugin
_add_plugin_to_tmux_conf
}
run_tests() {
# get all the functions starting with 'test_' and invoke them
for test in $(compgen -A function | grep "^test_"); do
"$test"
done
exit_helper
}

View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bash
# This file is a symlink from 'tmux-test' plugin.
# You probably don't want to edit it.
# This script should be run within an isolated enviroment (Vagrant, travis).
# Depending on what the tests do, it might NOT be safe to run this script
# directly on the development machine.
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
EXIT_VALUE=0 # running a test suite is successful by default
all_test_files() {
ls -1 "$CURRENT_DIR" | # test files are in the current dir
\grep -i "^test" | # test file names start with "test"
xargs # file names in a single line
}
set_exit_val_to_false() {
EXIT_VALUE=1
}
run_tests() {
local test_file tests_files
if [ "$#" -gt 0 ]; then
test_files="${@//tests\//}" # remove 'tests/' directory prefix
else
test_files="$(all_test_files)"
fi
for test_file in $test_files; do
echo "Running test: $test_file"
"${CURRENT_DIR}/${test_file}"
# handling exit value
local test_exit_value="$?"
if [ "$test_exit_value" -ne 0 ]; then
set_exit_val_to_false
fi
done
}
main() {
run_tests "$@"
exit "$EXIT_VALUE"
}
main "$@"

View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
exit 0

View File

@@ -0,0 +1,24 @@
#/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# bash helpers provided by 'tmux-test'
source $CURRENT_DIR/helpers/helpers.sh
# installs plugin from current repo in Vagrant (or on Travis)
install_tmux_plugin_under_test_helper
# start tmux in background (plugin under test is sourced)
tmux new -d
# get first session name
session_name="$(tmux list-sessions -F "#{session_name}")"
# fail the test if first session name is not "0"
if ! [ "$session_name" == "0" ]; then
# fail_helper is also provided by 'tmux-test'
fail_helper "First session name is not '0' by default"
fi
# sets the right script exit code ('tmux-test' helper)
exit_helper

Some files were not shown because too many files have changed in this diff Show More