新增:右侧监控栏内存显示

This commit is contained in:
2025-08-15 17:59:21 +08:00
commit 8da9c53864
2 changed files with 46 additions and 0 deletions

37
tmux.conf Normal file
View File

@ -0,0 +1,37 @@
# 启用 tpm 插件管理器
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
# 启动 TPM
run '~/.tmux/plugins/tpm/tpm'
# 颜色
# set -g default-terminal "screen-256color"
# 鼠标
set -g mouse on
# 状态栏刷新间隔(秒)
set -g status-interval 1
# 状态栏背景/前景
set -g status-bg black
set -g status-fg white
# 左侧状态栏(会话名 | 窗口 | 面板)
set -g status-left-length 40
set -g status-left "#[fg=green,bold] #S #[fg=cyan]| #[fg=yellow]#W #[fg=cyan]| #[fg=white]#P "
# 炫彩右侧系统监控(修正版 CPU 计算内存单位改为GBCPU频率改为GHz
set -g status-right-length 150
set -g status-right "\
#[fg=red,bold]CPU: #(top -bn1 | grep 'Cpu(s)' | awk '{print 100 - $8\"%\"}') \
#[fg=magenta] #(awk '/MHz/ {printf(\"%.2fGHz\", $4/1000); exit}' /proc/cpuinfo) \
#[fg=yellow,bold]#(free -m | awk 'NR==2 {printf \" Mem: %.1f/%.1fGB | \", $3/1024, $2/1024} NR==3 {printf \"Swap: %.1f/%.1fGB\", $3/1024, $2/1024}') \
#[fg=blue]Disk: #(df -h / | awk 'NR==2 {print $3\"/\"$2}') \
#[fg=cyan]Net: #(vnstat --oneline b | awk -F\; '{print \"↑\"$11\" ↓\"$9}') \
#[fg=green] %Y-%m-%d #[fg=white] %H:%M"
# 让状态栏颜色更醒目
set -g status-style bg=black,fg=white
set -g window-status-current-style bg=colour237,fg=colour223,bold
set -g window-status-current-format " #I:#W#F "