Merge branch 'main' into feat-load-module

This commit is contained in:
Valentin Uveges 2024-03-07 07:32:12 +02:00 committed by GitHub
commit 6cb9e77e7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 63 additions and 20 deletions

1
.gitignore vendored
View file

@ -1 +0,0 @@
custom

View file

@ -31,6 +31,7 @@
7. [CPU module](#CPU-module)
8. [Weather module](#weather-module)
9. [Load module](#load-module)
10. [Uptime module](#uptime-module)
5. [Create a custom module](#create-a-custom-module)
6. [Configuration Examples](#configuration-examples)
1. [Config 1](#config-1)
@ -46,8 +47,8 @@
## Installation
In order to have the icons displayed correctly please use / update your favorite [patched 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 bellow on the options available.
In order to have the icons displayed correctly please use/update your favorite [patched 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 below on the options available.
### TPM
@ -60,7 +61,7 @@ set -g @plugin 'catppuccin/tmux'
set -g @plugin 'tmux-plugins/tpm'
```
3. (Optional) Set your preferred flavour, it defaults to `"mocha"`:
3. (Optional) Set your preferred flavor, it defaults to `"mocha"`:
```bash
set -g @catppuccin_flavour 'latte' # or frappe, macchiato, mocha
@ -68,17 +69,22 @@ set -g @catppuccin_flavour 'latte' # or frappe, macchiato, mocha
### Manual
1. Copy your desired theme's configuration contents into your Tmux config (usually stored at `~/.tmux.conf`)
2. Reload Tmux by either restarting the session or reloading it with `tmux source-file ~/.tmux.conf`
1. Clone this repository to your desired location (e.g.
`~/.config/tmux/plugins/catppuccin`)
2. Add the following line to your `tmux.conf` file:
`run ~/.config/tmux/plugins/catppuccin/catppuccin.tmux`
3. (Optional) Set your preferred flavor and/or add configuration options as
listed in [Configuration Options](#configuration-options).
4. Reload Tmux by either restarting the session or reloading it with `tmux source-file ~/.tmux.conf`
## Overview
![Default](./assets/overview.png)
This is a diagram on how the theme is split between it's components.
This is a diagram of how the theme is split between its components.
## Configuration options
All flavours support certain levels of customization that match our [Catppuccin
All flavors support certain levels of customization that match our [Catppuccin
Style Guide][style-guide]. To add these customizations, add any of the following
options to your Tmux configuration.
@ -147,7 +153,7 @@ Values:
#### Override the window default colors:
```sh
set -g @catppuccin_window_default_text "color" # text color
set -g @catppuccin_window_default_color "color" # text color
set -g @catppuccin_window_default_background "color"
```
@ -188,23 +194,27 @@ set -g @catppuccin_window_current_text "#{b:pane_current_path}" # use "#W" for a
```sh
set -g @catppuccin_window_current_format_directory_text "#{b:pane_current_path}"
```
Use this to overide the way the current directory is displayed.
Use this to override the way the current directory is displayed.
#### Set the directory format
```sh
set -g @catppuccin_window_format_directory_text "#{b:pane_current_path}"
```
Use this to overide the way the directory is displayed.
Use this to override the way the directory is displayed.
### Pane
#### Set the pane border style:
```sh
set -g @catppuccin_pane_border_style "fg=blue" # Use a value compatible with the standard tmux 'pane-border-style'
```
#### Set the pane active border style:
```sh
set -g @catppuccin_pane_active_border_style "fg=red" # Use a value compatible with the standard tmux 'pane-border-active-style'
```
### Status
@ -232,8 +242,8 @@ Values:
set -g @catppuccin_status_connect_separator "yes"
```
Values:
- yes - the background color of the separator will not blend in with the brackground color of tmux
- no - the background color of the separator will blend in with the brackground color of tmux
- yes - the background color of the separator will not blend in with the background color of tmux
- no - the background color of the separator will blend in with the background color of tmux
#### Set the status module color fill:
@ -313,7 +323,7 @@ set -g @catppuccin_date_time_icon "null"
This module depends on [tmux-battery](https://github.com/tmux-plugins/tmux-battery/tree/master).
#### Install
The prefered way to install tmux-battery is using [TPM](https://github.com/tmux-plugins/tpm).
The preferred way to install tmux-battery is using [TPM](https://github.com/tmux-plugins/tpm).
#### Configure
Load tmux-battery after you load catppuccin.
@ -334,7 +344,7 @@ set -g @catppuccin_status_modules_right "... battery ..."
This module depends on [tmux-cpu](https://github.com/tmux-plugins/tmux-cpu/tree/master).
#### Install
The prefered way to install tmux-cpu is using [TPM](https://github.com/tmux-plugins/tpm).
The preferred way to install tmux-cpu is using [TPM](https://github.com/tmux-plugins/tpm).
#### Configure
Load tmux-cpu after you load catppuccin.
@ -355,7 +365,7 @@ set -g @catppuccin_status_modules_right "... cpu ..."
This module depends on [tmux-weather](https://github.com/xamut/tmux-weather).
#### Install
The prefered way to install tmux-cpu is using [TPM](https://github.com/tmux-plugins/tpm).
The preferred way to install tmux-weather is using [TPM](https://github.com/tmux-plugins/tpm).
#### Configure
Load tmux-weather after you load catppuccin.
@ -389,11 +399,31 @@ set -g @plugin 'jamesoff/tmux-loadavg'
Add the weather module to the status modules list.
```sh
set -g @catppuccin_status_modules_right "... load ..."
### Uptime module
#### Requirements
This module depends on [tmux-uptime](https://github.com/robhurring/tmux-uptime).
#### Install
The prefered way to install tmux-uptime is using [TPM](https://github.com/tmux-plugins/tpm).
#### Configure
Load tmux-uptime after you load catppuccin.
```sh
set -g @plugin 'catppuccin/tmux'
...
set -g @plugin 'robhurring/tmux-uptime'
```
Add the uptime module to the status modules list.
```sh
set -g @catppuccin_status_modules_right "... uptime ..."
```
## Create a custom module
It is possible to add a new custom module or overrite any of the existing modules.
It is possible to add a new custom module or overwrite any of the existing modules.
Look into custom/README.md for more details.
@ -407,7 +437,7 @@ When switching between configurations run:
```sh
tmux kill-server
```
In order to kill the tmux server and clear all global variables.
To kill the tmux server and clear all global variables.
### Config 1

View file

@ -336,7 +336,10 @@ main() {
local pane_status_enable=$(get_tmux_option "@catppuccin_pane_status_enabled" "no") # yes
local pane_border_status=$(get_tmux_option "@catppuccin_pane_border_status" "off") # bottom
local pane_border_style=$(get_tmux_option "@catppuccin_pane_border_style" "fg=${thm_gray}")
local pane_active_border_style=$(get_tmux_option "@catppuccin_pane_active_border_style" "fg=${thm_orange}")
local pane_active_border_style=$(\
get_tmux_option "@catppuccin_pane_active_border_style" \
"#{?pane_in_mode,fg=${thm_yellow},#{?pane_synchronized,fg=${thm_magenta},fg=${thm_orange}}}"
)
local pane_left_separator=$(get_tmux_option "@catppuccin_pane_left_separator" "█")
local pane_middle_separator=$(get_tmux_option "@catppuccin_pane_middle_separator" "█")
local pane_right_separator=$(get_tmux_option "@catppuccin_pane_right_separator" "█")

View file

@ -13,7 +13,7 @@ Use the [Module template](#module-template) (or example.sh) as a starting point
Save the new module under this folder using the module name as the file name and .sh as the extension.
Update the status module list with your module.
```sh
set -g @catppuccin_status_modules "... <module_name> ..."
set -g @catppuccin_status_modules_right "... <module_name> ..."
```

11
status/uptime.sh Normal file
View file

@ -0,0 +1,11 @@
# Requires https://github.com/robhurring/tmux-uptime.
show_uptime() {
local index=$1
local icon="$(get_tmux_option "@catppuccin_uptime_icon" "󰔟")"
local color="$(get_tmux_option "@catppuccin_uptime_color" "$thm_green")"
local text="$(get_tmux_option "@catppuccin_uptime_text" "#{uptime}")"
local module=$( build_status_module "$index" "$icon" "$color" "$text" )
echo "$module"
}