Skip to content

Commit 0aa010b

Browse files
committed
Support to specify command-line arguments for tmux-mem-cpu-load segment
1 parent ee018a5 commit 0aa010b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

segments/tmux_mem_cpu_load.sh

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

3+
generate_segmentrc() {
4+
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+
EORC
8+
echo "$rccontents"
9+
}
10+
311
run_segment() {
412
stats=""
513
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)
14+
stats=$($TMUX_PLUGIN_MANAGER_PATH/tmux-mem-cpu-load/tmux-mem-cpu-load $TMUX_POWERLINE_SEG_TMUX_MEM_CPU_LOAD_ARGS)
715
elif type tmux-mem-cpu-load >/dev/null 2>&1; then
816
stats=$(tmux-mem-cpu-load)
917
else

0 commit comments

Comments
 (0)