Skip to content

Commit 4a40bf2

Browse files
committed
Added default value and also use the variable for local tmux-mem-cpu-load installation.
1 parent 0aa010b commit 4a40bf2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

segments/tmux_mem_cpu_load.sh

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

3+
TMUX_POWERLINE_SEG_TMUX_MEM_CPU_LOAD_ARGS_DEFAULT="-v"
4+
35
generate_segmentrc() {
46
read -d '' rccontents << EORC
5-
# Arguments passed to tmux-mem-cpu-load
6-
export TMUX_POWERLINE_SEG_TMUX_MEM_CPU_LOAD_ARGS="-v" # The data provider to use. Currently only "yahoo" is supported.
7+
# Arguments passed to tmux-mem-cpu-load.
8+
# See https://github.com/thewtex/tmux-mem-cpu-load for all available options.
9+
export TMUX_POWERLINE_SEG_TMUX_MEM_CPU_LOAD_ARGS="${TMUX_POWERLINE_SEG_TMUX_MEM_CPU_LOAD_ARGS_DEFAULT}"
710
EORC
811
echo "$rccontents"
912
}
@@ -13,7 +16,7 @@ run_segment() {
1316
if type $TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load > /dev/null 2>&1; then
1417
stats=$($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load $TMUX_POWERLINE_SEG_TMUX_MEM_CPU_LOAD_ARGS)
1518
elif type tmux-mem-cpu-load >/dev/null 2>&1; then
16-
stats=$(tmux-mem-cpu-load)
19+
stats=$(tmux-mem-cpu-load $TMUX_POWERLINE_SEG_TMUX_MEM_CPU_LOAD_ARGS)
1720
else
1821
return
1922
fi

0 commit comments

Comments
 (0)