Add hostname to tmux status-left

This commit is contained in:
Jacob Hinkle 2022-08-30 14:39:55 -04:00
parent 0737e8306b
commit 0a474a43cf
2 changed files with 32 additions and 30 deletions

View File

@ -152,36 +152,7 @@
};
};
};
tmux = {
enable = true;
aggressiveResize = true;
clock24 = true;
escapeTime = 0;
historyLimit = 10000;
keyMode = "vi";
shortcut = "a";
terminal = "kitty";
extraConfig = ''
unbind [
bind Escape copy-mode
bind f set-option status
bind c new-window -c "#{pane_current_path}"
# Set status bar
set -g status-position bottom
set -g status-style fg=white
set -g status-left '#[fg=green]#(who -s | awk "{ print \$1}" | sort -u | grep -v 4jh | xargs echo) #[fg=black,bright]#H'
# TODO: highlighted for nested local session as well
wg_is_keys_off="#[fg=red,bright]#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'PASSTHRU')#[default]"
set -g status-right "#[fg=yellow,bright]#S $wg_is_keys_off #[fg=green,dim]%H:%M"
set-window-option -g window-status-current-style fg=red
# align center the window list
set -g status-justify centre
'';
};
tmux = import ./tmux.nix;
zsh = {
enable = true;
enableSyntaxHighlighting = true;

31
home/tmux.nix Normal file
View File

@ -0,0 +1,31 @@
{
enable = true;
aggressiveResize = true;
clock24 = true;
escapeTime = 0;
historyLimit = 10000;
keyMode = "vi";
shortcut = "a";
terminal = "kitty";
extraConfig = ''
unbind [
bind Escape copy-mode
bind f set-option status
bind c new-window -c "#{pane_current_path}"
# Set status bar
set -g status-position bottom
set -g status-style fg=white
set -g status-left '#h'
set -g status-left-style 'fg=blue'
# TODO: highlighted for nested local session as well
wg_is_keys_off="#[fg=red,bright]#([ $(tmux show-option -qv key-table) = 'off' ] && echo 'PASSTHRU')#[default]"
set -g status-right "#[fg=yellow,bright]#S $wg_is_keys_off #[fg=green,dim]%H:%M"
set-window-option -g window-status-current-style fg=red
# align center the window list
set -g status-justify centre
'';
}