From 7d7090c076c52a48be3826f2afde7e6ef9addecf Mon Sep 17 00:00:00 2001 From: lucius Date: Mon, 18 Aug 2025 11:47:10 +0800 Subject: [PATCH] release0 --- README.md | 4 ++++ tmux.conf | 53 ++++++++++++++++++++++++++++------------------------- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index a7dd7e5..db7d187 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,7 @@ if ! pgrep -f "tmux_net_speed.sh" > /dev/null; then nohup ~/tmux_net_speed.sh >/dev/null 2>&1 & fi ``` + +## V1.3.0 + + release0 diff --git a/tmux.conf b/tmux.conf index 5e4fefe..d79b7c6 100644 --- a/tmux.conf +++ b/tmux.conf @@ -1,37 +1,40 @@ -# 启用 tpm 插件管理器 +# ====================== +# 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 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 " +set -g status-left-length 40 # 长度 +# # 1 +# set -g status-left "#[fg=green,bold] #S #[fg=cyan]| #[fg=yellow]#W #[fg=cyan]| #[fg=white]#P " +# set -g window-status-current-format " #I:#W#F " +# # 2 +# set -g status-left "#[fg=green,bold] #S #[fg=cyan]| #[fg=yellow]#W#{?window_active,*} #[fg=cyan]| #[fg=white]#P " +# # 3 +set -g status-left "#[fg=green] #S | #[fg=yellow]#W#{?window_activity_flag,[A],}#{?pane_active,[F],} | #[fg=white]#P " -# 炫彩右侧系统监控(修正版 CPU 计算,内存单位改为GB,CPU频率改为GHz) +# ====================== +# 右侧状态栏 +# 网速 / CPU / 内存 / 磁盘 / 日期时间 +# ====================== set -g status-right-length 150 set -g status-right "\ #[fg=cyan]Net: #(cat /tmp/tmux_net_speed.txt) \ -#[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=red,bold]CPU: #(top -bn2 -d 0.3 | grep 'Cpu(s)' | tail -n1 | awk -F',' '{print 100 - $4\"%\"}') \ +#[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=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 " \ No newline at end of file +# 非当前窗口样式 +set -g window-status-style bg=black,fg=white