Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tmux-clima as another module for weather #161

Merged
merged 5 commits into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
5. [Customizing modules](#customizing-modules)
6. [Battery module](#battery-module)
7. [CPU module](#CPU-module)
8. [Weather module](#weather-module)
8. [Weather modules](#weather-modules)
9. [Load module](#load-module)
10. [Uptime module](#uptime-module)
5. [Create a custom module](#create-a-custom-module)
Expand Down Expand Up @@ -373,15 +373,17 @@ Add the cpu module to the status modules list.
set -g @catppuccin_status_modules_right "... cpu ..."
```

### Weather module
### Weather modules
xafarr marked this conversation as resolved.
Show resolved Hide resolved

#### Requirements
#### tmux-weather

##### Requirements
This module depends on [tmux-weather](https://github.com/xamut/tmux-weather).

#### Install
##### Install
The preferred way to install tmux-weather is using [TPM](https://github.com/tmux-plugins/tpm).

#### Configure
##### Configure
Load tmux-weather after you load catppuccin.
```sh
set -g @plugin 'catppuccin/tmux'
Expand All @@ -394,6 +396,27 @@ Add the weather module to the status modules list.
set -g @catppuccin_status_modules_right "... weather ..."
```

#### tmux-clima

##### Requirements
This module depends on [tmux-clima](https://github.com/vascomfnunes/tmux-clima).

##### Install
The preferred way to install tmux-clima is using [TPM](https://github.com/tmux-plugins/tpm).

##### Configure
Load tmux-clima after you load catppuccin.
```sh
set -g @plugin 'catppuccin/tmux'
...
set -g @plugin 'vascomfnunes/tmux-clima'
```

Add the weather module to the status modules list.
```sh
set -g @catppuccin_status_modules_right "... clima ..."
```

### Load module

#### Requirements
Expand Down
11 changes: 11 additions & 0 deletions status/clima.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Requires https://github.com/vascomfnunes/tmux-clima
show_clima() {
local index=$1
local icon="$(get_tmux_option "@catppuccin_clima_icon" "")"
local color="$(get_tmux_option "@catppuccin_clima_color" "$thm_yellow")"
local text="$(get_tmux_option "@catppuccin_clima_text" "#{clima}")"

local module=$( build_status_module "$index" "$icon" "$color" "$text" )

echo "$module"
}