diff --git a/sh/tmux.sh b/sh/tmux.sh index a29ec26..9c3accd 100644 --- a/sh/tmux.sh +++ b/sh/tmux.sh @@ -51,6 +51,8 @@ set-option -g set-titles on # set title to working directory set-option -g set-titles-string '\ +#(basename \"\${TMUX}\" | cut --delimiter \",\" --fields \"1\")\ + - \ #{session_name}\ - \ #{window_index}∕#{session_windows} #{window_name}\ @@ -80,7 +82,7 @@ set-option -g pane-border-style fg=blue # ╰────────┴────────╯ # status lines -set-option -g status on +set-option -g status 2 # background color set-option -g status-bg '#0D0D0D' @@ -91,83 +93,82 @@ set-option -g status-fg white # line 1 set-option -g status-format[0] '\ #{W:\ -#[bg=##202020] #[bg=##303030]\ +#[bg=##202020]\ #{?window_zoomed_flag,#[fg=magenta][, }\ -#[fg=yellow]#{window_index}\ -#{?window_zoomed_flag,#[fg=magenta]], }\ -\ +#[bg=##303030]\ #{?window_active,#[fg=green],\ -#{?window_activity_flag,#[fg=red],#[fg=blue]}}\ +#{?window_activity_flag,#[fg=red],#[fg=yellow]}}\ #{window_name}\ -#[bg=##303030] #[bg=##202020] \ +#[bg=##202020]\ +#{?window_zoomed_flag,#[fg=magenta]], }\ #[bg=default] \ }\ #[align=right]\ -#[bg=##202020] #[bg=##303030] \ +#[bg=##202020] #[bg=##303030]\ #[fg=yellow]%H:%M:%S\ -#[bg=##303030] #[bg=##202020]\ +#[bg=##202020]\ #{?client_prefix,#[fg=green]p, }\ ' # line 2 set-option -g status-format[1] '\ #{S:\ -#[bg=##202020] #[bg=##303030] \ +#[bg=##202020] #[bg=##303030]\ #{?session_many_attached,#[fg=red],\ -#{?session_attached,#[fg=magenta],#[fg=blue]}}\ +#{?session_attached,#[fg=magenta],#[fg=yellow]}}\ #{session_name}\ -#[bg=##303030] #[bg=##202020] \ +#[bg=##202020] \ #[bg=default] \ }\ #[fg=yellow]→ #[fg=green]#{session_name} \ #[align=right]\ -#[bg=##202020] #[bg=##303030] \ +#[bg=##202020] #[bg=##303030]\ #[fg=yellow]%Y-%m-%d\ -#[bg=##303030] #[bg=##202020] \ +#[bg=##202020] \ ' # line 3 set-option -g status-format[2] '\ -#[fg=cyan]#{pane_current_path}\ +#[fg=yellow] \ +#(lsof -U | awk \"/^tmux:.*\\(LISTEN\\)$/ {print \\\$9}\" \ +| xargs -n \"1\" basename | sed \"s/^/ /;s/\$/ /\" | xargs echo) \ +→ #[fg=green]\ +#(basename \"\${TMUX}\" | cut --delimiter \",\" --fields \"1\") \ #[align=right]\ -#[bg=##202020] #[bg=##303030] \ +#[bg=##202020] #[bg=##303030]\ #[fg=yellow]#{host}\ -#[bg=##303030] #[bg=##202020] \ +#[bg=##202020] \ ' # line 4 set-option -g status-format[3] '\ #{P:\ -#[bg=##202020] #[bg=##303030] \ -#[fg=yellow]#{pane_index}\ - \ -#{?pane_active,#[fg=green],#[fg=blue]}\ +#[bg=##202020] #[bg=##303030]\ +#{?pane_active,#[fg=green],#[fg=yellow]}\ #{pane_current_command}\ -#[bg=##303030] #[bg=##202020] \ +#[bg=##202020] \ #[bg=default] \ }\ #[align=right]\ -#[bg=##202020] #[bg=##303030] \ +#[bg=##202020] #[bg=##303030]\ #{?uid,#[fg=green],#[fg=red]}\ #{user}\ -#[bg=##303030] #[bg=##202020] \ +#[bg=##202020] \ ' # line 5 set-option -g status-format[4] '\ #{P:\ -#[bg=##202020] #[bg=##303030] \ -#[fg=yellow]#{pane_index}\ - \ -#{?pane_active,#[fg=green],#[fg=blue]}\ +#[bg=##202020] #[bg=##303030]\ +#{?pane_active,#[fg=green],#[fg=yellow]}\ #{pane_width}×#{pane_height}\ -#[bg=##303030] #[bg=##202020] \ +#[bg=##202020] \ #[bg=default] \ }\ #[align=right]\ -#[bg=##202020] #[bg=##303030] \ +#[bg=##202020] #[bg=##303030]\ #[fg=green]#{window_width}×#{window_height}\ -#[bg=##303030] #[bg=##202020] \ +#[bg=##202020] \ ' # refresh period @@ -221,12 +222,15 @@ bind-key C-w command-prompt { rename-window '%%' } bind-key h split-window -h bind-key v split-window -v -# toggle mouse -bind-key t set-option -g mouse \\; display-message 'mouse = #{mouse}' +# kill server +bind-key k kill-server # reload configuration bind-key r source-file ${file} \\; display-message 'source-file ${file}' +# toggle mouse +bind-key t set-option -g mouse \\; display-message 'mouse = #{mouse}' + # swap window bind-key M-Left swap-window -t -1 bind-key M-Right swap-window -t +1 @@ -239,6 +243,7 @@ bind-key M-Right swap-window -t +1 # │ command-prompt │ │ │ │ : │ # │ copy-mode │ │ │ │ PPage │ # │ detach-client │ F6 │ │ │ d │ +# │ kill-server │ │ k │ │ │ # │ new-session │ │ │ │ │ # │ new-window │ F2 │ │ │ c │ # │ next-window │ M-Right │ │ │ n │