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

fix: empty load status panel #503

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

matawed
Copy link

@matawed matawed commented Mar 9, 2025

without PR:
image

with PR:
image

env:

tmux 3.4
tmux-network-bandwidth:
jamesoff/tmux-loadavg@91319ef
catppuccin: 073ee54

@matawed matawed marked this pull request as draft March 10, 2025 08:19
@matawed matawed force-pushed the mt/fix_empty_load_status branch from 3251328 to afb6a81 Compare March 10, 2025 08:28
@matawed matawed marked this pull request as ready for review March 10, 2025 08:28
@kjnsn
Copy link
Collaborator

kjnsn commented Mar 10, 2025

I'd prefer to invest in getting rid of an external dependency and just using this one-liner instead: https://github.com/tmux/tmux/wiki/FAQ#what-is-the-best-way-to-display-the-load-average-why-no-l

I actually don't know why https://github.com/jamesoff/tmux-loadavg even exists. In fact we shouldn't be using it at all since it hardcodes color values that are not catppuccin: https://github.com/jamesoff/tmux-loadavg/blob/91319eff74ee677efb77c882dcc8e3b8780dc3a2/scripts/display_load.sh#L38

@matawed
Copy link
Author

matawed commented Mar 10, 2025

Ok, I agree. Makes sense....

However, I actually started yesterday with putting https://github.com/catppuccin/tmux/blob/main/docs/tutorials/02-custom-status.md in my .tmux.conf so I had something like the following

## catppuccin/tmux
set -g @catppuccin_flavor 'mocha'
set -g @catppuccin_window_status_style "rounded"
set -g @catppuccin_window_current_text "#{window_name}"
set -g @catppuccin_window_text "#{window_name}"
# the following is needed as tpm only runs *.tmux in  ~/.tmux/plugins/*/
run ~/.tmux/plugins/catppuccin/tmux/catppuccin.tmux


set -g status-right-length 100
set -g status-left-length 100
set -g status-left ""
set -g status-right "#{E:@catppuccin_status_directory}"
#set -agF status-right "#{E:@catppuccin_status_load_new}"
#set -agF status-right "#{E:@catppuccin_status_cpu}"
#set -agF status-right "#{E:@catppuccin_status_network_bandwidth}"
# In ~/.tmux.conf, after the catppuccin plugin has been loaded.


%hidden MODULE_NAME="load_new"
set -ogq "@catppuccin_${MODULE_NAME}_icon" " "
set -ogqF "@catppuccin_${MODULE_NAME}_color" "#{E:@thm_pink}"
set -ogq "@catppuccin_${MODULE_NAME}_text" "#(uptime|awk '{split(substr($0, index($0, "load")), a, ":"); print a[2]})'"
source "~/.tmux/plugins/catppuccin/tmux/utils//status_module.conf"

set -ag status-right "#{E:@catppuccin_status_load_new}"

But this unfortunately doesn't work. I also tried with hardcoding MODULE_NAME directly in the set statements and also with a hardcoded _text but I couldn't get it to work.

What did I do wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants