tmux-plugins / tmux-cpu

Plug and play cpu percentage and icon indicator for Tmux.
MIT License
426 stars 65 forks source link

CPU percentage doesn't work (maybe with macos M1) #73

Closed Bdragon93 closed 2 years ago

Bdragon93 commented 2 years ago

Hey guys, I am using macOS Monterey on a Macbook pro 13" chip apple M1.

.tmux.config:

set -g status-right '#{battery_status_bg} #{battery_icon}#{battery_percentage} | #{cpu_icon} #{cpu_percentage} | %a %h %d %H:%M'

Actual result:

Screen Shot 2021-10-29 at 04 33 05

I tried to clone the repository and run scripts/cpu_percentage.sh => it works well. I tried to put ram_percentage instead and looks fine also.

Just moved to use M1 today so I think am using the latest version for anything (tmux, tpm, tmux-cpu), and not sure it works or not with chip intel.

TIA for your time!

casperdcl commented 2 years ago

could you try updating tmux-cpu? Not sure if #74 just fixed your issue.

Bdragon93 commented 2 years ago

@casperdcl just tried, reinstall and restarted OS also, however got the same 😞

casperdcl commented 2 years ago

Just to clarify, running scripts/cpu_percentage.sh outputs a percentage yet the tmux status display doesn't work?

Bdragon93 commented 2 years ago

yep, this is the screenshot

Screen Shot 2021-10-29 at 16 50 49

tommyknows commented 2 years ago

EDIT: nevermind, had a config issue which meant that the plugin was loaded before the status bar configuration 🙂

Thus, I can not reproduce this behaviour on an M1, but if you need me to try anything, let me know!

Bdragon93 commented 2 years ago

@tommyknows Sorry, I don't really get you, you mean that happened for you on an M1, then you do something and it works well now, though can not reproduce the before it works?

If I was right so what did you do for the plugin load after the status bar configuration? 😅

tommyknows commented 2 years ago

I'm using Nix to configure tmux, and Nix uses run-shell to load plugins. The issue now is that the run-shell commands that load the plugins ran before the set -g status-right configuration, and as such, the #{cpu_percentage} string was not found at all in the statusbar.

(Note that I don't use the cpu_icon, but that would not have worked either)

Now my tmux conf looks like this:

set -g status-right ...

run-shell <path-to-cpu-plugin>/cpu/cpu.tmux
run-shell <path-to-battery-plugin/battery/battery.tmux

And that works fine :)

Bdragon93 commented 2 years ago

oh guys, just tried to set it up again, and it works now without any actions. It happened quite a long time ago so I guess that I didn't run my terminal in Rosetta, but not sure, or maybe had the updates from another side.

Anw, I'll close this issue thanks @tommyknows