From 0a474a43cf5a1aa04f52fd234905e2139a18f668 Mon Sep 17 00:00:00 2001 From: Jacob Hinkle Date: Tue, 30 Aug 2022 14:39:55 -0400 Subject: [PATCH] Add hostname to tmux status-left --- home/jacob.nix | 31 +------------------------------ home/tmux.nix | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 30 deletions(-) create mode 100644 home/tmux.nix diff --git a/home/jacob.nix b/home/jacob.nix index 676cded..c6aa5cd 100644 --- a/home/jacob.nix +++ b/home/jacob.nix @@ -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; diff --git a/home/tmux.nix b/home/tmux.nix new file mode 100644 index 0000000..4822eec --- /dev/null +++ b/home/tmux.nix @@ -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 + + ''; +}