Skip to content

Commit 422eecb

Browse files
authored
Merge pull request #343 from dfshan/main
Look for `tmux-cpu-mem-load` from `tpm`
2 parents 26f1c54 + 874fd44 commit 422eecb

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ Alejandro Espinosa (Halbard) <[email protected]>
3939
4040
4141
Drew Daniels <[email protected]>
42+
Danfeng Shan <[email protected]>

segments/tmux_mem_cpu_load.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Print out Memory, cpu and load using https://github.com/thewtex/tmux-mem-cpu-load
22

33
run_segment() {
4-
type tmux-mem-cpu-load >/dev/null 2>&1
5-
if [ "$?" -ne 0 ]; then
4+
stats=""
5+
if type $TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load > /dev/null 2>&1; then
6+
stats=$($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load)
7+
elif type tmux-mem-cpu-load >/dev/null 2>&1; then
8+
stats=$(tmux-mem-cpu-load)
9+
else
610
return
711
fi
812

9-
stats=$(tmux-mem-cpu-load)
1013
if [ -n "$stats" ]; then
1114
echo "$stats";
1215
fi

0 commit comments

Comments
 (0)