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 cpu_mem & network module #194

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,48 @@ Add the cpu module to the status modules list.
set -g @catppuccin_status_modules_right "... cpu ..."
```

### CPU MEM module

#### Requirements
This module depends on [tmux-mem-cpu-load](https://github.com/thewtex/tmux-mem-cpu-load).

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarify that this will build additional software


#### Configure
Load tmux-cpu after you load catppuccin.
```sh
set -g @plugin 'catppuccin/tmux'
...
set -g @plugin 'thewtex/tmux-mem-cpu-load'
```

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

### Network module

#### Requirements
This module depends on [tmux-net-speed](https://github.com/tmux-plugins/tmux-net-speed).

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

#### Configure
Load tmux-cpu after you load catppuccin.
```sh
set -g @plugin 'catppuccin/tmux'
...
set -g @plugin 'tmux-plugins/tmux-net-speed'
```

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

### Weather modules

#### tmux-weather
Expand Down
14 changes: 14 additions & 0 deletions status/cpu_mem.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Requires https://github.com/thewtex/tmux-mem-cpu-load

show_cpu_mem() {
local index icon color text module

index=$1
icon="$(get_tmux_option "@catppuccin_cpu_mem_icon" "")"
color="$(get_tmux_option "@catppuccin_cpu_mem_color" "$thm_blue")"
text="$(get_tmux_option "@catppuccin_cpu_mem__text" "#($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load --cpu-mode 2 --averages-count 0 --interval 2)")"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an extra option "@catppuccin_cpu_mem_args/options" with as default "--cpu-mode 2 --averages-count 0 --interval 2"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
text="$(get_tmux_option "@catppuccin_cpu_mem__text" "#($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load --cpu-mode 2 --averages-count 0 --interval 2)")"
text="$(get_tmux_option "@catppuccin_cpu_mem_text" "#($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load --cpu-mode 2 --averages-count 0 --interval 2)")"

2 underscores between mem and text


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

echo "$module"
}
13 changes: 13 additions & 0 deletions status/network.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Requires https://github.com/tmux-plugins/tmux-net-speed
show_network() {
local index icon color text module

index=$1
icon="$(get_tmux_option "@catppuccin_weather_icon" "")"
color="$(get_tmux_option "@catppuccin_weather_color" "$thm_green")"
text="$(get_tmux_option "@catppuccin_weather_text" "#{net_speed}")"

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

echo "$module"
}