1
0
mirror of https://github.com/samoshkin/tmux-config.git synced 2026-01-05 01:08:01 +00:00

Finish with appearence and status bar. Integrate various plugins including tmux-plugin-sysstat

This commit is contained in:
Alexey Samoshkin
2017-11-21 03:21:27 +02:00
parent 943be96ca9
commit 8570ef7406
6 changed files with 138 additions and 69 deletions

View File

@@ -10,6 +10,10 @@ set -g allow-rename off
set -g default-terminal "screen"
set -g remain-on-exit off
# aggressive-resize [on | off]
# alternate-screen [on | off]
# Change prefix key to C-a, easier to type, same to "screen"
unbind C-b
set -g prefix C-a
@@ -148,12 +152,85 @@ unbind -T copy-mode-vi MouseDragEnd1Pane
bind -T copy-mode-vi MouseDown1Pane select-pane \; send-keys -X copy-selection
# ===================================
# === Appearence and status bar ===
# ===================================
# =====================================
# === Appearence and status bar ===
# ======================================
# Load theme
source ~/.tmux/theme.conf
set -g mode-style "fg=default,bg=$color_main"
# command line style
set -g message-style "fg=$color_main,bg=$color_dark"
# status line style
set -g status-style "fg=$color_status_text,bg=$color_dark"
# window segments in status line
set -g window-status-separator ""
separator_powerline_left=""
separator_powerline_right=""
setw -g window-status-style "fg=$color_status_text,bg=$color_dark"
setw -g window-status-format " #I:#W "
setw -g window-status-current-style "fg=$color_light,bold,bg=$color_main"
setw -g window-status-current-format "#[fg=$color_dark,bg=$color_main]$separator_powerline_right#[default] #I:#W# #[fg=$color_main,bg=$color_dark]$separator_powerline_right#[default]"
# when window has monitoring notification
setw -g window-status-activity-style "fg=$color_main,bg=$color_dark"
# outline for active pane
setw -g pane-active-border-style "fg=$color_main"
# general status bar settings
set -g status on
set -g status-interval 5
set -g status-position top
set -g status-justify left
set -g status-right-length 140
# define widgets we're going to use in status bar
# note, that this is not the complete list, some of them are loaded from plugins
wg_session="#[fg=$color_session_text] #S #[default]"
wg_battery="#{battery_status_fg} #{battery_icon} #{battery_percentage}"
wg_date="#[fg=$color_secondary]%h %d %H:%M#[default]"
wg_host="#[fg=$color_secondary]#(echo $USER)#[default]@#H"
wg_is_zoomed="#[fg=$color_dark,bg=$color_secondary]#{?window_zoomed_flag,[Z],}#[default]"
set -g status-left "$wg_session"
set -g status-right "#{prefix_highlight} $wg_is_zoomed #{sysstat_cpu} | #{sysstat_mem} | #{sysstat_loadavg} | $wg_host | $wg_date $wg_battery #{online_status}"
# online and offline icon for tmux-online-status
set -g @online_icon "#[fg=$color_level_good]●#[default]"
set -g @offline_icon "#[fg=$color_level_achtung]●#[default]"
# Configure view templates for tmux-plugin-sysstat "MEM" and "CPU" widget
set -g @sysstat_mem_size_unit "G"
set -g @sysstat_mem_view_tmpl '#[fg=#{mem.color}]MEM:#{mem.pused}#[default] (#{mem.used})'
set -g @sysstat_cpu_view_tmpl '#[fg=#{cpu.color}]CPU:#{cpu.pused}#[default]'
# Configure colors for tmux-plugin-sysstat "MEM" and "CPU" widget
set -g @sysstat_cpu_color_low "$color_level_good"
set -g @sysstat_cpu_color_medium "$color_level_warn"
set -g @sysstat_cpu_color_high "$color_level_achtung"
set -g @sysstat_mem_color_ok "$color_level_good"
set -g @sysstat_mem_color_stress "$color_level_achtung"
# Configure tmux-battery widget colors
set -g @batt_color_full_charge "#[fg=$color_level_good]"
set -g @batt_color_high_charge "#[fg=$color_level_good]"
set -g @batt_color_medium_charge "#[fg=$color_level_warn]"
set -g @batt_color_low_charge "#[fg=$color_level_achtung]"
# Configure tmux-prefix-highlight colors
set -g @prefix_highlight_output_prefix '['
set -g @prefix_highlight_output_suffix ']'
set -g @prefix_highlight_fg "$color_dark"
set -g @prefix_highlight_bg "$color_secondary"
set -g @prefix_highlight_show_copy_mode 'on'
set -g @prefix_highlight_copy_mode_attr "fg=$color_dark,bg=$color_secondary"
# TODO: Not ready yet
# source ~/.tmux/theme.conf
# ============================
@@ -174,17 +251,9 @@ set -g @plugin 'tmux-plugins/tmux-online-status'
set -g @plugin 'tmux-plugins/tmux-sidebar'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-open'
set -g @plugin 'samoshkin/tmux-plugin-sysstat'
# Plugin properties
set -g @batt_remain_short true
set -g @prefix_highlight_show_copy_mode 'on'
set -g @prefix_highlight_output_prefix '['
set -g @prefix_highlight_output_suffix ']'
set -g @online_icon "#[fg=green]●#[default]"
set -g @offline_icon "#[fg=red]●#[default]"
set -g @sidebar-tree 't'
set -g @sidebar-tree-focus 'T'
set -g @sidebar-tree-command 'tree -C'